Skip to content

Commit

Permalink
Task #169 Improve naming of EquipmentPowerParameters
Browse files Browse the repository at this point in the history
  • Loading branch information
dellerDLR committed Aug 15, 2023
1 parent 2435551 commit 64a41d8
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public void testWithConcept2() {
EquipmentPowerParameters equipPowerParams = new EquipmentPowerParameters(conceptCEFX);
SystemMode idleMode = new SystemMode(conceptCEFX);

equipPowerParams.getPowerPerUnitOn().setDefaultValue(DEFAULT_VALUE);
equipPowerParams.getPowerUnitOn().setDefaultValue(DEFAULT_VALUE);
equipParams.setMarginMaturity(DEFAULT_MARGIN);

equipment.add(equipParams);
Expand All @@ -211,16 +211,16 @@ public void testWithConcept2() {
Value idleValue = new Value(conceptCEFX);
idleValue.setMode(idleMode);
idleValue.setValue(IDLE_VALUE);
equipPowerParams.getPowerPerUnitOn().getModeValues().add(idleValue);
equipPowerParams.getPowerUnitOn().getModeValues().add(idleValue);

IEquationSectionContainer container = (IEquationSectionContainer) equipPowerParams.getATypeInstance();
List<Equation> equations = container.getEquationSection().getEquations();

EquationHelper eqHelper = new EquationHelper();
eqHelper.evaluate(equations, UserRegistry.getInstance());

assertEquals("Default value correct", EXPECTED_DEFAULT, equipPowerParams.getPowerPerUnitOnWithMargin().getDefaultValue(), TEST_EPSILON);
assertEquals("Idle value correct", EXPECTED_IDLE, equipPowerParams.getPowerPerUnitOnWithMargin().getModeValues().get(0).getValue(), TEST_EPSILON);
assertEquals("Default value correct", EXPECTED_DEFAULT, equipPowerParams.getPowerUnitOnWithMargin().getDefaultValue(), TEST_EPSILON);
assertEquals("Idle value correct", EXPECTED_IDLE, equipPowerParams.getPowerUnitOnWithMargin().getModeValues().get(0).getValue(), TEST_EPSILON);
}

@Test
Expand Down
18 changes: 9 additions & 9 deletions de.dlr.sc.virsat.model.extension.cefx/concept/concept.concept
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ Concept de.dlr.sc.virsat.model.extension.cefx
Type powerUnitActive of Category Parameter quantityKind "Dimensionless" unit "No Unit" description "Should be 1 if the equipment is active in the given mode, 0 in case it is totally off.";

Type powerDutyCycle of Category Parameter quantityKind "Dimensionless" unit "Percent";
Type PowerPerUnitOn of Category Parameter quantityKind "Power" unit "Watt";
Type PowerPerUnitStby of Category Parameter quantityKind "Power" unit "Watt";
Type PowerPerUnitOnWithMargin of Category Parameter quantityKind "Power" unit "Watt";
Type PowerPerUnitStbyWithMargin of Category Parameter quantityKind "Power" unit "Watt";
Type PowerPerUnitAvgWithMargin of Category Parameter quantityKind "Power" unit "Watt";
Type PowerUnitOn of Category Parameter quantityKind "Power" unit "Watt";
Type PowerUnitStby of Category Parameter quantityKind "Power" unit "Watt";
Type PowerUnitOnWithMargin of Category Parameter quantityKind "Power" unit "Watt";
Type PowerUnitStbyWithMargin of Category Parameter quantityKind "Power" unit "Watt";
Type PowerUnitAvgWithMargin of Category Parameter quantityKind "Power" unit "Watt";
Type PowerAvgWithMargin of Category Parameter quantityKind "Power" unit "Watt";

Ref: PowerPerUnitOnWithMargin = PowerPerUnitOn + (PowerPerUnitOn * EquipmentParameters.marginMaturity);
Ref: PowerPerUnitStbyWithMargin = PowerPerUnitStby + (PowerPerUnitStby * EquipmentParameters.marginMaturity);
Ref: PowerPerUnitAvgWithMargin = PowerPerUnitOnWithMargin * powerDutyCycle + PowerPerUnitStbyWithMargin * (1 - powerDutyCycle);
Ref: PowerAvgWithMargin = (PowerPerUnitAvgWithMargin + summary{PowerAvgWithMargin, 1}) * powerUnitActive;
Ref: PowerUnitOnWithMargin = PowerUnitOn + (PowerUnitOn * EquipmentParameters.marginMaturity);
Ref: PowerUnitStbyWithMargin = PowerUnitStby + (PowerUnitStby * EquipmentParameters.marginMaturity);
Ref: PowerUnitAvgWithMargin = PowerUnitOnWithMargin * powerDutyCycle + PowerUnitStbyWithMargin * (1 - powerDutyCycle);
Ref: PowerAvgWithMargin = (PowerUnitAvgWithMargin + summary{PowerAvgWithMargin, 1}) * powerUnitActive;
}

