Search in sources :

Example 6 with TimeUnits

use of org.osate.aadl2.contrib.aadlproject.TimeUnits in project osate2 by osate.

the class TimingProperties method getFinalizeExecutionTime.

public static Optional<IntegerRangeWithUnits<TimeUnits>> getFinalizeExecutionTime(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getFinalizeExecutionTime_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(new IntegerRangeWithUnits<>(resolved, TimeUnits.class, lookupContext, mode));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : TimeUnits(org.osate.aadl2.contrib.aadlproject.TimeUnits) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 7 with TimeUnits

use of org.osate.aadl2.contrib.aadlproject.TimeUnits in project osate2 by osate.

the class TimingProperties method getFirstDispatchTime.

public static Optional<IntegerWithUnits<TimeUnits>> getFirstDispatchTime(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getFirstDispatchTime_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(new IntegerWithUnits<>(resolved, TimeUnits.class));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : TimeUnits(org.osate.aadl2.contrib.aadlproject.TimeUnits) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 8 with TimeUnits

use of org.osate.aadl2.contrib.aadlproject.TimeUnits in project osate2 by osate.

the class TimingProperties method getComputeDeadline.

public static Optional<IntegerWithUnits<TimeUnits>> getComputeDeadline(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getComputeDeadline_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(new IntegerWithUnits<>(resolved, TimeUnits.class));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : TimeUnits(org.osate.aadl2.contrib.aadlproject.TimeUnits) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 9 with TimeUnits

use of org.osate.aadl2.contrib.aadlproject.TimeUnits in project osate2 by osate.

the class TimingProperties method getDeadline.

public static Optional<IntegerWithUnits<TimeUnits>> getDeadline(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getDeadline_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(new IntegerWithUnits<>(resolved, TimeUnits.class));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : TimeUnits(org.osate.aadl2.contrib.aadlproject.TimeUnits) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 10 with TimeUnits

use of org.osate.aadl2.contrib.aadlproject.TimeUnits in project osate2 by osate.

the class TimingProperties method getFinalizeDeadline.

public static Optional<IntegerWithUnits<TimeUnits>> getFinalizeDeadline(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getFinalizeDeadline_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(new IntegerWithUnits<>(resolved, TimeUnits.class));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : TimeUnits(org.osate.aadl2.contrib.aadlproject.TimeUnits) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Aggregations

PropertyExpression (org.osate.aadl2.PropertyExpression)41 Property (org.osate.aadl2.Property)40 PropertyNotPresentException (org.osate.aadl2.properties.PropertyNotPresentException)40 TimeUnits (org.osate.aadl2.contrib.aadlproject.TimeUnits)39 IntegerRangeWithUnits (org.osate.pluginsupport.properties.IntegerRangeWithUnits)2 ComponentCategory (org.osate.aadl2.ComponentCategory)1 FeatureGroup (org.osate.aadl2.FeatureGroup)1 FlowEnd (org.osate.aadl2.FlowEnd)1 ListValue (org.osate.aadl2.ListValue)1 PropertyConstant (org.osate.aadl2.PropertyConstant)1 FeatureCategory (org.osate.aadl2.instance.FeatureCategory)1 FeatureInstance (org.osate.aadl2.instance.FeatureInstance)1 FlowSpecificationInstance (org.osate.aadl2.instance.FlowSpecificationInstance)1 IntegerWithUnits (org.osate.pluginsupport.properties.IntegerWithUnits)1