use of com.opensimulationplatform.modeldescription.xml.model.VariableType in project osp-validator by open-simulation-platform.
the class LinearVelocityTypeConverter method convert.
@Override
public LinearVelocity convert(LinearVelocityType linearVelocityType) {
LinearVelocity linearVelocity = new LinearVelocity();
linearVelocity.setName(linearVelocityType.getName());
List<VariableType> variableTypes = linearVelocityType.getVariable();
List<Variable> variables = variableTypes.stream().map(context.variableTypeConverter::convert).collect(Collectors.toList());
linearVelocity.setVariables(variables);
return linearVelocity;
}
use of com.opensimulationplatform.modeldescription.xml.model.VariableType in project osp-validator by open-simulation-platform.
the class NmeaGgaFixTypeConverter method convert.
@Override
public NmeaGgaFix convert(NmeaGgaFixType nmeaGgaFixType) {
NmeaGgaFix nmeaGgaFix = new NmeaGgaFix();
nmeaGgaFix.setName(nmeaGgaFixType.getName());
List<VariableType> variableTypes = nmeaGgaFixType.getVariable();
List<Variable> variables = variableTypes.stream().map(context.variableTypeConverter::convert).collect(Collectors.toList());
nmeaGgaFix.setVariables(variables);
return nmeaGgaFix;
}
use of com.opensimulationplatform.modeldescription.xml.model.VariableType in project osp-validator by open-simulation-platform.
the class NmeaGgaLatitudeLongitudeTypeConverter method convert.
@Override
public NmeaGgaLatitudeLongitude convert(NmeaGgaLatitudeLongitudeType nmeaGgaLatitudeLongitudeType) {
NmeaGgaLatitudeLongitude nmeaGgaLatitudeLongitude = new NmeaGgaLatitudeLongitude();
nmeaGgaLatitudeLongitude.setName(nmeaGgaLatitudeLongitudeType.getName());
List<VariableType> variableTypes = nmeaGgaLatitudeLongitudeType.getVariable();
List<Variable> variables = variableTypes.stream().map(context.variableTypeConverter::convert).collect(Collectors.toList());
nmeaGgaLatitudeLongitude.setVariables(variables);
return nmeaGgaLatitudeLongitude;
}
use of com.opensimulationplatform.modeldescription.xml.model.VariableType in project osp-validator by open-simulation-platform.
the class NmeaGstEllipseTypeConverter method convert.
@Override
public NmeaGstEllipse convert(NmeaGstEllipseType nmeaGstEllipseType) {
NmeaGstEllipse nmeaGstEllipse = new NmeaGstEllipse();
nmeaGstEllipse.setName(nmeaGstEllipseType.getName());
List<VariableType> variableTypes = nmeaGstEllipseType.getVariable();
List<Variable> variables = variableTypes.stream().map(context.variableTypeConverter::convert).collect(Collectors.toList());
nmeaGstEllipse.setVariables(variables);
return nmeaGstEllipse;
}
use of com.opensimulationplatform.modeldescription.xml.model.VariableType in project osp-validator by open-simulation-platform.
the class VariableTypeConverterTest method canConvert.
@Test
public void canConvert() {
ConverterContext converterContext = new ConverterContext();
Variable v = new Variable();
v.setName("variableName");
converterContext.modelDescription.getVariables().add(v);
Unit u = new Unit();
u.setName("unitName");
converterContext.modelDescription.getUnits().add(u);
VariableType variableType = new VariableType();
variableType.setRef(v.getName().get());
variableType.setUnit(u.getName().get());
VariableTypeConverter variableTypeConverter = new VariableTypeConverter(converterContext);
Variable variable = variableTypeConverter.convert(variableType);
assertEquals(v, variable);
assertEquals(u, variable.getUnit());
}
Aggregations