Category EquipmentTemperatureParameters {
Expand Down
30 changes: 15 additions & 15 deletions de.dlr.sc.virsat.model.extension.cefx/concept/concept.xmi
Original file line number Diff line number Diff line change
Expand Up @@ -232,36 +232,36 @@
<applicableFor href="platform:/resource/de.dlr.sc.virsat.model.extension.ps/concept.concept#de.dlr.sc.virsat.model.extension.ps.ElementRealization"/>
<equationDefinitions>
<expression xsi:type="dvlm_calc:AdditionAndSubtraction">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitOn"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitOn"/>
<right xsi:type="dvlm_calc:Parenthesis">
<right xsi:type="dvlm_calc:MultiplicationAndDivision" operator="*">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitOn"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitOn"/>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentParameters.marginMaturity"/>
</right>
</right>
</expression>
<result xsi:type="dvlm_calc:TypeDefinitionResult" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitOnWithMargin"/>
<result xsi:type="dvlm_calc:TypeDefinitionResult" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitOnWithMargin"/>
</equationDefinitions>
<equationDefinitions>
<expression xsi:type="dvlm_calc:AdditionAndSubtraction">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitStby"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitStby"/>
<right xsi:type="dvlm_calc:Parenthesis">
<right xsi:type="dvlm_calc:MultiplicationAndDivision" operator="*">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitStby"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitStby"/>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentParameters.marginMaturity"/>
</right>
</right>
</expression>
<result xsi:type="dvlm_calc:TypeDefinitionResult" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitStbyWithMargin"/>
<result xsi:type="dvlm_calc:TypeDefinitionResult" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitStbyWithMargin"/>
</equationDefinitions>
<equationDefinitions>
<expression xsi:type="dvlm_calc:AdditionAndSubtraction">
<left xsi:type="dvlm_calc:MultiplicationAndDivision" operator="*">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitOnWithMargin"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitOnWithMargin"/>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.powerDutyCycle"/>
</left>
<right xsi:type="dvlm_calc:MultiplicationAndDivision" operator="*">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitStbyWithMargin"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitStbyWithMargin"/>
<right xsi:type="dvlm_calc:Parenthesis">
<right xsi:type="dvlm_calc:AdditionAndSubtraction" operator="-">
<left xsi:type="dvlm_calc:NumberLiteral" value="1"/>
Expand All @@ -270,13 +270,13 @@
</right>
</right>
</expression>
<result xsi:type="dvlm_calc:TypeDefinitionResult" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitAvgWithMargin"/>
<result xsi:type="dvlm_calc:TypeDefinitionResult" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitAvgWithMargin"/>
</equationDefinitions>
<equationDefinitions>
<expression xsi:type="dvlm_calc:MultiplicationAndDivision" operator="*">
<left xsi:type="dvlm_calc:Parenthesis">
<right xsi:type="dvlm_calc:AdditionAndSubtraction">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitAvgWithMargin"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitAvgWithMargin"/>
<right xsi:type="dvlm_calc:SetFunction" operator="summary" typeDefinition="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerAvgWithMargin" depth="1"/>
</right>
</left>
Expand All @@ -286,11 +286,11 @@
</equationDefinitions>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="powerUnitActive" description="Should be 1 if the equipment is active in the given mode, 0 in case it is totally off." type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Dimensionless" unitName="No Unit"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="powerDutyCycle" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Dimensionless" unitName="Percent"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerPerUnitOn" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerPerUnitStby" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerPerUnitOnWithMargin" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerPerUnitStbyWithMargin" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerPerUnitAvgWithMargin" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerUnitOn" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerUnitStby" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerUnitOnWithMargin" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerUnitStbyWithMargin" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerUnitAvgWithMargin" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerAvgWithMargin" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<extendsCategory href="platform:/plugin/de.dlr.sc.virsat.model.ext.core/concept/concept.xmi#de.dlr.sc.virsat.model.ext.core.GenericCategory"/>
</categories>
Expand Down
30 changes: 15 additions & 15 deletions de.dlr.sc.virsat.model.extension.cefx/concept/concept_v1_1.xmi
Original file line number Diff line number Diff line change
Expand Up @@ -232,36 +232,36 @@
<applicableFor href="platform:/resource/de.dlr.sc.virsat.model.extension.ps/concept.concept#de.dlr.sc.virsat.model.extension.ps.ElementRealization"/>
<equationDefinitions>
<expression xsi:type="dvlm_calc:AdditionAndSubtraction">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitOn"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitOn"/>
<right xsi:type="dvlm_calc:Parenthesis">
<right xsi:type="dvlm_calc:MultiplicationAndDivision" operator="*">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitOn"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitOn"/>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentParameters.marginMaturity"/>
</right>
</right>
</expression>
<result xsi:type="dvlm_calc:TypeDefinitionResult" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitOnWithMargin"/>
<result xsi:type="dvlm_calc:TypeDefinitionResult" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitOnWithMargin"/>
</equationDefinitions>
<equationDefinitions>
<expression xsi:type="dvlm_calc:AdditionAndSubtraction">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitStby"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitStby"/>
<right xsi:type="dvlm_calc:Parenthesis">
<right xsi:type="dvlm_calc:MultiplicationAndDivision" operator="*">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitStby"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitStby"/>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentParameters.marginMaturity"/>
</right>
</right>
</expression>
<result xsi:type="dvlm_calc:TypeDefinitionResult" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitStbyWithMargin"/>
<result xsi:type="dvlm_calc:TypeDefinitionResult" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitStbyWithMargin"/>
</equationDefinitions>
<equationDefinitions>
<expression xsi:type="dvlm_calc:AdditionAndSubtraction">
<left xsi:type="dvlm_calc:MultiplicationAndDivision" operator="*">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitOnWithMargin"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitOnWithMargin"/>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.powerDutyCycle"/>
</left>
<right xsi:type="dvlm_calc:MultiplicationAndDivision" operator="*">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitStbyWithMargin"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitStbyWithMargin"/>
<right xsi:type="dvlm_calc:Parenthesis">
<right xsi:type="dvlm_calc:AdditionAndSubtraction" operator="-">
<left xsi:type="dvlm_calc:NumberLiteral" value="1"/>
Expand All @@ -270,13 +270,13 @@
</right>
</right>
</expression>
<result xsi:type="dvlm_calc:TypeDefinitionResult" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitAvgWithMargin"/>
<result xsi:type="dvlm_calc:TypeDefinitionResult" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitAvgWithMargin"/>
</equationDefinitions>
<equationDefinitions>
<expression xsi:type="dvlm_calc:MultiplicationAndDivision" operator="*">
<left xsi:type="dvlm_calc:Parenthesis">
<right xsi:type="dvlm_calc:AdditionAndSubtraction">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerPerUnitAvgWithMargin"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerUnitAvgWithMargin"/>
<right xsi:type="dvlm_calc:SetFunction" operator="summary" typeDefinition="de.dlr.sc.virsat.model.extension.cefx.EquipmentPowerParameters.PowerAvgWithMargin" depth="1"/>
</right>
</left>
Expand All @@ -286,11 +286,11 @@
</equationDefinitions>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="powerUnitActive" description="Should be 1 if the equipment is active in the given mode, 0 in case it is totally off." type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Dimensionless" unitName="No Unit"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="powerDutyCycle" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Dimensionless" unitName="Percent"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerPerUnitOn" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerPerUnitStby" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerPerUnitOnWithMargin" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerPerUnitStbyWithMargin" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerPerUnitAvgWithMargin" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerUnitOn" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerUnitStby" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerUnitOnWithMargin" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerUnitStbyWithMargin" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerUnitAvgWithMargin" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="PowerAvgWithMargin" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Power" unitName="Watt"/>
<extendsCategory href="platform:/plugin/de.dlr.sc.virsat.model.ext.core/concept/concept.xmi#de.dlr.sc.virsat.model.ext.core.GenericCategory"/>
</categories>
Expand Down
Loading

0 comments on commit 64a41d8

Please sign in to comment.