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
dellerDLR committed Aug 14, 2023
1 parent e859f0a commit d0ab391
Show file tree
Hide file tree
Showing 12 changed files with 529 additions and 27 deletions.

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 d0ab391

Please sign in to comment.