Search in sources :

Example 6 with ProcessorClassifier

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

the class AadlBaTypeChecker method timedActionCheck.

private boolean timedActionCheck(TimedAction ta) {
    BehaviorTime resolvedTime = _fact.createBehaviorTime();
    boolean result = behaviorTimeCheck((DeclarativeTime) ta.getLowerTime(), resolvedTime);
    ta.setLowerTime(resolvedTime);
    if (ta.getUpperTime() != null) {
        resolvedTime = _fact.createBehaviorTime();
        result &= behaviorTimeCheck((DeclarativeTime) ta.getUpperTime(), resolvedTime);
        ta.setUpperTime(resolvedTime);
    }
    if (ta.isSetProcessorClassifier()) {
        List<ProcessorClassifier> qnes = new ArrayList<ProcessorClassifier>(ta.getProcessorClassifier().size());
        qnes.addAll(ta.getProcessorClassifier());
        ta.unsetProcessorClassifier();
        QualifiedNamedElement qne;
        Classifier tmp;
        for (int i = 0; i < qnes.size(); i++) {
            qne = (QualifiedNamedElement) qnes.get(i);
            tmp = (Classifier) uniqueNamedElementReferenceResolver(qne, TypeCheckRule.PROCESSOR_RULE);
            if (tmp != null) {
                try {
                    ta.getProcessorClassifier().add((ProcessorClassifier) tmp);
                } catch (IllegalArgumentException e) {
                    // if the user set the same more than once.
                    System.out.println("catch IllegalArgumentException AadlTypeChecker");
                }
            } else {
                result = false;
            }
        }
    }
    return result;
}
Also used : QualifiedNamedElement(org.osate.ba.declarative.QualifiedNamedElement) ArrayList(java.util.ArrayList) Classifier(org.osate.aadl2.Classifier) ComponentClassifier(org.osate.aadl2.ComponentClassifier) DataClassifier(org.osate.aadl2.DataClassifier) ProcessorClassifier(org.osate.aadl2.ProcessorClassifier) DeclarativeTime(org.osate.ba.declarative.DeclarativeTime) ProcessorClassifier(org.osate.aadl2.ProcessorClassifier)

Aggregations

ProcessorClassifier (org.osate.aadl2.ProcessorClassifier)4 DataClassifier (org.osate.aadl2.DataClassifier)3 EOperation (org.eclipse.emf.ecore.EOperation)2 Classifier (org.osate.aadl2.Classifier)2 ComponentClassifier (org.osate.aadl2.ComponentClassifier)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 org.osate.aadl2 (org.osate.aadl2)1 Aadl2Package (org.osate.aadl2.Aadl2Package)1 AadlString (org.osate.aadl2.AadlString)1 AbstractFeature (org.osate.aadl2.AbstractFeature)1 BusAccess (org.osate.aadl2.BusAccess)1 ClassifierValue (org.osate.aadl2.ClassifierValue)1 ComponentPrototype (org.osate.aadl2.ComponentPrototype)1 ComponentPrototypeBinding (org.osate.aadl2.ComponentPrototypeBinding)1 DataAccess (org.osate.aadl2.DataAccess)1 DataPort (org.osate.aadl2.DataPort)1 DataPrototype (org.osate.aadl2.DataPrototype)1 DataSubcomponent (org.osate.aadl2.DataSubcomponent)1 EventDataPort (org.osate.aadl2.EventDataPort)1