Search in sources :

Example 6 with PropagationPathEnd

use of org.osate.aadl2.errormodel.PropagationGraph.PropagationPathEnd in project osate2 by osate.

the class PropagationGraphPathImpl method basicSetPathDst.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetPathDst(PropagationPathEnd newPathDst, NotificationChain msgs) {
    PropagationPathEnd oldPathDst = pathDst;
    pathDst = newPathDst;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PropagationGraphPackage.PROPAGATION_GRAPH_PATH__PATH_DST, oldPathDst, newPathDst);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) PropagationPathEnd(org.osate.aadl2.errormodel.PropagationGraph.PropagationPathEnd)

Example 7 with PropagationPathEnd

use of org.osate.aadl2.errormodel.PropagationGraph.PropagationPathEnd in project osate2 by osate.

the class Util method getAllPropagationPaths.

/**
 * return all propagation paths out of the outgoing error propagation we
 * assume that any type token to be propagated meets the ep type constraint
 *
 * @param ci
 * @param outEP
 * @return
 */
public static EList<PropagationGraphPath> getAllPropagationPaths(PropagationGraph pg, ComponentInstance ci, ErrorPropagation outEP) {
    EList<PropagationGraphPath> result = new BasicEList<PropagationGraphPath>();
    for (PropagationGraphPath propagationPath : pg.getPropagationGraphPaths()) {
        PropagationPathEnd src = propagationPath.getPathSrc();
        if (src.getComponentInstance() == ci) {
            if (src.getErrorPropagation() == outEP) {
                result.add(propagationPath);
            } else {
                // check if one EP is in an ancestor feature instance
                FeatureInstance outepfi = EMV2Util.findFeatureInstance(outEP, ci);
                FeatureInstance srcfi = EMV2Util.findFeatureInstance(src.getErrorPropagation(), ci);
                if (Aadl2InstanceUtil.containedIn(outepfi, srcfi) || Aadl2InstanceUtil.containedIn(srcfi, outepfi)) {
                    result.add(propagationPath);
                }
            }
        }
    }
    return result;
}
Also used : FeatureInstance(org.osate.aadl2.instance.FeatureInstance) BasicEList(org.eclipse.emf.common.util.BasicEList) PropagationPathEnd(org.osate.aadl2.errormodel.PropagationGraph.PropagationPathEnd) PropagationGraphPath(org.osate.aadl2.errormodel.PropagationGraph.PropagationGraphPath)

Example 8 with PropagationPathEnd

use of org.osate.aadl2.errormodel.PropagationGraph.PropagationPathEnd in project osate2 by osate.

the class PropagationGraphPackageImpl method initializePackageContents.

