Search in sources :

Example 16 with SizeUnits

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

the class Sei method getRamcapacity.

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

Example 17 with SizeUnits

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

the class Sei method getRombudget.

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

Example 18 with SizeUnits

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

the class Sei method getRomcapacity.

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

Example 19 with SizeUnits

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

the class Sei method getRambudget.

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

Example 20 with SizeUnits

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

the class Sei method getRamactual.

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

Aggregations

PropertyExpression (org.osate.aadl2.PropertyExpression)18 Property (org.osate.aadl2.Property)17 SizeUnits (org.osate.aadl2.contrib.aadlproject.SizeUnits)17 PropertyNotPresentException (org.osate.aadl2.properties.PropertyNotPresentException)17 ComponentClassifier (org.osate.aadl2.ComponentClassifier)2 DataImplementation (org.osate.aadl2.DataImplementation)2 DataSubcomponent (org.osate.aadl2.DataSubcomponent)2 Classifier (org.osate.aadl2.Classifier)1 ComponentCategory (org.osate.aadl2.ComponentCategory)1 Feature (org.osate.aadl2.Feature)1 FeatureGroupType (org.osate.aadl2.FeatureGroupType)1 PropertyConstant (org.osate.aadl2.PropertyConstant)1 Subcomponent (org.osate.aadl2.Subcomponent)1 ComponentInstance (org.osate.aadl2.instance.ComponentInstance)1 FeatureInstance (org.osate.aadl2.instance.FeatureInstance)1 IntegerWithUnits (org.osate.pluginsupport.properties.IntegerWithUnits)1