Search in sources :

Example 21 with Pressure

use of com.opensimulationplatform.core.model.modeldescription.variablegroup.pressure.Pressure in project osp-validator by open-simulation-platform.

the class VE_Pressure_1_Test method valid.

@Test
public void valid() {
    Pressure pressure = new Pressure();
    Variable v1 = new Variable();
    v1.setCausality(Variable.Causality.INPUT);
    v1.setType(Variable.Type.REAL);
    v1.setUnit(new Unit());
    Variable v2 = new Variable();
    v2.setCausality(v1.getCausality());
    v2.setType(v1.getType());
    v2.setUnit(v1.getUnit());
    pressure.setVariables(Arrays.asList(v1, v2));
    builder.build(pressure);
    builder.complete();
    List<ValidationDiagnostic<Pressure>> diagnostics = validationError.validate();
    assertTrue(diagnostics.isEmpty());
}
Also used : Variable(com.opensimulationplatform.core.model.modeldescription.Variable) ValidationDiagnostic(com.opensimulationplatform.core.validation.ValidationDiagnostic) Unit(com.opensimulationplatform.core.model.modeldescription.Unit) Pressure(com.opensimulationplatform.core.model.modeldescription.variablegroup.pressure.Pressure) Test(org.junit.Test)

Example 22 with Pressure

use of com.opensimulationplatform.core.model.modeldescription.variablegroup.pressure.Pressure in project osp-validator by open-simulation-platform.

the class VE_Pressure_1 method getInvalidObjects.

@Override
protected List<Pressure> getInvalidObjects() {
    OWLClass validationErrorClass = context.owl.dataFactory.getOWLClass(VE_Pressure_1, context.owl.prefixManager);
    Set<OWLNamedIndividual> invalidIndividuals = context.invalidIndividuals.get(validationErrorClass);
    return invalidIndividuals.stream().map(individual -> (Pressure) context.variableGroups.get(individual)).collect(Collectors.toList());
}
Also used : List(java.util.List) Pressure(com.opensimulationplatform.core.model.modeldescription.variablegroup.pressure.Pressure) OWLNamedIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual) Set(java.util.Set) ValidationError(com.opensimulationplatform.core.validation.ValidationError) VE_Pressure_1(com.opensimulationplatform.gen.owl.model.OntologyClasses.VE_Pressure_1) Collectors(java.util.stream.Collectors) OWLClass(org.semanticweb.owlapi.model.OWLClass) OWLNamedIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual) OWLClass(org.semanticweb.owlapi.model.OWLClass) Pressure(com.opensimulationplatform.core.model.modeldescription.variablegroup.pressure.Pressure)

Example 23 with Pressure

use of com.opensimulationplatform.core.model.modeldescription.variablegroup.pressure.Pressure in project osp-validator by open-simulation-platform.

the class OspModelDescriptionTypeConverter method convert.