/**
 * Complete the initialization of the package and its meta-model.  This
 * method is guarded to have no affect on any invocation but its first.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void initializePackageContents() {
    if (isInitialized)
        return;
    isInitialized = true;
    // Initialize package
    setName(eNAME);
    setNsPrefix(eNS_PREFIX);
    setNsURI(eNS_URI);
    // Obtain other dependent packages
    InstancePackage theInstancePackage = (InstancePackage) EPackage.Registry.INSTANCE.getEPackage(InstancePackage.eNS_URI);
    ErrorModelPackage theErrorModelPackage = (ErrorModelPackage) EPackage.Registry.INSTANCE.getEPackage(ErrorModelPackage.eNS_URI);
    // Create type parameters
    // Set bounds for type parameters
    // Add supertypes to classes
    // Initialize classes, features, and operations; add parameters
    initEClass(propagationGraphEClass, PropagationGraph.class, "PropagationGraph", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getPropagationGraph_Name(), ecorePackage.getEString(), "name", null, 0, 1, PropagationGraph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getPropagationGraph_Description(), ecorePackage.getEString(), "description", null, 0, 1, PropagationGraph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getPropagationGraph_Components(), theInstancePackage.getComponentInstance(), null, "components", null, 0, -1, PropagationGraph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getPropagationGraph_PropagationGraphPaths(), this.getPropagationGraphPath(), null, "propagationGraphPaths", null, 0, -1, PropagationGraph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getPropagationGraph_Connections(), theInstancePackage.getConnectionInstance(), null, "connections", null, 0, -1, PropagationGraph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getPropagationGraph_Root(), theInstancePackage.getComponentInstance(), null, "root", null, 0, 1, PropagationGraph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEClass(propagationGraphPathEClass, PropagationGraphPath.class, "PropagationGraphPath", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getPropagationGraphPath_Name(), ecorePackage.getEString(), "name", null, 0, 1, PropagationGraphPath.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getPropagationGraphPath_PathSrc(), this.getPropagationPathEnd(), null, "pathSrc", null, 0, 1, PropagationGraphPath.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getPropagationGraphPath_PathDst(), this.getPropagationPathEnd(), null, "pathDst", null, 0, 1, PropagationGraphPath.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getPropagationGraphPath_Highlight(), ecorePackage.getEBoolean(), "highlight", null, 0, 1, PropagationGraphPath.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getPropagationGraphPath_Type(), this.getPropagationType(), "type", null, 0, 1, PropagationGraphPath.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getPropagationGraphPath_Connection(), theInstancePackage.getConnectionInstance(), null, "connection", null, 0, 1, PropagationGraphPath.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEClass(propagationPathEndEClass, PropagationPathEnd.class, "PropagationPathEnd", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getPropagationPathEnd_ConnectionInstance(), theInstancePackage.getConnectionInstance(), null, "connectionInstance", null, 0, 1, PropagationPathEnd.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getPropagationPathEnd_ErrorPropagation(), theErrorModelPackage.getErrorPropagation(), null, "errorPropagation", null, 0, 1, PropagationPathEnd.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getPropagationPathEnd_ComponentInstance(), theInstancePackage.getComponentInstance(), null, "componentInstance", null, 0, 1, PropagationPathEnd.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getPropagationPathEnd_Highlight(), ecorePackage.getEBoolean(), "highlight", null, 0, 1, PropagationPathEnd.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    // Initialize enums and add enum literals
    initEEnum(propagationTypeEEnum, PropagationType.class, "PropagationType");
    addEEnumLiteral(propagationTypeEEnum, PropagationType.CONNECTION);
    addEEnumLiteral(propagationTypeEEnum, PropagationType.BINDING);
    addEEnumLiteral(propagationTypeEEnum, PropagationType.USER_DEFINED);
    // Create resource
    createResource(eNS_URI);
}
Also used : InstancePackage(org.osate.aadl2.instance.InstancePackage) ErrorModelPackage(org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelPackage)

Example 9 with PropagationPathEnd

use of org.osate.aadl2.errormodel.PropagationGraph.PropagationPathEnd in project osate2 by osate.

the class PropagationGraphPathImpl method basicSetPathSrc.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetPathSrc(PropagationPathEnd newPathSrc, NotificationChain msgs) {
    PropagationPathEnd oldPathSrc = pathSrc;
    pathSrc = newPathSrc;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PropagationGraphPackage.PROPAGATION_GRAPH_PATH__PATH_SRC, oldPathSrc, newPathSrc);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) PropagationPathEnd(org.osate.aadl2.errormodel.PropagationGraph.PropagationPathEnd)

Example 10 with PropagationPathEnd

use of org.osate.aadl2.errormodel.PropagationGraph.PropagationPathEnd in project osate2 by osate.

the class Util method addPropagationpathRecord.

private static void addPropagationpathRecord(PropagationGraph pg, ComponentInstance srcCI, ErrorPropagation srcprop, ConnectionInstance dstConni) {
    PropagationGraphPath path = PropagationGraphFactory.eINSTANCE.createPropagationGraphPath();
    PropagationPathEnd srcPE = PropagationGraphFactory.eINSTANCE.createPropagationPathEnd();
    PropagationPathEnd dstPE = PropagationGraphFactory.eINSTANCE.createPropagationPathEnd();
    srcPE.setComponentInstance(srcCI);
    srcPE.setErrorPropagation(srcprop);
    dstPE.setConnectionInstance(dstConni);
    dstPE.setErrorPropagation(null);
    path.setPathSrc(srcPE);
    path.setPathDst(dstPE);
    // new PropagationPathRecord(srcCI, srcprop, dstCI, dstprop, connectionInstance);
    pg.getPropagationGraphPaths().add(path);
    pg.getComponents().add(srcCI);
}
Also used : PropagationPathEnd(org.osate.aadl2.errormodel.PropagationGraph.PropagationPathEnd) PropagationGraphPath(org.osate.aadl2.errormodel.PropagationGraph.PropagationGraphPath)

Aggregations

PropagationPathEnd (org.osate.aadl2.errormodel.PropagationGraph.PropagationPathEnd)9 ComponentInstance (org.osate.aadl2.instance.ComponentInstance)6 FeatureInstance (org.osate.aadl2.instance.FeatureInstance)6 ErrorPropagation (org.osate.xtext.aadl2.errormodel.errorModel.ErrorPropagation)6 PropagationGraphPath (org.osate.aadl2.errormodel.PropagationGraph.PropagationGraphPath)5 TypeSet (org.osate.xtext.aadl2.errormodel.errorModel.TypeSet)4 TypeToken (org.osate.xtext.aadl2.errormodel.errorModel.TypeToken)4 BasicEList (org.eclipse.emf.common.util.BasicEList)3 ErrorSource (org.osate.xtext.aadl2.errormodel.errorModel.ErrorSource)3 ErrorModelState (org.osate.xtext.aadl2.errormodel.util.ErrorModelState)3 LinkedList (java.util.LinkedList)2 EObject (org.eclipse.emf.ecore.EObject)2 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)2 NamedElement (org.osate.aadl2.NamedElement)2 ConnectionInstance (org.osate.aadl2.instance.ConnectionInstance)2 TypeTransformationSet (org.osate.xtext.aadl2.errormodel.errorModel.TypeTransformationSet)2 BigDecimal (java.math.BigDecimal)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 List (java.util.List)1