use of org.osate.aadl2.contrib.aadlproject.TimeUnits in project osate2 by osate.
the class DeploymentProperties method getAllowedPeriod.
public static Optional<List<IntegerRangeWithUnits<TimeUnits>>> getAllowedPeriod(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getAllowedPeriod_Property(lookupContext);
try {
PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
return Optional.of(((ListValue) resolved).getOwnedListElements().stream().map(element1 -> {
PropertyExpression resolved1 = CodeGenUtil.resolveNamedValue(element1, lookupContext, mode);
return new IntegerRangeWithUnits<>(resolved1, TimeUnits.class, lookupContext, mode);
}).collect(Collectors.toList()));
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
use of org.osate.aadl2.contrib.aadlproject.TimeUnits in project osate2 by osate.
the class CommunicationProperties method getActualLatency.
public static Optional<IntegerRangeWithUnits<TimeUnits>> getActualLatency(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getActualLatency_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();
}
}
use of org.osate.aadl2.contrib.aadlproject.TimeUnits in project osate2 by osate.
the class CommunicationProperties method getLatency.
public static Optional<IntegerRangeWithUnits<TimeUnits>> getLatency(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getLatency_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();
}
}
use of org.osate.aadl2.contrib.aadlproject.TimeUnits in project osate2 by osate.
the class AadlProject method getMaxTime.
public static IntegerWithUnits<TimeUnits> getMaxTime(EObject lookupContext) {
PropertyConstant constant = getMaxTime_PropertyConstant(lookupContext);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(constant.getConstantValue());
return new IntegerWithUnits<>(resolved, TimeUnits.class);
}
use of org.osate.aadl2.contrib.aadlproject.TimeUnits in project osate2 by osate.
the class TimingProperties method getDispatchJitter.
public static Optional<IntegerWithUnits<TimeUnits>> getDispatchJitter(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getDispatchJitter_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();
}
}
Aggregations