@Override
public ModelDescription convert(OspModelDescriptionType ospModelDescriptionType) {
    ModelDescription modelDescription = context.modelDescription;
    modelDescription.getVariables().addAll(context.fmiModelDescription.getVariables());
    modelDescription.getUnits().addAll(context.fmiModelDescription.getUnits());
    UnitDefinitionsType unitDefinitions = ospModelDescriptionType.getUnitDefinitions();
    if (unitDefinitions != null) {
        List<UnitType> unitTypes = unitDefinitions.getUnit();
        List<Unit> units = context.unitTypeConverter.convert(unitTypes);
        modelDescription.getUnits().addAll(units);
    }
    VariableGroupsType variableGroups = ospModelDescriptionType.getVariableGroups();
    if (variableGroups != null) {
        List<GenericType> genericTypes = variableGroups.getGeneric();
        List<Generic> generics = context.genericTypeConverter.convert(genericTypes);
        modelDescription.getGenerics().addAll(generics);
        List<AngularDisplacementType> angularDisplacementTypes = variableGroups.getAngularDisplacement();
        List<AngularDisplacement> angularDisplacements = context.angularDisplacementTypeConverter.convert(angularDisplacementTypes);
        modelDescription.getAngularDisplacements().addAll(angularDisplacements);
        List<ChargeType> chargeTypes = variableGroups.getCharge();
        List<Charge> charges = context.chargeTypeConverter.convert(chargeTypes);
        modelDescription.getCharges().addAll(charges);
        List<LinearDisplacementType> linearDisplacementTypes = variableGroups.getLinearDisplacement();
        List<LinearDisplacement> linearDisplacements = context.linearDisplacementTypeConverter.convert(linearDisplacementTypes);
        modelDescription.getLinearDisplacements().addAll(linearDisplacements);
        List<VolumeType> volumeTypes = variableGroups.getVolume();
        List<Volume> volumes = context.volumeTypeConverter.convert(volumeTypes);
        modelDescription.getVolumes().addAll(volumes);
        List<ForceType> forceTypes = variableGroups.getForce();
        List<Force> forces = context.forceTypeConverter.convert(forceTypes);
        modelDescription.getForces().addAll(forces);
        List<PressureType> pressureTypes = variableGroups.getPressure();
        List<Pressure> pressures = context.pressureTypeConverter.convert(pressureTypes);
        modelDescription.getPressures().addAll(pressures);
        List<TorqueType> torqueTypes = variableGroups.getTorque();
        List<Torque> torques = context.torqueTypeConverter.convert(torqueTypes);
        modelDescription.getTorques().addAll(torques);
        List<VoltageType> voltageTypes = variableGroups.getVoltage();
        List<Voltage> voltages = context.voltageTypeConverter.convert(voltageTypes);
        modelDescription.getVoltages().addAll(voltages);
        List<AngularVelocityType> angularVelocityTypes = variableGroups.getAngularVelocity();
        List<AngularVelocity> angularVelocities = context.angularVelocityTypeConverter.convert(angularVelocityTypes);
        modelDescription.getAngularVelocities().addAll(angularVelocities);
        List<CurrentType> currentTypes = variableGroups.getCurrent();
        List<Current> currents = context.currentTypeConverter.convert(currentTypes);
        modelDescription.getCurrents().addAll(currents);
        List<LinearVelocityType> linearVelocityTypes = variableGroups.getLinearVelocity();
        List<LinearVelocity> linearVelocities = context.linearVelocityTypeConverter.convert(linearVelocityTypes);
        modelDescription.getLinearVelocities().addAll(linearVelocities);
        List<VolumeFlowRateType> volumeFlowRateTypes = variableGroups.getVolumeFlowRate();
        List<VolumeFlowRate> volumeFlowRates = context.volumeFlowRateTypeConverter.convert(volumeFlowRateTypes);
        modelDescription.getVolumeFlowRates().addAll(volumeFlowRates);
        List<AngularMechanicalPortType> angularMechanicalPortTypes = variableGroups.getAngularMechanicalPort();
        List<AngularMechanicalPort> angularMechanicalPorts = context.angularMechanicalPortTypeConverter.convert(angularMechanicalPortTypes);
        modelDescription.getAngularMechanicalPorts().addAll(angularMechanicalPorts);
        List<ElectromagneticPortType> electromagneticPortTypes = variableGroups.getElectromagneticPort();
        List<ElectromagneticPort> electromagneticPorts = context.electromagneticPortTypeConverter.convert(electromagneticPortTypes);
        modelDescription.getElectromagneticPorts().addAll(electromagneticPorts);
        List<HydraulicPortType> hydraulicPortTypes = variableGroups.getHydraulicPort();
        List<HydraulicPort> hydraulicPorts = context.hydraulicPortTypeConverter.convert(hydraulicPortTypes);
        modelDescription.getHydraulicPorts().addAll(hydraulicPorts);
        List<LinearMechanicalPortType> linearMechanicalPortTypes = variableGroups.getLinearMechanicalPort();
        List<LinearMechanicalPort> linearMechanicalPorts = context.linearMechanicalPortTypeConverter.convert(linearMechanicalPortTypes);
        modelDescription.getLinearMechanicalPorts().addAll(linearMechanicalPorts);
        List<AngularMechanicalQuasiPortType> angularMechanicalQuasiPortTypes = variableGroups.getAngularMechanicalQuasiPort();
        List<AngularMechanicalQuasiPort> angularMechanicalQuasiPorts = context.angularMechanicalQuasiPortTypeConverter.convert(angularMechanicalQuasiPortTypes);
        modelDescription.getAngularMechanicalQuasiPorts().addAll(angularMechanicalQuasiPorts);
        List<ElectromagneticQuasiPortType> electromagneticQuasiPortTypes = variableGroups.getElectromagneticQuasiPort();
        List<ElectromagneticQuasiPort> electromagneticQuasiPorts = context.electromagneticQuasiPortTypeConverter.convert(electromagneticQuasiPortTypes);
        modelDescription.getElectromagneticQuasiPorts().addAll(electromagneticQuasiPorts);
        List<HydraulicQuasiPortType> hydraulicQuasiPortTypes = variableGroups.getHydraulicQuasiPort();
        List<HydraulicQuasiPort> hydraulicQuasiPorts = context.hydraulicQuasiPortTypeConverter.convert(hydraulicQuasiPortTypes);
        modelDescription.getHydraulicQuasiPorts().addAll(hydraulicQuasiPorts);
        List<LinearMechanicalQuasiPortType> linearMechanicalQuasiPortTypes = variableGroups.getLinearMechanicalQuasiPort();
        List<LinearMechanicalQuasiPort> linearMechanicalQuasiPorts = context.linearMechanicalQuasiPortTypeConverter.convert(linearMechanicalQuasiPortTypes);
        modelDescription.getLinearMechanicalQuasiPorts().addAll(linearMechanicalQuasiPorts);
        List<NmeaGgaFixType> nmeaGgaFixTypes = variableGroups.getNmeaGgaFix();
        List<NmeaGgaFix> nmeaGgaFixes = context.nmeaGgaFixTypeConverter.convert(nmeaGgaFixTypes);
        modelDescription.getNmeaGgaFixs().addAll(nmeaGgaFixes);
        List<NmeaGgaLatitudeLongitudeType> nmeaGgaLatitudeLongitudeTypes = variableGroups.getNmeaGgaLatitudeLongitude();
        List<NmeaGgaLatitudeLongitude> nmeaGgaLatitudeLongitude = context.nmeaGgaLatitudeLongitudeTypeConverter.convert(nmeaGgaLatitudeLongitudeTypes);
        modelDescription.getNmeaGgaLatitudeLongitudes().addAll(nmeaGgaLatitudeLongitude);
        List<NmeaGgaType> nmeaGgaTypes = variableGroups.getNmeaGga();
        List<NmeaGga> nmeaGga = context.nmeaGgaTypeConverter.convert(nmeaGgaTypes);
        modelDescription.getNmeaGgas().addAll(nmeaGga);
        List<NmeaGstEllipseType> nmeaGstEllipseTypes = variableGroups.getNmeaGstEllipse();
        List<NmeaGstEllipse> nmeaGstEllipse = context.nmeaGstEllipseTypeConverter.convert(nmeaGstEllipseTypes);
        modelDescription.getNmeaGstEllipses().addAll(nmeaGstEllipse);
        List<NmeaGstPositionErrorType> nmeaGstPositionErrorTypes = variableGroups.getNmeaGstPositionError();
        List<NmeaGstPositionError> nmeaGstPositionError = context.nmeaGstPositionErrorTypeConverter.convert(nmeaGstPositionErrorTypes);
        modelDescription.getNmeaGstPositionErrors().addAll(nmeaGstPositionError);
        List<NmeaGstRmsType> nmeaGstRmsTypes = variableGroups.getNmeaGstRms();
        List<NmeaGstRms> nmeaGstRms = context.nmeaGstRmsTypeConverter.convert(nmeaGstRmsTypes);
        modelDescription.getNmeaGstRmss().addAll(nmeaGstRms);
        List<NmeaGstType> nmeaGstTypes = variableGroups.getNmeaGst();
        List<NmeaGst> nmeaGst = context.nmeaGstTypeConverter.convert(nmeaGstTypes);
        modelDescription.getNmeaGsts().addAll(nmeaGst);
        List<NmeaMwvType> nmeaMwvTypes = variableGroups.getNmeaMwv();
        List<NmeaMwv> nmeaMwv = context.nmeaMwvTypeConverter.convert(nmeaMwvTypes);
        modelDescription.getNmeaMwvs().addAll(nmeaMwv);
        List<NmeaStatusType> nmeaStatusTypes = variableGroups.getNmeaStatus();
        List<NmeaStatus> nmeaStatus = context.nmeaStatusTypeConverter.convert(nmeaStatusTypes);
        modelDescription.getNmeaStatuses().addAll(nmeaStatus);
        List<NmeaSxnType> nmeaSxnTypes = variableGroups.getNmeaSxn();
        List<NmeaSxn> nmeaSxn = context.nmeaSxnTypeConverter.convert(nmeaSxnTypes);
        modelDescription.getNmeaSxns().addAll(nmeaSxn);
        List<NmeaThsType> nmeaThsTypes = variableGroups.getNmeaThs();
        List<NmeaThs> nmeaThs = context.nmeaThsTypeConverter.convert(nmeaThsTypes);
        modelDescription.getNmeaThss().addAll(nmeaThs);
        List<NmeaTimeType> nmeaTimeTypes = variableGroups.getNmeaTime();
        List<NmeaTime> nmeaTime = context.nmeaTimeTypeConverter.convert(nmeaTimeTypes);
        modelDescription.getNmeaTimes().addAll(nmeaTime);
        List<NmeaTrueHeadingType> nmeaTrueHeadingTypes = variableGroups.getNmeaTrueHeading();
        List<NmeaTrueHeading> nmeaTrueHeading = context.nmeaTrueHeadingTypeConverter.convert(nmeaTrueHeadingTypes);
        modelDescription.getNmeaTrueHeadings().addAll(nmeaTrueHeading);
        List<NmeaWindDirectionType> nmeaWindDirectionTypes = variableGroups.getNmeaWindDirection();
        List<NmeaWindDirection> nmeaWindDirection = context.nmeaWindDirectionTypeConverter.convert(nmeaWindDirectionTypes);
        modelDescription.getNmeaWindDirections().addAll(nmeaWindDirection);
        List<NmeaWindSpeedType> nmeaWindSpeedTypes = variableGroups.getNmeaWindSpeed();
        List<NmeaWindSpeed> nmeaWindSpeed = context.nmeaWindSpeedTypeConverter.convert(nmeaWindSpeedTypes);
        modelDescription.getNmeaWindSpeeds().addAll(nmeaWindSpeed);
        List<AngularAccelerationType> angularAccelerationTypes = variableGroups.getAngularAcceleration();
        List<AngularAcceleration> angularAcceleration = context.angularAccelerationTypeConverter.convert(angularAccelerationTypes);
        modelDescription.getAngularAccelerations().addAll(angularAcceleration);
        List<AzimuthAngleType> azimuthAngleTypes = variableGroups.getAzimuthAngle();
        List<AzimuthAngle> azimuthAngle = context.azimuthAngleTypeConverter.convert(azimuthAngleTypes);
        modelDescription.getAzimuthAngles().addAll(azimuthAngle);
        List<AzimuthThrusterFeedbackType> azimuthThrusterFeedbackTypes = variableGroups.getAzimuthThrusterFeedback();
        List<AzimuthThrusterFeedback> azimuthThrusterFeedback = context.azimuthThrusterFeedbackTypeConverter.convert(azimuthThrusterFeedbackTypes);
        modelDescription.getAzimuthThrusterFeedbacks().addAll(azimuthThrusterFeedback);
        List<AzimuthThrusterSetpointType> azimuthThrusterSetpointTypes = variableGroups.getAzimuthThrusterSetpoint();
        List<AzimuthThrusterSetpoint> azimuthThrusterSetpoint = context.azimuthThrusterSetpointTypeConverter.convert(azimuthThrusterSetpointTypes);
        modelDescription.getAzimuthThrusterSetpoints().addAll(azimuthThrusterSetpoint);
        List<BatteryFeedbackType> batteryFeedbackTypes = variableGroups.getBatteryFeedback();
        List<BatteryFeedback> batteryFeedback = context.batteryFeedbackTypeConverter.convert(batteryFeedbackTypes);
        modelDescription.getBatteryFeedbacks().addAll(batteryFeedback);
        List<BladePitchType> bladePitchTypes = variableGroups.getBladePitch();
        List<BladePitch> bladePitch = context.bladePitchTypeConverter.convert(bladePitchTypes);
        modelDescription.getBladePitches().addAll(bladePitch);
        List<BusFeedbackType> busFeedbackTypes = variableGroups.getBusFeedback();
        List<BusFeedback> busFeedback = context.busFeedbackTypeConverter.convert(busFeedbackTypes);
        modelDescription.getBusFeedbacks().addAll(busFeedback);
        List<ElectricPowerType> electricPowerTypes = variableGroups.getElectricPower();
        List<ElectricPower> electricPower = context.electricPowerTypeConverter.convert(electricPowerTypes);
        modelDescription.getElectricPowers().addAll(electricPower);
        List<FixedThrusterFeedbackType> fixedThrusterFeedbackTypes = variableGroups.getFixedThrusterFeedback();
        List<FixedThrusterFeedback> fixedThrusterFeedback = context.fixedThrusterFeedbackTypeConverter.convert(fixedThrusterFeedbackTypes);
        modelDescription.getFixedThrusterFeedbacks().addAll(fixedThrusterFeedback);
        List<FixedThrusterSetpointType> fixedThrusterSetpointTypes = variableGroups.getFixedThrusterSetpoint();
        List<FixedThrusterSetpoint> fixedThrusterSetpoint = context.fixedThrusterSetpointTypeConverter.convert(fixedThrusterSetpointTypes);
        modelDescription.getFixedThrusterSetpoints().addAll(fixedThrusterSetpoint);
        List<FrequencyType> frequencyTypes = variableGroups.getFrequency();
        List<Frequency> frequency = context.frequencyTypeConverter.convert(frequencyTypes);
        modelDescription.getFrequencies().addAll(frequency);
        List<GeneratorFeedbackType> generatorFeedbackTypes = variableGroups.getGeneratorFeedback();
        List<GeneratorFeedback> generatorFeedback = context.generatorFeedbackTypeConverter.convert(generatorFeedbackTypes);
        modelDescription.getGeneratorFeedbacks().addAll(generatorFeedback);
        List<LinearAccelerationType> linearAccelerationTypes = variableGroups.getLinearAcceleration();
        List<LinearAcceleration> linearAcceleration = context.linearAccelerationTypeConverter.convert(linearAccelerationTypes);
        modelDescription.getLinearAccelerations().addAll(linearAcceleration);
        List<ShaftSpeedType> shaftSpeedTypes = variableGroups.getShaftSpeed();
        List<ShaftSpeed> shaftSpeed = context.shaftSpeedTypeConverter.convert(shaftSpeedTypes);
        modelDescription.getShaftSpeeds().addAll(shaftSpeed);
    }
    return modelDescription;
}
Also used : NmeaSxn(com.opensimulationplatform.core.model.modeldescription.variablegroup.nmeasxn.NmeaSxn) LinearAcceleration(com.opensimulationplatform.core.model.modeldescription.variablegroup.linearacceleration.LinearAcceleration) GeneratorFeedback(com.opensimulationplatform.core.model.modeldescription.variablegroup.generatorfeedback.GeneratorFeedback) NmeaThs(com.opensimulationplatform.core.model.modeldescription.variablegroup.nmeaths.NmeaThs) Volume(com.opensimulationplatform.core.model.modeldescription.variablegroup.volume.Volume) NmeaGstRms(com.opensimulationplatform.core.model.modeldescription.variablegroup.nmeagstrms.NmeaGstRms) NmeaStatus(com.opensimulationplatform.core.model.modeldescription.variablegroup.nmeastatus.NmeaStatus) NmeaTime(com.opensimulationplatform.core.model.modeldescription.variablegroup.nmeatime.NmeaTime) AzimuthThrusterSetpoint(com.opensimulationplatform.core.model.modeldescription.variablegroup.azimuththrustersetpoint.AzimuthThrusterSetpoint) NmeaGstEllipse(com.opensimulationplatform.core.model.modeldescription.variablegroup.nmeagstellipse.NmeaGstEllipse) ShaftSpeed(com.opensimulationplatform.core.model.modeldescription.variablegroup.shaftspeed.ShaftSpeed) Frequency(com.opensimulationplatform.core.model.modeldescription.variablegroup.frequency.Frequency) AngularVelocity(com.opensimulationplatform.core.model.modeldescription.variablegroup.angularvelocity.AngularVelocity) LinearDisplacement(com.opensimulationplatform.core.model.modeldescription.variablegroup.lineardisplacement.LinearDisplacement) ElectromagneticQuasiPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.electromagneticquasiport.ElectromagneticQuasiPort) NmeaMwv(com.opensimulationplatform.core.model.modeldescription.variablegroup.nmeamwv.NmeaMwv) LinearVelocity(com.opensimulationplatform.core.model.modeldescription.variablegroup.linearvelocity.LinearVelocity) Force(com.opensimulationplatform.core.model.modeldescription.variablegroup.force.Force) LinearMechanicalQuasiPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.linearmechanicalquasiport.LinearMechanicalQuasiPort) NmeaGgaLatitudeLongitude(com.opensimulationplatform.core.model.modeldescription.variablegroup.nmeaggalatitudelongitude.NmeaGgaLatitudeLongitude) Charge(com.opensimulationplatform.core.model.modeldescription.variablegroup.charge.Charge) NmeaGgaFix(com.opensimulationplatform.core.model.modeldescription.variablegroup.nmeaggafix.NmeaGgaFix) AngularMechanicalQuasiPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.angularmechanicalquasiport.AngularMechanicalQuasiPort) NmeaGstPositionError(com.opensimulationplatform.core.model.modeldescription.variablegroup.nmeagstpositionerror.NmeaGstPositionError) NmeaTrueHeading(com.opensimulationplatform.core.model.modeldescription.variablegroup.nmeatrueheading.NmeaTrueHeading) NmeaGga(com.opensimulationplatform.core.model.modeldescription.variablegroup.nmeagga.NmeaGga) BladePitch(com.opensimulationplatform.core.model.modeldescription.variablegroup.bladepitch.BladePitch) AzimuthAngle(com.opensimulationplatform.core.model.modeldescription.variablegroup.azimuthangle.AzimuthAngle) NmeaWindSpeed(com.opensimulationplatform.core.model.modeldescription.variablegroup.nmeawindspeed.NmeaWindSpeed) AngularDisplacement(com.opensimulationplatform.core.model.modeldescription.variablegroup.angulardisplacement.AngularDisplacement) Current(com.opensimulationplatform.core.model.modeldescription.variablegroup.current.Current) AngularMechanicalPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.angularmechanicalport.AngularMechanicalPort) HydraulicPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.hydraulicport.HydraulicPort) VolumeFlowRate(com.opensimulationplatform.core.model.modeldescription.variablegroup.volumeflowrate.VolumeFlowRate) Torque(com.opensimulationplatform.core.model.modeldescription.variablegroup.torque.Torque) ElectromagneticPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.electromagneticport.ElectromagneticPort) HydraulicQuasiPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.hydraulicquasiport.HydraulicQuasiPort) Unit(com.opensimulationplatform.core.model.modeldescription.Unit) BatteryFeedback(com.opensimulationplatform.core.model.modeldescription.variablegroup.batteryfeedback.BatteryFeedback) AngularAcceleration(com.opensimulationplatform.core.model.modeldescription.variablegroup.angularacceleration.AngularAcceleration) LinearMechanicalPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.linearmechanicalport.LinearMechanicalPort) Pressure(com.opensimulationplatform.core.model.modeldescription.variablegroup.pressure.Pressure) FixedThrusterSetpoint(com.opensimulationplatform.core.model.modeldescription.variablegroup.fixedthrustersetpoint.FixedThrusterSetpoint) NmeaGst(com.opensimulationplatform.core.model.modeldescription.variablegroup.nmeagst.NmeaGst) BusFeedback(com.opensimulationplatform.core.model.modeldescription.variablegroup.busfeedback.BusFeedback) NmeaWindDirection(com.opensimulationplatform.core.model.modeldescription.variablegroup.nmeawinddirection.NmeaWindDirection) Generic(com.opensimulationplatform.core.model.modeldescription.variablegroup.generic.Generic) Voltage(com.opensimulationplatform.core.model.modeldescription.variablegroup.voltage.Voltage) ModelDescription(com.opensimulationplatform.core.model.modeldescription.ModelDescription) FixedThrusterFeedback(com.opensimulationplatform.core.model.modeldescription.variablegroup.fixedthrusterfeedback.FixedThrusterFeedback) ElectricPower(com.opensimulationplatform.core.model.modeldescription.variablegroup.electricpower.ElectricPower) AzimuthThrusterFeedback(com.opensimulationplatform.core.model.modeldescription.variablegroup.azimuththrusterfeedback.AzimuthThrusterFeedback)

