use of com.opensimulationplatform.core.model.modeldescription.variablegroup.voltage.Voltage in project osp-validator by open-simulation-platform.
the class VoltageTypeConverter method convert.
@Override
public Voltage convert(VoltageType voltageType) {
Voltage voltage = new Voltage();
voltage.setName(voltageType.getName());
List<VariableType> variableTypes = voltageType.getVariable();
List<Variable> variables = variableTypes.stream().map(context.variableTypeConverter::convert).collect(Collectors.toList());
voltage.setVariables(variables);
return voltage;
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.voltage.Voltage in project osp-validator by open-simulation-platform.
the class OspModelDescriptionTypeFactory method getVariableGroupsType.
private VariableGroupsType getVariableGroupsType(ModelDescription modelDescription) {
VariableGroupsType variableGroups = new VariableGroupsType();
List<ForceType> forceTypes = variableGroups.getForce();
for (Force force : modelDescription.getForces()) {
forceTypes.add(getForceType(force));
}
List<LinearVelocityType> linearVelocityTypes = variableGroups.getLinearVelocity();
for (LinearVelocity linearVelocity : modelDescription.getLinearVelocities()) {
linearVelocityTypes.add(getLinearVelocityType(linearVelocity));
}
List<LinearDisplacementType> linearDisplacementTypes = variableGroups.getLinearDisplacement();
for (LinearDisplacement linearDisplacement : modelDescription.getLinearDisplacements()) {
linearDisplacementTypes.add(getLinearDisplacementType(linearDisplacement));
}
List<TorqueType> torqueTypes = variableGroups.getTorque();
for (Torque torque : modelDescription.getTorques()) {
torqueTypes.add(getTorqueType(torque));
}
List<AngularVelocityType> angularVelocityTypes = variableGroups.getAngularVelocity();
for (AngularVelocity angularVelocity : modelDescription.getAngularVelocities()) {
angularVelocityTypes.add(getAngularVelocityType(angularVelocity));
}
List<AngularDisplacementType> angularDisplacementTypes = variableGroups.getAngularDisplacement();
for (AngularDisplacement angularDisplacement : modelDescription.getAngularDisplacements()) {
angularDisplacementTypes.add(getAngularDisplacementType(angularDisplacement));
}
List<VoltageType> voltageTypes = variableGroups.getVoltage();
for (Voltage voltage : modelDescription.getVoltages()) {
voltageTypes.add(getVoltageType(voltage));
}
List<CurrentType> currentTypes = variableGroups.getCurrent();
for (Current current : modelDescription.getCurrents()) {
currentTypes.add(getCurrentType(current));
}
List<ChargeType> chargeTypes = variableGroups.getCharge();
for (Charge charge : modelDescription.getCharges()) {
chargeTypes.add(getChargeType(charge));
}
List<PressureType> pressureTypes = variableGroups.getPressure();
for (Pressure pressure : modelDescription.getPressures()) {
pressureTypes.add(getPressureType(pressure));
}
List<VolumeFlowRateType> volumeFlowRateTypes = variableGroups.getVolumeFlowRate();
for (VolumeFlowRate volumeFlowRate : modelDescription.getVolumeFlowRates()) {
volumeFlowRateTypes.add(getVolumeFlowRateType(volumeFlowRate));
}
List<VolumeType> volumeTypes = variableGroups.getVolume();
for (Volume volume : modelDescription.getVolumes()) {
volumeTypes.add(getVolumeType(volume));
}
List<LinearMechanicalPortType> linearMechanicalPortTypes = variableGroups.getLinearMechanicalPort();
for (LinearMechanicalPort linearMechanicalPort : modelDescription.getLinearMechanicalPorts()) {
linearMechanicalPortTypes.add(getLinearMechanicalPortType(linearMechanicalPort));
}
List<AngularMechanicalPortType> angularMechanicalPortTypes = variableGroups.getAngularMechanicalPort();
for (AngularMechanicalPort angularMechanicalPort : modelDescription.getAngularMechanicalPorts()) {
angularMechanicalPortTypes.add(getAngularMechanicalPortType(angularMechanicalPort));
}
List<ElectromagneticPortType> electromagneticPortTypes = variableGroups.getElectromagneticPort();
for (ElectromagneticPort electromagneticPort : modelDescription.getElectromagneticPorts()) {
electromagneticPortTypes.add(getElectromagneticPortType(electromagneticPort));
}
List<HydraulicPortType> hydraulicPortTypes = variableGroups.getHydraulicPort();
for (HydraulicPort hydraulicPort : modelDescription.getHydraulicPorts()) {
hydraulicPortTypes.add(getHydraulicPortType(hydraulicPort));
}
List<LinearMechanicalQuasiPortType> linearMechanicalQuasiPortTypes = variableGroups.getLinearMechanicalQuasiPort();
for (LinearMechanicalQuasiPort linearMechanicalQuasiPort : modelDescription.getLinearMechanicalQuasiPorts()) {
linearMechanicalQuasiPortTypes.add(getLinearMechanicalQuasiPortType(linearMechanicalQuasiPort));
}
List<AngularMechanicalQuasiPortType> angularMechanicalQuasiPortTypes = variableGroups.getAngularMechanicalQuasiPort();
for (AngularMechanicalQuasiPort angularMechanicalQuasiPort : modelDescription.getAngularMechanicalQuasiPorts()) {
angularMechanicalQuasiPortTypes.add(getAngularMechanicalQuasiPortType(angularMechanicalQuasiPort));
}
List<ElectromagneticQuasiPortType> electromagneticQuasiPortTypes = variableGroups.getElectromagneticQuasiPort();
for (ElectromagneticQuasiPort electromagneticQuasiPort : modelDescription.getElectromagneticQuasiPorts()) {
electromagneticQuasiPortTypes.add(getElectromagneticQuasiPortType(electromagneticQuasiPort));
}
List<HydraulicQuasiPortType> hydraulicQuasiPortTypes = variableGroups.getHydraulicQuasiPort();
for (HydraulicQuasiPort hydraulicQuasiPort : modelDescription.getHydraulicQuasiPorts()) {
hydraulicQuasiPortTypes.add(getHydraulicQuasiPortType(hydraulicQuasiPort));
}
return variableGroups;
}
Aggregations