use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class Validator method addLinearMechanicalPort.
private void addLinearMechanicalPort(ModelDescription modelDescription, Map<Object, Object> map, LinearMechanicalPortType element) {
VariableGroup variableGroup = ModelDescriptionUtil.getVariableGroupByName(modelDescription, element.getName());
if (variableGroup != null) {
map.put(variableGroup, element);
addForce(modelDescription, map, element.getForce());
addLinearVelocity(modelDescription, map, element.getLinearVelocity());
}
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class Validator method addTorque.
private void addTorque(ModelDescription modelDescription, Map<Object, Object> map, TorqueType torqueElement) {
VariableGroup torque = ModelDescriptionUtil.getVariableGroupByName(modelDescription, torqueElement.getName());
if (torque != null) {
map.put(torque, torqueElement);
addVariables(modelDescription, map, torqueElement.getVariable());
}
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class Validator method addAngularMechanicalQuasiPort.
private void addAngularMechanicalQuasiPort(ModelDescription modelDescription, Map<Object, Object> map, AngularMechanicalQuasiPortType element) {
VariableGroup variableGroup = ModelDescriptionUtil.getVariableGroupByName(modelDescription, element.getName());
if (variableGroup != null) {
map.put(variableGroup, element);
addTorque(modelDescription, map, element.getTorque());
addAngularDisplacement(modelDescription, map, element.getAngularDisplacement());
}
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class VE_VariableGroupConnection_1_Test method valid.
@Test
public void valid() {
VariableGroup va = new Force();
va.setName("va");
VariableGroup vb = new Force();
vb.setName("vb");
VariableGroupConnection vgc = new VariableGroupConnection();
vgc.setVariableGroupA(va);
vgc.setVariableGroupB(vb);
vgc.setSimulatorA(new Simulator());
vgc.setSimulatorB(new Simulator());
builder.build(vgc);
builder.complete();
List<ValidationDiagnostic<VariableGroupConnection>> diagnostics = validationError.validate();
assertTrue(diagnostics.isEmpty());
}
Aggregations