Search in sources :

Example 6 with Volume

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

the class VE_Volume_3_Test method valid.

@Test
public void valid() {
    Volume volume = new Volume();
    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());
    volume.setVariables(Arrays.asList(v1, v2));
    builder.build(volume);
    builder.complete();
    List<ValidationDiagnostic<Volume>> diagnostics = validationError.validate();
    assertTrue(diagnostics.isEmpty());
}
Also used : Variable(com.opensimulationplatform.core.model.modeldescription.Variable) Volume(com.opensimulationplatform.core.model.modeldescription.variablegroup.volume.Volume) ValidationDiagnostic(com.opensimulationplatform.core.validation.ValidationDiagnostic) Unit(com.opensimulationplatform.core.model.modeldescription.Unit) Test(org.junit.Test)

Example 7 with Volume

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

the class GenericTypeConverter method convert.

@Override
public Generic convert(GenericType genericType) {
    Generic generic = new Generic();
    generic.setName(genericType.getName());
    List<GenericType> genericTypes = genericType.getGeneric();
    List<Generic> generics = context.genericTypeConverter.convert(genericTypes);
    generic.getGenerics().addAll(generics);
    context.modelDescription.getGenerics().addAll(generics);
    List<VariableType> variable = genericType.getVariable();
    List<Variable> variables = context.variableTypeConverter.convert(variable);
    generic.setVariables(variables);
    List<AngularDisplacementType> angularDisplacement = genericType.getAngularDisplacement();
    List<AngularDisplacement> angularDisplacements = context.angularDisplacementTypeConverter.convert(angularDisplacement);
    generic.getAngularDisplacements().addAll(angularDisplacements);
    context.modelDescription.getAngularDisplacements().addAll(angularDisplacements);
    List<ChargeType> charge = genericType.getCharge();
    List<Charge> charges = context.chargeTypeConverter.convert(charge);
    generic.getCharges().addAll(charges);
    context.modelDescription.getCharges().addAll(charges);
    List<LinearDisplacementType> linearDisplacement = genericType.getLinearDisplacement();
    List<LinearDisplacement> linearDisplacements = context.linearDisplacementTypeConverter.convert(linearDisplacement);
    generic.getLinearDisplacements().addAll(linearDisplacements);
    context.modelDescription.getLinearDisplacements().addAll(linearDisplacements);
    List<VolumeType> volume = genericType.getVolume();
    List<Volume> volumes = context.volumeTypeConverter.convert(volume);
    generic.getVolumes().addAll(volumes);
    context.modelDescription.getVolumes().addAll(volumes);
    List<ForceType> force = genericType.getForce();
    List<Force> forces = context.forceTypeConverter.convert(force);
    generic.getForces().addAll(forces);
    context.modelDescription.getForces().addAll(forces);
    List<PressureType> pressure = genericType.getPressure();
    List<Pressure> pressures = context.pressureTypeConverter.convert(pressure);
    generic.getPressures().addAll(pressures);
    context.modelDescription.getPressures().addAll(pressures);
    List<TorqueType> torque = genericType.getTorque();
    List<Torque> torques = context.torqueTypeConverter.convert(torque);
    generic.getTorques().addAll(torques);
    context.modelDescription.getTorques().addAll(torques);
    List<VoltageType> voltage = genericType.getVoltage();
    List<Voltage> voltages = context.voltageTypeConverter.convert(voltage);
    generic.getVoltages().addAll(voltages);
    context.modelDescription.getVoltages().addAll(voltages);
    List<AngularVelocityType> angularVelocity = genericType.getAngularVelocity();
    List<AngularVelocity> angularVelocities = context.angularVelocityTypeConverter.convert(angularVelocity);
    generic.getAngularVelocities().addAll(angularVelocities);
    context.modelDescription.getAngularVelocities().addAll(angularVelocities);
    List<CurrentType> current = genericType.getCurrent();
    List<Current> currents = context.currentTypeConverter.convert(current);
    generic.getCurrents().addAll(currents);
    context.modelDescription.getCurrents().addAll(currents);
    List<LinearVelocityType> linearVelocity = genericType.getLinearVelocity();
    List<LinearVelocity> linearVelocities = context.linearVelocityTypeConverter.convert(linearVelocity);
    generic.getLinearVelocities().addAll(linearVelocities);
    context.modelDescription.getLinearVelocities().addAll(linearVelocities);
    List<VolumeFlowRateType> volumeFlowRate = genericType.getVolumeFlowRate();
    List<VolumeFlowRate> volumeFlowRates = context.volumeFlowRateTypeConverter.convert(volumeFlowRate);
    generic.getVolumeFlowRates().addAll(volumeFlowRates);
    context.modelDescription.getVolumeFlowRates().addAll(volumeFlowRates);
    List<AngularMechanicalPortType> angularMechanicalPort = genericType.getAngularMechanicalPort();
    List<AngularMechanicalPort> angularMechanicalPorts = context.angularMechanicalPortTypeConverter.convert(angularMechanicalPort);
    generic.getAngularMechanicalPorts().addAll(angularMechanicalPorts);
    context.modelDescription.getAngularMechanicalPorts().addAll(angularMechanicalPorts);
    List<ElectromagneticPortType> electromagneticPort = genericType.getElectromagneticPort();
    List<ElectromagneticPort> electromagneticPorts = context.electromagneticPortTypeConverter.convert(electromagneticPort);
    generic.getElectromagneticPorts().addAll(electromagneticPorts);
    context.modelDescription.getElectromagneticPorts().addAll(electromagneticPorts);
    List<HydraulicPortType> hydraulicPort = genericType.getHydraulicPort();
    List<HydraulicPort> hydraulicPorts = context.hydraulicPortTypeConverter.convert(hydraulicPort);
    generic.getHydraulicPorts().addAll(hydraulicPorts);
    context.modelDescription.getHydraulicPorts().addAll(hydraulicPorts);
    List<LinearMechanicalPortType> linearMechanicalPort = genericType.getLinearMechanicalPort();
    List<LinearMechanicalPort> linearMechanicalPorts = context.linearMechanicalPortTypeConverter.convert(linearMechanicalPort);
    generic.getLinearMechanicalPorts().addAll(linearMechanicalPorts);
    context.modelDescription.getLinearMechanicalPorts().addAll(linearMechanicalPorts);
    List<AngularMechanicalQuasiPortType> angularMechanicalQuasiPort = genericType.getAngularMechanicalQuasiPort();
    List<AngularMechanicalQuasiPort> angularMechanicalQuasiPorts = context.angularMechanicalQuasiPortTypeConverter.convert(angularMechanicalQuasiPort);
    generic.getAngularMechanicalQuasiPorts().addAll(angularMechanicalQuasiPorts);
    context.modelDescription.getAngularMechanicalQuasiPorts().addAll(angularMechanicalQuasiPorts);
    List<ElectromagneticQuasiPortType> electromagneticQuasiPort = genericType.getElectromagneticQuasiPort();
    List<ElectromagneticQuasiPort> electromagneticQuasiPorts = context.electromagneticQuasiPortTypeConverter.convert(electromagneticQuasiPort);
    generic.getElectromagneticQuasiPorts().addAll(electromagneticQuasiPorts);
    context.modelDescription.getElectromagneticQuasiPorts().addAll(electromagneticQuasiPorts);
    List<HydraulicQuasiPortType> hydraulicQuasiPort = genericType.getHydraulicQuasiPort();
    List<HydraulicQuasiPort> hydraulicQuasiPorts = context.hydraulicQuasiPortTypeConverter.convert(hydraulicQuasiPort);
    generic.getHydraulicQuasiPorts().addAll(hydraulicQuasiPorts);
    context.modelDescription.getHydraulicQuasiPorts().addAll(hydraulicQuasiPorts);
    List<LinearMechanicalQuasiPortType> linearMechanicalQuasiPort = genericType.getLinearMechanicalQuasiPort();
    List<LinearMechanicalQuasiPort> linearMechanicalQuasiPorts = context.linearMechanicalQuasiPortTypeConverter.convert(linearMechanicalQuasiPort);
    generic.getLinearMechanicalQuasiPorts().addAll(linearMechanicalQuasiPorts);
    context.modelDescription.getLinearMechanicalQuasiPorts().addAll(linearMechanicalQuasiPorts);
    List<NmeaGgaFixType> nmeaGgaFixTypes = genericType.getNmeaGgaFix();
    List<NmeaGgaFix> nmeaGgaFixes = context.nmeaGgaFixTypeConverter.convert(nmeaGgaFixTypes);
    generic.getNmeaGgaFixs().addAll(nmeaGgaFixes);
    context.modelDescription.getNmeaGgaFixs().addAll(nmeaGgaFixes);
    List<NmeaGgaLatitudeLongitudeType> nmeaGgaLatitudeLongitudeTypes = genericType.getNmeaGgaLatitudeLongitude();
    List<NmeaGgaLatitudeLongitude> nmeaGgaLatitudeLongitude = context.nmeaGgaLatitudeLongitudeTypeConverter.convert(nmeaGgaLatitudeLongitudeTypes);
    generic.getNmeaGgaLatitudeLongitudes().addAll(nmeaGgaLatitudeLongitude);
    context.modelDescription.getNmeaGgaLatitudeLongitudes().addAll(nmeaGgaLatitudeLongitude);
    List<NmeaGgaType> nmeaGgaTypes = genericType.getNmeaGga();
    List<NmeaGga> nmeaGga = context.nmeaGgaTypeConverter.convert(nmeaGgaTypes);
    generic.getNmeaGgas().addAll(nmeaGga);
    context.modelDescription.getNmeaGgas().addAll(nmeaGga);
    List<NmeaGstEllipseType> nmeaGstEllipseTypes = genericType.getNmeaGstEllipse();
    List<NmeaGstEllipse> nmeaGstEllipse = context.nmeaGstEllipseTypeConverter.convert(nmeaGstEllipseTypes);
    generic.getNmeaGstEllipses().addAll(nmeaGstEllipse);
    context.modelDescription.getNmeaGstEllipses().addAll(nmeaGstEllipse);
    List<NmeaGstPositionErrorType> nmeaGstPositionErrorTypes = genericType.getNmeaGstPositionError();
    List<NmeaGstPositionError> nmeaGstPositionError = context.nmeaGstPositionErrorTypeConverter.convert(nmeaGstPositionErrorTypes);
    generic.getNmeaGstPositionErrors().addAll(nmeaGstPositionError);
    context.modelDescription.getNmeaGstPositionErrors().addAll(nmeaGstPositionError);
    List<NmeaGstRmsType> nmeaGstRmsTypes = genericType.getNmeaGstRms();
    List<NmeaGstRms> nmeaGstRms = context.nmeaGstRmsTypeConverter.convert(nmeaGstRmsTypes);
    generic.getNmeaGstRmss().addAll(nmeaGstRms);
    context.modelDescription.getNmeaGstRmss().addAll(nmeaGstRms);
    List<NmeaGstType> nmeaGstTypes = genericType.getNmeaGst();
    List<NmeaGst> nmeaGst = context.nmeaGstTypeConverter.convert(nmeaGstTypes);
    generic.getNmeaGsts().addAll(nmeaGst);
    context.modelDescription.getNmeaGsts().addAll(nmeaGst);
    List<NmeaMwvType> nmeaMwvTypes = genericType.getNmeaMwv();
    List<NmeaMwv> nmeaMwv = context.nmeaMwvTypeConverter.convert(nmeaMwvTypes);
    generic.getNmeaMwvs().addAll(nmeaMwv);
    context.modelDescription.getNmeaMwvs().addAll(nmeaMwv);
    List<NmeaStatusType> nmeaStatusTypes = genericType.getNmeaStatus();
    List<NmeaStatus> nmeaStatus = context.nmeaStatusTypeConverter.convert(nmeaStatusTypes);
    generic.getNmeaStatuses().addAll(nmeaStatus);
    context.modelDescription.getNmeaStatuses().addAll(nmeaStatus);
    List<NmeaSxnType> nmeaSxnTypes = genericType.getNmeaSxn();
    List<NmeaSxn> nmeaSxn = context.nmeaSxnTypeConverter.convert(nmeaSxnTypes);
    generic.getNmeaSxns().addAll(nmeaSxn);
    context.modelDescription.getNmeaSxns().addAll(nmeaSxn);
    List<NmeaThsType> nmeaThsTypes = genericType.getNmeaThs();
    List<NmeaThs> nmeaThs = context.nmeaThsTypeConverter.convert(nmeaThsTypes);
    generic.getNmeaThss().addAll(nmeaThs);
    context.modelDescription.getNmeaThss().addAll(nmeaThs);
    List<NmeaTimeType> nmeaTimeTypes = genericType.getNmeaTime();
    List<NmeaTime> nmeaTime = context.nmeaTimeTypeConverter.convert(nmeaTimeTypes);
    generic.getNmeaTimes().addAll(nmeaTime);
    context.modelDescription.getNmeaTimes().addAll(nmeaTime);
    List<NmeaTrueHeadingType> nmeaTrueHeadingTypes = genericType.getNmeaTrueHeading();
    List<NmeaTrueHeading> nmeaTrueHeading = context.nmeaTrueHeadingTypeConverter.convert(nmeaTrueHeadingTypes);
    generic.getNmeaTrueHeadings().addAll(nmeaTrueHeading);
    context.modelDescription.getNmeaTrueHeadings().addAll(nmeaTrueHeading);
    List<NmeaWindDirectionType> nmeaWindDirectionTypes = genericType.getNmeaWindDirection();
    List<NmeaWindDirection> nmeaWindDirection = context.nmeaWindDirectionTypeConverter.convert(nmeaWindDirectionTypes);
    generic.getNmeaWindDirections().addAll(nmeaWindDirection);
    context.modelDescription.getNmeaWindDirections().addAll(nmeaWindDirection);
    List<NmeaWindSpeedType> nmeaWindSpeedTypes = genericType.getNmeaWindSpeed();
    List<NmeaWindSpeed> nmeaWindSpeed = context.nmeaWindSpeedTypeConverter.convert(nmeaWindSpeedTypes);
    generic.getNmeaWindSpeeds().addAll(nmeaWindSpeed);
    context.modelDescription.getNmeaWindSpeeds().addAll(nmeaWindSpeed);
    List<AngularAccelerationType> angularAccelerationTypes = genericType.getAngularAcceleration();
    List<AngularAcceleration> angularAcceleration = context.angularAccelerationTypeConverter.convert(angularAccelerationTypes);
    generic.getAngularAccelerations().addAll(angularAcceleration);
    context.modelDescription.getAngularAccelerations().addAll(angularAcceleration);
    List<AzimuthAngleType> azimuthAngleTypes = genericType.getAzimuthAngle();
    List<AzimuthAngle> azimuthAngle = context.azimuthAngleTypeConverter.convert(azimuthAngleTypes);
    generic.getAzimuthAngles().addAll(azimuthAngle);
    context.modelDescription.getAzimuthAngles().addAll(azimuthAngle);
    List<AzimuthThrusterFeedbackType> azimuthThrusterFeedbackTypes = genericType.getAzimuthThrusterFeedback();
    List<AzimuthThrusterFeedback> azimuthThrusterFeedback = context.azimuthThrusterFeedbackTypeConverter.convert(azimuthThrusterFeedbackTypes);
    generic.getAzimuthThrusterFeedbacks().addAll(azimuthThrusterFeedback);
    context.modelDescription.getAzimuthThrusterFeedbacks().addAll(azimuthThrusterFeedback);
    List<AzimuthThrusterSetpointType> azimuthThrusterSetpointTypes = genericType.getAzimuthThrusterSetpoint();
    List<AzimuthThrusterSetpoint> azimuthThrusterSetpoint = context.azimuthThrusterSetpointTypeConverter.convert(azimuthThrusterSetpointTypes);
    generic.getAzimuthThrusterSetpoints().addAll(azimuthThrusterSetpoint);
    context.modelDescription.getAzimuthThrusterSetpoints().addAll(azimuthThrusterSetpoint);
    List<BatteryFeedbackType> batteryFeedbackTypes = genericType.getBatteryFeedback();
    List<BatteryFeedback> batteryFeedback = context.batteryFeedbackTypeConverter.convert(batteryFeedbackTypes);
    generic.getBatteryFeedbacks().addAll(batteryFeedback);
    context.modelDescription.getBatteryFeedbacks().addAll(batteryFeedback);
    List<BladePitchType> bladePitchTypes = genericType.getBladePitch();
    List<BladePitch> bladePitch = context.bladePitchTypeConverter.convert(bladePitchTypes);
    generic.getBladePitches().addAll(bladePitch);
    context.modelDescription.getBladePitches().addAll(bladePitch);
    List<BusFeedbackType> busFeedbackTypes = genericType.getBusFeedback();
    List<BusFeedback> busFeedback = context.busFeedbackTypeConverter.convert(busFeedbackTypes);
    generic.getBusFeedbacks().addAll(busFeedback);
    context.modelDescription.getBusFeedbacks().addAll(busFeedback);
    List<ElectricPowerType> electricPowerTypes = genericType.getElectricPower();
    List<ElectricPower> electricPower = context.electricPowerTypeConverter.convert(electricPowerTypes);
    generic.getElectricPowers().addAll(electricPower);
    context.modelDescription.getElectricPowers().addAll(electricPower);
    List<FixedThrusterFeedbackType> fixedThrusterFeedbackTypes = genericType.getFixedThrusterFeedback();
    List<FixedThrusterFeedback> fixedThrusterFeedback = context.fixedThrusterFeedbackTypeConverter.convert(fixedThrusterFeedbackTypes);
    generic.getFixedThrusterFeedbacks().addAll(fixedThrusterFeedback);
    context.modelDescription.getFixedThrusterFeedbacks().addAll(fixedThrusterFeedback);
    List<FixedThrusterSetpointType> fixedThrusterSetpointTypes = genericType.getFixedThrusterSetpoint();
    List<FixedThrusterSetpoint> fixedThrusterSetpoint = context.fixedThrusterSetpointTypeConverter.convert(fixedThrusterSetpointTypes);
    generic.getFixedThrusterSetpoints().addAll(fixedThrusterSetpoint);
    context.modelDescription.getFixedThrusterSetpoints().addAll(fixedThrusterSetpoint);
    List<FrequencyType> frequencyTypes = genericType.getFrequency();
    List<Frequency> frequency = context.frequencyTypeConverter.convert(frequencyTypes);
    generic.getFrequencies().addAll(frequency);
    context.modelDescription.getFrequencies().addAll(frequency);
    List<GeneratorFeedbackType> generatorFeedbackTypes = genericType.getGeneratorFeedback();
    List<GeneratorFeedback> generatorFeedback = context.generatorFeedbackTypeConverter.convert(generatorFeedbackTypes);
    generic.getGeneratorFeedbacks().addAll(generatorFeedback);
    context.modelDescription.getGeneratorFeedbacks().addAll(generatorFeedback);
    List<LinearAccelerationType> linearAccelerationTypes = genericType.getLinearAcceleration();
    List<LinearAcceleration> linearAcceleration = context.linearAccelerationTypeConverter.convert(linearAccelerationTypes);
    generic.getLinearAccelerations().addAll(linearAcceleration);
    context.modelDescription.getLinearAccelerations().addAll(linearAcceleration);
    List<ShaftSpeedType> shaftSpeedTypes = genericType.getShaftSpeed();
    List<ShaftSpeed> shaftSpeed = context.shaftSpeedTypeConverter.convert(shaftSpeedTypes);
    generic.getShaftSpeeds().addAll(shaftSpeed);
    context.modelDescription.getShaftSpeeds().addAll(shaftSpeed);
    return generic;
}
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) 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) Variable(com.opensimulationplatform.core.model.modeldescription.Variable) Generic(com.opensimulationplatform.core.model.modeldescription.variablegroup.generic.Generic) Voltage(com.opensimulationplatform.core.model.modeldescription.variablegroup.voltage.Voltage) 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 8 with Volume

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

