use of org.osate.aadl2.PortConnection in project osate2 by osate.
the class ComponentImplementationImpl method createOwnedPortConnection.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PortConnection createOwnedPortConnection() {
PortConnection newOwnedPortConnection = (PortConnection) create(Aadl2Package.eINSTANCE.getPortConnection());
getOwnedPortConnections().add(newOwnedPortConnection);
return newOwnedPortConnection;
}
use of org.osate.aadl2.PortConnection in project osate2 by osate.
the class PropertyImpl method getPropertyValueFromDeclarativeModel.
protected void getPropertyValueFromDeclarativeModel(EvaluationContext ctx, PropertyAcc pas) throws InvalidModelException {
InstanceObject io = ctx.getInstanceObject();
List<? extends NamedElement> compDecls = io.getInstantiatedObjects();
if (compDecls == null) {
}
// Here we assume compDecls is empty or has only one element
if (!compDecls.isEmpty()) {
NamedElement compDecl = compDecls.get(0);
if (compDecl == null) {
return;
}
InstantiatedClassifier ic = ctx.getClassifierCache().get(io);
Classifier cl = (ic == null) ? null : ic.getClassifier();
if (compDecl instanceof Subcomponent) {
((SubcomponentImpl) compDecl).getPropertyValue(this, pas, cl, false);
} else if (compDecl instanceof FeatureGroup) {
((FeatureGroupImpl) compDecl).getPropertyValue(this, pas, cl, false);
} else if (compDecl instanceof Feature) {
((FeatureImpl) compDecl).getPropertyValue(this, pas, cl, false);
} else if (compDecl instanceof PortConnection) {
((PortConnectionImpl) compDecl).getPropertyValue(this, pas);
} else {
compDecl.getPropertyValueInternal(this, pas, true);
}
}
}
use of org.osate.aadl2.PortConnection in project AGREE by loonwerks.
the class AgreeASTBuilder method filterConnections.
private List<AgreeConnection> filterConnections(List<AgreeAADLConnection> aadlConnections, List<AgreeOverriddenConnection> userDefinedConections) {
List<AgreeConnection> conns = new ArrayList<>();
// connection twice
for (AgreeAADLConnection aadlConn : aadlConnections) {
EObject aadlRef = aadlConn.reference;
AgreeConnection replacementConn = aadlConn;
for (AgreeOverriddenConnection agreeConn : userDefinedConections) {
EObject agreeRef = agreeConn.aadlConn;
if (aadlRef == agreeRef) {
replacementConn = agreeConn;
break;
}
}
if (!conns.contains(replacementConn)) {
conns.add(replacementConn);
}
}
// throw errors for non-override connections with multiple fanin
Set<AgreeVar> destinations = new HashSet<>();
for (AgreeConnection conn : conns) {
if (conn instanceof AgreeAADLConnection) {
AgreeAADLConnection aadlConn = (AgreeAADLConnection) conn;
if (!destinations.add(aadlConn.destinationVarName)) {
String message = "Multiple connections to feature '" + (aadlConn.reference instanceof PortConnection ? ((PortConnection) aadlConn.reference).getDestination().getConnectionEnd().getQualifiedName() : aadlConn.destinationVarName) + "'. Remove the additional AADL connections or override them with a connection statement " + "in the AGREE annex.";
throw new AgreeException(message);
}
}
}
return conns;
}
Aggregations