Closed AliShirazi closed 11 years ago
Hello,
The property set would be rather the following : property set Physical_Properties is Power_Units: type units (W, KW => W * 1000, MW => KW * 1000, GW => MW * 1000, TW => GW * 1000); Power: type aadlinteger 0 W .. Max_Time units Physical_Properties::Power_Units;
Max_Power: constant Physical_Properties::Power => 1000 W;
end Physical_Properties;
Can you tell me if that addresses your issue ?
Regards.
No feedback. I assume this is fixed.
Your original constant was defined for the property type units Power_Units.
Julien showed how to introduce the Power type. Power: type aadlinteger units Physical_Properties::Power_Units;
You can also define it as shown below, i.e., by specifying the type in place rather than a separate property type. property set Physical_Properties is Power_Units: type units (W, KW => W * 1000, MW => KW * 1000, GW => MW * 1000, TW => GW * 1000);
Max_Power: constant aadlinteger units Physical_Properties::Power_Units => 1000 W; end Physical_Properties;
second usage example
Hi,
I am currently developing with AADL in Eclipse using the osate2 libraries, and am using the official reference book. The following code segment below would not allow me to declare a constant property called Max_Power, despite the correct syntax being used. The code is the following:
The following errors are given:
-Assigning Integer value to property 'Physical_Properties::Max_Power' of type 'UnitsType' physical_properties.aadl/aram/physical_properties.aadl Xtext Check (fast)
-Couldn't resolve reference to UnitLiteral 'W'.