Example 24 with Pressure

use of com.opensimulationplatform.core.model.modeldescription.variablegroup.pressure.Pressure in project osp-validator by open-simulation-platform.

the class HydraulicQuasiPortTypeConverter method convert.

@Override
public HydraulicQuasiPort convert(HydraulicQuasiPortType linearMechanicalPortType) {
    HydraulicQuasiPort linearMechanicalPort = new HydraulicQuasiPort();
    Pressure pressure = context.pressureTypeConverter.convert(linearMechanicalPortType.getPressure());
    Volume volume = context.volumeTypeConverter.convert(linearMechanicalPortType.getVolume());
    context.modelDescription.getPressures().add(pressure);
    context.modelDescription.getVolumes().add(volume);
    linearMechanicalPort.setName(linearMechanicalPortType.getName());
    linearMechanicalPort.setPressure(pressure);
    linearMechanicalPort.setVolume(volume);
    return linearMechanicalPort;
}
Also used : Volume(com.opensimulationplatform.core.model.modeldescription.variablegroup.volume.Volume) HydraulicQuasiPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.hydraulicquasiport.HydraulicQuasiPort) Pressure(com.opensimulationplatform.core.model.modeldescription.variablegroup.pressure.Pressure)

Example 25 with Pressure

use of com.opensimulationplatform.core.model.modeldescription.variablegroup.pressure.Pressure 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

