use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class Validator method addCharge.
private void addCharge(ModelDescription modelDescription, Map<Object, Object> map, ChargeType element) {
VariableGroup variableGroup = ModelDescriptionUtil.getVariableGroupByName(modelDescription, element.getName());
if (variableGroup != null) {
map.put(variableGroup, element);
addVariables(modelDescription, map, element.getVariable());
}
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class Validator method addAngularMechanicalPort.
private void addAngularMechanicalPort(ModelDescription modelDescription, Map<Object, Object> map, AngularMechanicalPortType element) {
VariableGroup variableGroup = ModelDescriptionUtil.getVariableGroupByName(modelDescription, element.getName());
if (variableGroup != null) {
map.put(variableGroup, element);
addTorque(modelDescription, map, element.getTorque());
addAngularVelocity(modelDescription, map, element.getAngularVelocity());
}
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class Validator method addPressure.
private void addPressure(ModelDescription modelDescription, Map<Object, Object> map, PressureType element) {
VariableGroup variableGroup = ModelDescriptionUtil.getVariableGroupByName(modelDescription, element.getName());
if (variableGroup != null) {
map.put(variableGroup, element);
addVariables(modelDescription, map, element.getVariable());
}
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class Validator method addVolume.
private void addVolume(ModelDescription modelDescription, Map<Object, Object> map, VolumeType element) {
VariableGroup variableGroup = ModelDescriptionUtil.getVariableGroupByName(modelDescription, element.getName());
if (variableGroup != null) {
map.put(variableGroup, element);
addVariables(modelDescription, map, element.getVariable());
}
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class SystemStructureFactoryTest method canCreate.
@Test
public void canCreate() {
SystemStructureFactory factory = new SystemStructureFactory();
SystemStructure systemStructure = factory.create(TestResources.OSP_SYSTEM_STRUCTURE_CRANE);
List<Simulator> simulators = systemStructure.getSimulators();
List<VariableConnection> variableConnections = systemStructure.getVariableConnections();
List<VariableGroupConnection> variableGroupConnections = systemStructure.getVariableGroupConnections();
assertEquals(2, simulators.size());
Simulator s1 = simulators.get(0);
assertEquals("crane_controller", s1.getName().get());
Simulator s2 = simulators.get(1);
assertEquals("knuckle_boom_crane", s2.getName().get());
assertEquals(1, variableConnections.size());
VariableConnection variableConnection = variableConnections.get(0);
Simulator simulatorA = variableConnection.getSimulatorA();
Variable variableA = variableConnection.getVariableA();
Simulator simulatorB = variableConnection.getSimulatorB();
Variable variableB = variableConnection.getVariableB();
assertEquals("crane_controller", simulatorA.getName().get());
assertEquals("Act_Limits[1]", variableA.getName().get());
assertEquals("knuckle_boom_crane", simulatorB.getName().get());
assertEquals("Act_Limits[1]", variableB.getName().get());
assertEquals(1, variableGroupConnections.size());
VariableGroupConnection variableGroupConnection = variableGroupConnections.get(0);
Simulator simulatorA1 = variableGroupConnection.getSimulatorA();
VariableGroup variableGroupA = variableGroupConnection.getVariableGroupA();
Simulator simulatorB1 = variableGroupConnection.getSimulatorB();
VariableGroup variableGroupB = variableGroupConnection.getVariableGroupB();
assertEquals("crane_controller", simulatorA1.getName().get());
assertEquals("linear_mechanical_port", variableGroupA.getName().get());
assertEquals("knuckle_boom_crane", simulatorB1.getName().get());
assertEquals("linear_mechanical_port", variableGroupB.getName().get());
}
Aggregations