Search in sources :

Example 6 with PortConnection

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;
}
Also used : PortConnection(org.osate.aadl2.PortConnection)

Example 7 with PortConnection

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);
        }
    }
}
Also used : InstanceObject(org.osate.aadl2.instance.InstanceObject) FeatureGroup(org.osate.aadl2.FeatureGroup) InstantiatedClassifier(org.osate.aadl2.instance.util.InstanceUtil.InstantiatedClassifier) Subcomponent(org.osate.aadl2.Subcomponent) InstantiatedClassifier(org.osate.aadl2.instance.util.InstanceUtil.InstantiatedClassifier) Classifier(org.osate.aadl2.Classifier) NamedElement(org.osate.aadl2.NamedElement) Feature(org.osate.aadl2.Feature) PortConnection(org.osate.aadl2.PortConnection)

Example 8 with PortConnection

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;
}
Also used : EObject(org.eclipse.emf.ecore.EObject) ArrayList(java.util.ArrayList) AgreeException(com.rockwellcollins.atc.agree.analysis.AgreeException) PortConnection(org.osate.aadl2.PortConnection) HashSet(java.util.HashSet)

Aggregations

PortConnection (org.osate.aadl2.PortConnection)6 FeatureGroup (org.osate.aadl2.FeatureGroup)3 NamedElement (org.osate.aadl2.NamedElement)3 ComponentImplementation (org.osate.aadl2.ComponentImplementation)2 ConnectedElement (org.osate.aadl2.ConnectedElement)2 ContainedNamedElement (org.osate.aadl2.ContainedNamedElement)2 ContainmentPathElement (org.osate.aadl2.ContainmentPathElement)2 DataSubcomponent (org.osate.aadl2.DataSubcomponent)2 FeatureGroupConnection (org.osate.aadl2.FeatureGroupConnection)2 ModeTransition (org.osate.aadl2.ModeTransition)2 ModeTransitionTrigger (org.osate.aadl2.ModeTransitionTrigger)2 PropertyAssociation (org.osate.aadl2.PropertyAssociation)2 SubprogramSubcomponent (org.osate.aadl2.SubprogramSubcomponent)2 SystemSubcomponent (org.osate.aadl2.SystemSubcomponent)2 AgreeException (com.rockwellcollins.atc.agree.analysis.AgreeException)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 EObject (org.eclipse.emf.ecore.EObject)1 EOperation (org.eclipse.emf.ecore.EOperation)1 EPackage (org.eclipse.emf.ecore.EPackage)1