the class VE_Volume_1 method getInvalidObjects.

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

Example 9 with Volume

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

the class VE_Volume_2 method getInvalidObjects.

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

Example 10 with Volume

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

the class HydraulicQuasiPortValidatorTest method valid.

@Test
public void valid() {
    ModelDescription modelDescription = new ModelDescription();
    Variable v1 = new Variable();
    v1.setCausality(Variable.Causality.OUTPUT);
    Pressure pressure = new Pressure();
    pressure.setVariables(Arrays.asList(v1));
    Variable v2 = new Variable();
    v2.setCausality(Variable.Causality.INPUT);
    Volume volume = new Volume();
    volume.setVariables(Arrays.asList(v2));
    HydraulicQuasiPort hydraulicQuasiPort = new HydraulicQuasiPort();
    hydraulicQuasiPort.setPressure(pressure);
    hydraulicQuasiPort.setVolume(volume);
    modelDescription.getHydraulicQuasiPorts().add(hydraulicQuasiPort);
    HydraulicQuasiPortValidator hydraulicQuasiPortValidator = new HydraulicQuasiPortValidator();
    List<ValidationDiagnostic<HydraulicQuasiPort>> diagnostics = hydraulicQuasiPortValidator.validate(modelDescription);
    assertTrue(diagnostics.isEmpty());
}
Also used : Variable(com.opensimulationplatform.core.model.modeldescription.Variable) Volume(com.opensimulationplatform.core.model.modeldescription.variablegroup.volume.Volume) ValidationDiagnostic(com.opensimulationplatform.core.validation.ValidationDiagnostic) ModelDescription(com.opensimulationplatform.core.model.modeldescription.ModelDescription) HydraulicQuasiPort(com.opensimulationplatform.core.model.modeldescription.variablegroup.hydraulicquasiport.HydraulicQuasiPort) Pressure(com.opensimulationplatform.core.model.modeldescription.variablegroup.pressure.Pressure) Test(org.junit.Test)

Aggregations

Volume (com.opensimulationplatform.core.model.modeldescription.variablegroup.volume.Volume)20 Variable (com.opensimulationplatform.core.model.modeldescription.Variable)14 ValidationDiagnostic (com.opensimulationplatform.core.validation.ValidationDiagnostic)12 Test (org.junit.Test)12 Unit (com.opensimulationplatform.core.model.modeldescription.Unit)11 HydraulicQuasiPort (com.opensimulationplatform.core.model.modeldescription.variablegroup.hydraulicquasiport.HydraulicQuasiPort)8 Pressure (com.opensimulationplatform.core.model.modeldescription.variablegroup.pressure.Pressure)8 ModelDescription (com.opensimulationplatform.core.model.modeldescription.ModelDescription)5 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 HydraulicPort (com.opensimulationplatform.core.model.modeldescription.variablegroup.hydraulicport.HydraulicPort)3 LinearDisplacement (com.opensimulationplatform.core.model.modeldescription.variablegroup.lineardisplacement.LinearDisplacement)3 LinearMechanicalPort (com.opensimulationplatform.core.model.modeldescription.variablegroup.linearmechanicalport.LinearMechanicalPort)3