Skip to content

Commit

Permalink
Task #169 Change "massPerUnit" to "mass"
Browse files Browse the repository at this point in the history
  • Loading branch information
elle_de authored and elle_de committed Aug 14, 2023
1 parent c688cfe commit 3dc8f7f
Show file tree
Hide file tree
Showing 15 changed files with 538 additions and 36 deletions.
6 changes: 3 additions & 3 deletions de.dlr.sc.virsat.cef.target/virsat_cef_development.target
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<unit id="org.eclipse.xtext.sdk.feature.group" version="2.26.0.v20220228-0901"/>
<unit id="org.eclipse.gef.feature.group" version="3.11.0.201606061308"/>
<unit id="org.eclipse.egit.feature.group" version="6.1.0.202203080745-r"/>
<repository location="http://download.eclipse.org/releases/2022-03"/>
<repository location="https://download.eclipse.org/releases/2022-03"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.team.svn.feature.group" version="4.8.0.v20220904-1901"/>
Expand All @@ -87,14 +87,14 @@
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.sphinx.core.feature.group" version="0.11.0.201706140911"/>
<unit id="org.eclipse.sphinx.emf.serialization.feature.group" version="0.11.0.201706140911"/>
<repository location="http://download.eclipse.org/sphinx/releases/0.11.x"/>
<repository location="https://download.eclipse.org/sphinx/releases/0.11.x"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.rmf.reqif10.feature.feature.group" version="0.13.0.201509161042"/>
<unit id="org.eclipse.rmf.reqif10.pror.feature.feature.group" version="0.13.0.201509161042"/>
<unit id="org.eclipse.rmf.reqif10.thirdparty.feature.feature.group" version="0.13.0.201509161042"/>
<unit id="org.eclipse.rmf.reqif10.sdk.feature.feature.group" version="0.13.0.201509161042"/>
<repository location="http://download.eclipse.org/rmf/updates/releases"/>
<repository location="https://download.eclipse.org/rmf/updates/releases"/>
</location>
</locations>
<environment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@
</left>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cef.interfaces.EquipmentDataParameters.DataDutyCycle"/>
</expression>
<result xsi:type="dvlm_calc:EquationIntermediateResult" uuid="ccc50c1f-af91-4b46-bf74-92a40f25f3ec" name="DataCombinedDutyCycle"/>
<result xsi:type="dvlm_calc:EquationIntermediateResult" uuid="6fef5bea-d5c7-449f-80e3-7ab61a3bfb11" name="DataCombinedDutyCycle"/>
</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.cef.interfaces.EquipmentDataParameters.DataPerUnitOnWithMargin"/>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="ccc50c1f-af91-4b46-bf74-92a40f25f3ec"/>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="6fef5bea-d5c7-449f-80e3-7ab61a3bfb11"/>
</left>
<right xsi:type="dvlm_calc:MultiplicationAndDivision" operator="*">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cef.interfaces.EquipmentDataParameters.DataPerUnitStbyWithMargin"/>
<right xsi:type="dvlm_calc:Parenthesis">
<right xsi:type="dvlm_calc:AdditionAndSubtraction" operator="-">
<left xsi:type="dvlm_calc:NumberLiteral" value="1"/>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="ccc50c1f-af91-4b46-bf74-92a40f25f3ec"/>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="6fef5bea-d5c7-449f-80e3-7ab61a3bfb11"/>
</right>
</right>
</right>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@
</left>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cef.interfaces.EquipmentDataParameters.DataDutyCycle"/>
</expression>
<result xsi:type="dvlm_calc:EquationIntermediateResult" uuid="ccc50c1f-af91-4b46-bf74-92a40f25f3ec" name="DataCombinedDutyCycle"/>
<result xsi:type="dvlm_calc:EquationIntermediateResult" uuid="6fef5bea-d5c7-449f-80e3-7ab61a3bfb11" name="DataCombinedDutyCycle"/>
</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.cef.interfaces.EquipmentDataParameters.DataPerUnitOnWithMargin"/>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="ccc50c1f-af91-4b46-bf74-92a40f25f3ec"/>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="6fef5bea-d5c7-449f-80e3-7ab61a3bfb11"/>
</left>
<right xsi:type="dvlm_calc:MultiplicationAndDivision" operator="*">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cef.interfaces.EquipmentDataParameters.DataPerUnitStbyWithMargin"/>
<right xsi:type="dvlm_calc:Parenthesis">
<right xsi:type="dvlm_calc:AdditionAndSubtraction" operator="-">
<left xsi:type="dvlm_calc:NumberLiteral" value="1"/>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="ccc50c1f-af91-4b46-bf74-92a40f25f3ec"/>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="6fef5bea-d5c7-449f-80e3-7ab61a3bfb11"/>
</right>
</right>
</right>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ public void testWithConcept1() {
equipment.add(equipParams);
equipment.add(equipMassParams);

equipMassParams.getMassPerUnit().setDefaultValue(DEFAULT_VALUE);
equipMassParams.getMass().setDefaultValue(DEFAULT_VALUE);
equipParams.setMarginMaturity(DEFAULT_MARGIN);

Value idleValue = new Value(conceptCEFX);
idleValue.setMode(idleMode);
idleValue.setValue(IDLE_VALUE);
equipMassParams.getMassPerUnit().getModeValues().add(idleValue);
equipMassParams.getMass().getModeValues().add(idleValue);

IEquationSectionContainer container = (IEquationSectionContainer) equipMassParams.getATypeInstance();
List<Equation> equations = container.getEquationSection().getEquations();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*******************************************************************************
* Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package de.dlr.sc.virsat.model.extension.cefx.migrator;

// *****************************************************************
// * Import Statements
// *****************************************************************


import de.dlr.sc.virsat.model.dvlm.DVLMFactory;
import de.dlr.sc.virsat.model.dvlm.Repository;

// *****************************************************************
// * Class Declaration
// *****************************************************************

import org.junit.Test;

/**
* Auto Generated Class inheriting from Generator Gap Class
*
* This class is generated once, do your changes here
*
* VirSat DLR CEF Concept for extended Product Structures
*
*/
public class Migrator1v1Test extends AMigrator1v1Test {

@Test
public void testMigrator1v1() {
Migrator1v1 testMigrator1v1 = new Migrator1v1();

Repository repository = DVLMFactory.eINSTANCE.createRepository();
repository.getActiveConcepts().add(conceptMigrateFromRepository);

//TODO: Setup test instances

testMigrator1v1.migrate(conceptMigrateFrom, conceptMigrateFromRepository, conceptMigrateTo);

//TODO: Check for correct migration
}

}
8 changes: 4 additions & 4 deletions de.dlr.sc.virsat.model.extension.cefx/concept/concept.concept
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*******************************************************************************/
Concept de.dlr.sc.virsat.model.extension.cefx
displayname "CEF-Extended"
version 1.0
version 1.1
description "VirSat DLR CEF Concept for extended Product Structures"
beta {

Expand Down Expand Up @@ -123,12 +123,12 @@ Concept de.dlr.sc.virsat.model.extension.cefx
Applicable For [de.dlr.sc.virsat.model.extension.ps.ElementDefinition, de.dlr.sc.virsat.model.extension.ps.ElementConfiguration, de.dlr.sc.virsat.model.extension.ps.ElementOccurence, de.dlr.sc.virsat.model.extension.ps.ElementRealization];
Cardinality 1;

Type massPerUnit of Category Parameter quantityKind "Mass" unit "Kilogram";
Type mass of Category Parameter quantityKind "Mass" unit "Kilogram";
Type massTotal of Category Parameter quantityKind "Mass" unit "Kilogram";
Type massTotalWithMargin of Category Parameter quantityKind "Mass" unit "Kilogram";

Ref: massTotal = massPerUnit + summary{massTotal, 1};
Ref: massTotalWithMargin = massPerUnit + (massPerUnit * EquipmentParameters.marginMaturity) + summary{massTotalWithMargin, 1};
Ref: massTotal = mass + summary{massTotal, 1};
Ref: massTotalWithMargin = mass + (mass * EquipmentParameters.marginMaturity) + summary{massTotalWithMargin, 1};
}

Category EquipmentPowerParameters {
Expand Down
10 changes: 5 additions & 5 deletions de.dlr.sc.virsat.model.extension.cefx/concept/concept.xmi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ASCII"?>
<dvlm_c:Concept xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dvlm_c="http://www.virsat.sc.dlr.de/dvlm/v9/c" xmlns:dvlm_calc="http://www.virsat.sc.dlr.de/dvlm/v9/calc" xmlns:dvlm_cppd="http://www.virsat.sc.dlr.de/dvlm/v9/cp/cppd" name="de.dlr.sc.virsat.model.extension.cefx" description="VirSat DLR CEF Concept for extended Product Structures" displayName="CEF-Extended" beta="true">
<dvlm_c:Concept xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dvlm_c="http://www.virsat.sc.dlr.de/dvlm/v9/c" xmlns:dvlm_calc="http://www.virsat.sc.dlr.de/dvlm/v9/calc" xmlns:dvlm_cppd="http://www.virsat.sc.dlr.de/dvlm/v9/cp/cppd" name="de.dlr.sc.virsat.model.extension.cefx" description="VirSat DLR CEF Concept for extended Product Structures" version="1.1" displayName="CEF-Extended" beta="true">
<imports importedNamespace="de.dlr.sc.virsat.model.extension.ps.*"/>
<imports importedNamespace="de.dlr.sc.virsat.model.ext.core.*"/>
<categories name="SystemMode">
Expand Down Expand Up @@ -200,18 +200,18 @@
<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.EquipmentMassParameters.massPerUnit"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentMassParameters.mass"/>
<right xsi:type="dvlm_calc:SetFunction" operator="summary" typeDefinition="de.dlr.sc.virsat.model.extension.cefx.EquipmentMassParameters.massTotal" depth="1"/>
</expression>
<result xsi:type="dvlm_calc:TypeDefinitionResult" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentMassParameters.massTotal"/>
</equationDefinitions>
<equationDefinitions>
<expression xsi:type="dvlm_calc:AdditionAndSubtraction">
<left xsi:type="dvlm_calc:AdditionAndSubtraction">
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentMassParameters.massPerUnit"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentMassParameters.mass"/>
<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.EquipmentMassParameters.massPerUnit"/>
<left xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentMassParameters.mass"/>
<right xsi:type="dvlm_calc:ReferencedDefinitionInput" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentParameters.marginMaturity"/>
</right>
</right>
Expand All @@ -220,7 +220,7 @@
</expression>
<result xsi:type="dvlm_calc:TypeDefinitionResult" reference="de.dlr.sc.virsat.model.extension.cefx.EquipmentMassParameters.massTotalWithMargin"/>
</equationDefinitions>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="massPerUnit" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Mass" unitName="Kilogram"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="mass" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Mass" unitName="Kilogram"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="massTotal" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Mass" unitName="Kilogram"/>
<properties xsi:type="dvlm_cppd:ComposedProperty" name="massTotalWithMargin" type="de.dlr.sc.virsat.model.extension.cefx.Parameter" quantityKindName="Mass" unitName="Kilogram"/>
<extendsCategory href="platform:/plugin/de.dlr.sc.virsat.model.ext.core/concept/concept.xmi#de.dlr.sc.virsat.model.ext.core.GenericCategory"/>
Expand Down
Loading

0 comments on commit 3dc8f7f

Please sign in to comment.