Search in sources :

Example 26 with Voltage

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;
}
Also used : Variable(com.opensimulationplatform.core.model.modeldescription.Variable) VariableType(com.opensimulationplatform.modeldescription.xml.model.VariableType) Voltage(com.opensimulationplatform.core.model.modeldescription.variablegroup.voltage.Voltage)

Example 27 with 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;
}
Also used : Torque(com.opensimulationplatform.core.model.modeldescription.variablegroup.torque.Torque) ElectromagneticPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.electromagneticport.ElectromagneticPort) LinearDisplacement(com.opensimulationplatform.core.model.modeldescription.variablegroup.lineardisplacement.LinearDisplacement) AngularMechanicalQuasiPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.angularmechanicalquasiport.AngularMechanicalQuasiPort) HydraulicQuasiPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.hydraulicquasiport.HydraulicQuasiPort) ElectromagneticQuasiPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.electromagneticquasiport.ElectromagneticQuasiPort) LinearMechanicalPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.linearmechanicalport.LinearMechanicalPort) Pressure(com.opensimulationplatform.core.model.modeldescription.variablegroup.pressure.Pressure) Volume(com.opensimulationplatform.core.model.modeldescription.variablegroup.volume.Volume) AngularDisplacement(com.opensimulationplatform.core.model.modeldescription.variablegroup.angulardisplacement.AngularDisplacement) Current(com.opensimulationplatform.core.model.modeldescription.variablegroup.current.Current) LinearVelocity(com.opensimulationplatform.core.model.modeldescription.variablegroup.linearvelocity.LinearVelocity) Force(com.opensimulationplatform.core.model.modeldescription.variablegroup.force.Force) AngularMechanicalPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.angularmechanicalport.AngularMechanicalPort) HydraulicPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.hydraulicport.HydraulicPort) LinearMechanicalQuasiPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.linearmechanicalquasiport.LinearMechanicalQuasiPort) VolumeFlowRate(com.opensimulationplatform.core.model.modeldescription.variablegroup.volumeflowrate.VolumeFlowRate) Voltage(com.opensimulationplatform.core.model.modeldescription.variablegroup.voltage.Voltage) Charge(com.opensimulationplatform.core.model.modeldescription.variablegroup.charge.Charge) AngularVelocity(com.opensimulationplatform.core.model.modeldescription.variablegroup.angularvelocity.AngularVelocity)

Aggregations

Voltage (com.opensimulationplatform.core.model.modeldescription.variablegroup.voltage.Voltage)27 Variable (com.opensimulationplatform.core.model.modeldescription.Variable)18 ValidationDiagnostic (com.opensimulationplatform.core.validation.ValidationDiagnostic)16 Test (org.junit.Test)16 Unit (com.opensimulationplatform.core.model.modeldescription.Unit)13 Charge (com.opensimulationplatform.core.model.modeldescription.variablegroup.charge.Charge)8 Current (com.opensimulationplatform.core.model.modeldescription.variablegroup.current.Current)8 ElectromagneticPort (com.opensimulationplatform.core.model.modeldescription.variablegroup.electromagneticport.ElectromagneticPort)8 ElectromagneticQuasiPort (com.opensimulationplatform.core.model.modeldescription.variablegroup.electromagneticquasiport.ElectromagneticQuasiPort)8 ModelDescription (com.opensimulationplatform.core.model.modeldescription.ModelDescription)7 ElectricPower (com.opensimulationplatform.core.model.modeldescription.variablegroup.electricpower.ElectricPower)4 Frequency (com.opensimulationplatform.core.model.modeldescription.variablegroup.frequency.Frequency)4 AngularDisplacement (com.opensimulationplatform.core.model.modeldescription.variablegroup.angulardisplacement.AngularDisplacement)3 AngularMechanicalPort (com.opensimulationplatform.core.model.modeldescription.variablegroup.angularmechanicalport.AngularMechanicalPort)3 AngularMechanicalQuasiPort (com.opensimulationplatform.core.model.modeldescription.variablegroup.angularmechanicalquasiport.AngularMechanicalQuasiPort)3 AngularVelocity (com.opensimulationplatform.core.model.modeldescription.variablegroup.angularvelocity.AngularVelocity)3 BusFeedback (com.opensimulationplatform.core.model.modeldescription.variablegroup.busfeedback.BusFeedback)3 Force (com.opensimulationplatform.core.model.modeldescription.variablegroup.force.Force)3 HydraulicPort (com.opensimulationplatform.core.model.modeldescription.variablegroup.hydraulicport.HydraulicPort)3 HydraulicQuasiPort (com.opensimulationplatform.core.model.modeldescription.variablegroup.hydraulicquasiport.HydraulicQuasiPort)3