Search in sources :

Example 1 with DataRateUnits

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

the class CommunicationProperties method getDataRate.

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

Example 2 with DataRateUnits

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

the class Sei method getBandwidthcapacity.

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

Example 3 with DataRateUnits

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

the class Sei method getBandwidthbudget.

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

Aggregations

Property (org.osate.aadl2.Property)3 PropertyExpression (org.osate.aadl2.PropertyExpression)3 DataRateUnits (org.osate.aadl2.contrib.aadlproject.DataRateUnits)3 PropertyNotPresentException (org.osate.aadl2.properties.PropertyNotPresentException)3