Search in sources :

Example 16 with PropertyNotPresentException

use of org.osate.aadl2.properties.PropertyNotPresentException 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 17 with PropertyNotPresentException

use of org.osate.aadl2.properties.PropertyNotPresentException 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 18 with PropertyNotPresentException

use of org.osate.aadl2.properties.PropertyNotPresentException 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)

Example 19 with PropertyNotPresentException

use of org.osate.aadl2.properties.PropertyNotPresentException in project osate2 by osate.

the class TimingProperties method getExecutionTime.

public static Optional<IntegerWithUnits<TimeUnits>> getExecutionTime(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getExecutionTime_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 20 with PropertyNotPresentException

use of org.osate.aadl2.properties.PropertyNotPresentException in project osate2 by osate.

the class TimingProperties method getThreadSwapExecutionTime.

public static Optional<IntegerRangeWithUnits<TimeUnits>> getThreadSwapExecutionTime(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getThreadSwapExecutionTime_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)

Aggregations

PropertyNotPresentException (org.osate.aadl2.properties.PropertyNotPresentException)238 PropertyExpression (org.osate.aadl2.PropertyExpression)236 Property (org.osate.aadl2.Property)233 ListValue (org.osate.aadl2.ListValue)50 TimeUnits (org.osate.aadl2.contrib.aadlproject.TimeUnits)40 SizeUnits (org.osate.aadl2.contrib.aadlproject.SizeUnits)17 InstanceReferenceValue (org.osate.aadl2.instance.InstanceReferenceValue)13 ClassifierValue (org.osate.aadl2.ClassifierValue)7 StringLiteral (org.osate.aadl2.StringLiteral)6 DataRateUnits (org.osate.aadl2.contrib.aadlproject.DataRateUnits)4 IntegerLiteral (org.osate.aadl2.IntegerLiteral)3 RangeValue (org.osate.aadl2.RangeValue)3 ComponentInstance (org.osate.aadl2.instance.ComponentInstance)3 InvalidModelException (org.osate.aadl2.properties.InvalidModelException)3 List (java.util.List)2 BasicProperty (org.osate.aadl2.BasicProperty)2 EnumerationLiteral (org.osate.aadl2.EnumerationLiteral)2 ModalPropertyValue (org.osate.aadl2.ModalPropertyValue)2 PropertyAssociation (org.osate.aadl2.PropertyAssociation)2 SystemInstance (org.osate.aadl2.instance.SystemInstance)2