Search in sources :

Example 31 with ComponentClassifier

use of org.osate.aadl2.ComponentClassifier in project osate2 by osate.

the class BottomUpComponentImplTraversal method addUsageReferencesSubcomponents.

private void addUsageReferencesSubcomponents(final EList<Subcomponent> sublist, EList<ComponentImplementation> encl, ComponentImplementation aobj, final ComponentImplementation ci) {
    for (Iterator<Subcomponent> it = sublist.iterator(); it.hasNext(); ) {
        final Subcomponent sc = it.next();
        final ComponentClassifier cc = sc.getAllClassifier();
        if (cc == aobj) {
            encl.add(ci);
        }
    }
}
Also used : ComponentClassifier(org.osate.aadl2.ComponentClassifier) Subcomponent(org.osate.aadl2.Subcomponent)

Example 32 with ComponentClassifier

use of org.osate.aadl2.ComponentClassifier in project osate2 by osate.

the class AccessSpecificationImpl method setClassifier.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setClassifier(ComponentClassifier newClassifier) {
    ComponentClassifier oldClassifier = classifier;
    classifier = newClassifier;
    if (eNotificationRequired()) {
        eNotify(new ENotificationImpl(this, Notification.SET, Aadl2Package.ACCESS_SPECIFICATION__CLASSIFIER, oldClassifier, classifier));
    }
}
Also used : ComponentClassifier(org.osate.aadl2.ComponentClassifier) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 33 with ComponentClassifier

use of org.osate.aadl2.ComponentClassifier in project osate2 by osate.

the class ComponentPrototypeImpl method setConstrainingClassifier.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setConstrainingClassifier(ComponentClassifier newConstrainingClassifier) {
    ComponentClassifier oldConstrainingClassifier = constrainingClassifier;
    constrainingClassifier = newConstrainingClassifier;
    if (eNotificationRequired()) {
        eNotify(new ENotificationImpl(this, Notification.SET, Aadl2Package.COMPONENT_PROTOTYPE__CONSTRAINING_CLASSIFIER, oldConstrainingClassifier, constrainingClassifier));
    }
}
Also used : ComponentClassifier(org.osate.aadl2.ComponentClassifier) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 34 with ComponentClassifier

use of org.osate.aadl2.ComponentClassifier in project osate2 by osate.

the class FeaturePrototypeImpl method setConstrainingClassifier.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setConstrainingClassifier(ComponentClassifier newConstrainingClassifier) {
    ComponentClassifier oldConstrainingClassifier = constrainingClassifier;
    constrainingClassifier = newConstrainingClassifier;
    if (eNotificationRequired()) {
        eNotify(new ENotificationImpl(this, Notification.SET, Aadl2Package.FEATURE_PROTOTYPE__CONSTRAINING_CLASSIFIER, oldConstrainingClassifier, constrainingClassifier));
    }
}
Also used : ComponentClassifier(org.osate.aadl2.ComponentClassifier) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 35 with ComponentClassifier

use of org.osate.aadl2.ComponentClassifier in project AMASE by loonwerks.

the class SafetyUtil method getSafetyAnnexes.

/**
 * getSafetyAnnexes from an AgreeNode
 *
 * @param EObject comp : The component classifier in question will contain
 * the safety annex.
 * @return SafetyContractSubclause : This is the safety annex.
 *
 * MWW: generalized to return a list in case of multiple annex instances.
 * Also generalized the lookup type to support the different kinds of
 * EObjects used by AGREE to represent references.
 */
public static List<SafetyContractSubclause> getSafetyAnnexes(AgreeNode node, boolean isTop) {
    List<SafetyContractSubclause> subclauses = new ArrayList<>();
    // get the component instance from the AGREE program: less brittle than storing a global ref
    // in verify handler - esp. if the user selects a different impl.
    ComponentClassifier comp;
    comp = node.compInst.getClassifier();
    if (!isTop && comp instanceof ComponentImplementation) {
        comp = ((ComponentImplementation) comp).getType();
    } else if (isTop && node.compInst instanceof SystemInstanceImpl) {
        comp = ((SystemInstanceImpl) node.compInst).getComponentImplementation();
    }
    // Grab the annex subclause using the safety package instance
    for (AnnexSubclause annex : AnnexUtil.getAllAnnexSubclauses(comp, SafetyPackage.eINSTANCE.getSafetyContractSubclause())) {
        // Then get the component classifier from that and return the annex
        if (annex instanceof SafetyContractSubclause) {
            // In newer versions of osate the annex this returns annexes in
            // the type as well as the implementation. We want the annex in the
            // specific component.
            EObject container = annex.eContainer();
            while (!(container instanceof ComponentClassifier)) {
                container = container.eContainer();
            }
            if (container == comp) {
                subclauses.add((SafetyContractSubclause) annex);
            }
        }
    }
    return subclauses;
}
Also used : SafetyContractSubclause(edu.umn.cs.crisys.safety.safety.SafetyContractSubclause) ComponentImplementation(org.osate.aadl2.ComponentImplementation) ComponentClassifier(org.osate.aadl2.ComponentClassifier) SystemInstanceImpl(org.osate.aadl2.instance.impl.SystemInstanceImpl) EObject(org.eclipse.emf.ecore.EObject) ArrayList(java.util.ArrayList) AnnexSubclause(org.osate.aadl2.AnnexSubclause)

Aggregations

ComponentClassifier (org.osate.aadl2.ComponentClassifier)76 Subcomponent (org.osate.aadl2.Subcomponent)26 Classifier (org.osate.aadl2.Classifier)22 EObject (org.eclipse.emf.ecore.EObject)19 NamedElement (org.osate.aadl2.NamedElement)19 ComponentImplementation (org.osate.aadl2.ComponentImplementation)16 ArrayList (java.util.ArrayList)15 ComponentInstance (org.osate.aadl2.instance.ComponentInstance)14 AadlPackage (org.osate.aadl2.AadlPackage)13 FeatureGroupType (org.osate.aadl2.FeatureGroupType)12 List (java.util.List)11 ComponentPrototype (org.osate.aadl2.ComponentPrototype)11 Element (org.osate.aadl2.Element)11 ComponentType (org.osate.aadl2.ComponentType)10 Feature (org.osate.aadl2.Feature)9 Mode (org.osate.aadl2.Mode)8 BusinessObjectContext (org.osate.ge.BusinessObjectContext)8 Collectors (java.util.stream.Collectors)7 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)7 ComponentCategory (org.osate.aadl2.ComponentCategory)7