Skip to content

Commit

Permalink
Task #193 updating of the concept.xmi, modifying of the concept.concept
Browse files Browse the repository at this point in the history
and code review also improvement.
  • Loading branch information
ngat_di authored and ngat_di committed Mar 14, 2024
1 parent 4ef2e00 commit d59f157
Show file tree
Hide file tree
Showing 10 changed files with 507 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@
*/
public class DLRCEFStudyCommandHelper {

public static final String POWER_PARAMETERS = "PowerParameters";
public static final String MASS_PARAMETERS = "MassParameters";
public static final String SYSTEM_PARAMETERS = "SystemParameters";
public static final String EQUIPMENT_MASS_PARAMETERS = "EquipmentMassParameters";
public static final String TEMPERATURE_PARAMETERS = "TemperatureParameters";
public static final String SYSTEM_NAME = "System";
public static final String SUB_SYSTEM_NAME = "SubSystem";
public static final String EQUIPMENT_NAME = "Equipment";

/**
* private Constructor
*/
Expand All @@ -65,7 +74,7 @@ public static Concept getCefConcept(VirSatTransactionalEditingDomain domain) {
*/
public static System createSystemBean(Concept concept) {
System system = new System(concept);
system.setName("System");
system.setName(SYSTEM_NAME);
return system;
}

Expand All @@ -75,7 +84,7 @@ public static System createSystemBean(Concept concept) {
*/
public static SubSystem createSubSystemBean(Concept concept) {
SubSystem subSystem = new SubSystem(concept);
subSystem.setName("subSystem");
subSystem.setName(SUB_SYSTEM_NAME);
return subSystem;
}

Expand All @@ -85,37 +94,37 @@ public static SubSystem createSubSystemBean(Concept concept) {
*/
public static Equipment createEquipmentBean(Concept concept) {
Equipment equipment = new Equipment(concept);
equipment.setName("equipment");
equipment.setName(EQUIPMENT_NAME);
return equipment;
}

//CHECKSTYLE:OFF
public static void addSystemParameters(Concept concept, System system) {
//default unit in concept is percent
SystemParameters systemParameters = new SystemParameters(concept);
systemParameters.setName("systemParameters");
systemParameters.setName(SYSTEM_PARAMETERS);
systemParameters.setSystemMargin(20);
system.add(systemParameters);

SystemMassParameters systemMassParameters = new SystemMassParameters(concept);
systemMassParameters.setName("massParameters");
systemMassParameters.setName(MASS_PARAMETERS);
systemMassParameters.getMassAdapter().setDefaultValue(100);
systemMassParameters.getMassLaunchMax().setDefaultValue(850);
systemMassParameters.getMassPropellant().setDefaultValue(35);
system.add(systemMassParameters);

SystemPowerParameters systemPowerParameters = new SystemPowerParameters(concept);
systemPowerParameters.setName("powerParameters");
systemPowerParameters.setName(POWER_PARAMETERS);
system.add(systemPowerParameters);
}

public static void addSubSystemParameters(Concept concept, SubSystem subSystem) {
SubSystemMassParameters subSystemMassParameters = new SubSystemMassParameters(concept);
subSystemMassParameters.setName("massParameters");
subSystemMassParameters.setName(MASS_PARAMETERS);
subSystem.add(subSystemMassParameters);

SubSystemPowerParameters subSystemPowerParameters = new SubSystemPowerParameters(concept);
subSystemPowerParameters.setName("powerParameters");
subSystemPowerParameters.setName(POWER_PARAMETERS);
subSystem.add(subSystemPowerParameters);
}

Expand All @@ -126,16 +135,16 @@ public static void addEquipmentParameters(Concept concept, Equipment equipment)
equipment.add(equipmentParams);

EquipmentMassParameters equipmentMassParameters = new EquipmentMassParameters(concept);
equipmentMassParameters.setName("EquipmentMassParameters");
equipmentMassParameters.setName(EQUIPMENT_MASS_PARAMETERS);
equipmentMassParameters.getMassPerUnit().setDefaultValue(10);
equipment.add(equipmentMassParameters);

EquipmentPowerParameters powerParameters = new EquipmentPowerParameters(concept);
powerParameters.setName("powerParameters");
powerParameters.setName(POWER_PARAMETERS);
equipment.add(powerParameters);

EquipmentTemperatureParameters temperatureParameters = new EquipmentTemperatureParameters(concept);
temperatureParameters.setName("temperatureParameters");
temperatureParameters.setName(TEMPERATURE_PARAMETERS);
temperatureParameters.getTemperatureNoOpsMax().setDefaultValue(30);
temperatureParameters.getTemperatureNoOpsMin().setDefaultValue(5);
temperatureParameters.getTemperatureOpsMax().setDefaultValue(60);
Expand Down

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
@@ -1 +1,46 @@
/*******************************************************************************
* 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 Migrator1v2Test extends AMigrator1v2Test {

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

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

testMigrator1v1.migrate(conceptMigrateFrom, conceptMigrateFromRepository, conceptMigrateTo);
}

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

Import de.dlr.sc.virsat.model.extension.ps.*;

Expand Down Expand Up @@ -107,7 +107,7 @@ Concept de.dlr.sc.virsat.model.extension.cefx
Type powerAvgWithMargin of Category Parameter quantityKind "Power" unit "Watt";
Type powerEnergyWithMargin of Category Parameter quantityKind "Energy and Work" unit "Joule";

Ref: powerAvgWithMargin = summary{EquipmentPowerParameters.PowerAvgWithMargin, 1};
Ref: powerAvgWithMargin = summary{EquipmentPowerParameters.powerAvgWithMargin, 1};
Ref: powerEnergyWithMargin = powerAvgWithMargin * SystemParameters.modeDuration;
}

Expand Down Expand Up @@ -138,17 +138,17 @@ Concept de.dlr.sc.virsat.model.extension.cefx
Type powerUnitIsInactive of Category Parameter quantityKind "Dimensionless" unit "No Unit" description "Should be 1 if the equipment is inactive in the given mode, meaning it is totally off.";

Type powerDutyCycle of Category Parameter quantityKind "Dimensionless" unit "Percent";
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";
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: PowerUnitOnWithMargin = PowerUnitOn + (PowerUnitOn * EquipmentParameters.marginMaturity);
Ref: PowerUnitStbyWithMargin = PowerUnitStby + (PowerUnitStby * EquipmentParameters.marginMaturity);
Ref: PowerUnitAvgWithMargin = PowerUnitOnWithMargin * powerDutyCycle + PowerUnitStbyWithMargin * (1 - powerDutyCycle);
Ref: PowerAvgWithMargin = (PowerUnitAvgWithMargin + summary{PowerAvgWithMargin, 1}) * ( 1 - powerUnitIsInactive);
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}) * ( 1 - powerUnitIsInactive);
}

Category EquipmentTemperatureParameters {
Expand All @@ -175,5 +175,4 @@ Concept de.dlr.sc.virsat.model.extension.cefx
Reference fromExcel2VirSat[] of Type Parameter;
}

}

}
Loading

0 comments on commit d59f157

Please sign in to comment.