Pressure (com.opensimulationplatform.core.model.modeldescription.variablegroup.pressure.Pressure)25 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 HydraulicPort (com.opensimulationplatform.core.model.modeldescription.variablegroup.hydraulicport.HydraulicPort)8 HydraulicQuasiPort (com.opensimulationplatform.core.model.modeldescription.variablegroup.hydraulicquasiport.HydraulicQuasiPort)8 Volume (com.opensimulationplatform.core.model.modeldescription.variablegroup.volume.Volume)8 VolumeFlowRate (com.opensimulationplatform.core.model.modeldescription.variablegroup.volumeflowrate.VolumeFlowRate)8 ModelDescription (com.opensimulationplatform.core.model.modeldescription.ModelDescription)7 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 Charge (com.opensimulationplatform.core.model.modeldescription.variablegroup.charge.Charge)3 Current (com.opensimulationplatform.core.model.modeldescription.variablegroup.current.Current)3 ElectromagneticPort (com.opensimulationplatform.core.model.modeldescription.variablegroup.electromagneticport.ElectromagneticPort)3 ElectromagneticQuasiPort (com.opensimulationplatform.core.model.modeldescription.variablegroup.electromagneticquasiport.ElectromagneticQuasiPort)3 Force (com.opensimulationplatform.core.model.modeldescription.variablegroup.force.Force)3 LinearDisplacement (com.opensimulationplatform.core.model.modeldescription.variablegroup.lineardisplacement.LinearDisplacement)3