use of org.n52.shetland.ogc.sensorML.ProcessModel in project arctic-sea by 52North.
the class SensorMLEncoderv101 method createSensorMLDescription.
protected SensorMLDocument createSensorMLDescription(final SensorML smlSensorDesc) throws EncodingException {
final SensorMLDocument sensorMLDoc = SensorMLDocument.Factory.newInstance(getXmlOptions());
final net.opengis.sensorML.x101.SensorMLDocument.SensorML xbSensorML = sensorMLDoc.addNewSensorML();
xbSensorML.setVersion(SensorMLConstants.VERSION_V101);
if (smlSensorDesc.isSetMembers()) {
for (final AbstractProcess sml : smlSensorDesc.getMembers()) {
if (sml instanceof System) {
final SystemType xbSystem = (SystemType) xbSensorML.addNewMember().addNewProcess().substitute(new QName(SensorMLConstants.NS_SML, SensorMLConstants.EN_SYSTEM), SystemType.type);
final System smlSystem = (System) sml;
addAbstractProcessValues(xbSystem, smlSystem);
addSystemValues(xbSystem, smlSystem);
} else if (sml instanceof ProcessModel) {
final ProcessModelType xbProcessModel = (ProcessModelType) xbSensorML.addNewMember().addNewProcess().substitute(new QName(SensorMLConstants.NS_SML, SensorMLConstants.EN_PROCESS_MODEL), ProcessModelType.type);
final ProcessModel smlProcessModel = (ProcessModel) sml;
addAbstractProcessValues(xbProcessModel, smlProcessModel);
addProcessModelValues(xbProcessModel, smlProcessModel);
} else if (sml instanceof org.n52.shetland.ogc.sensorML.Component) {
final ComponentType xbCompontent = (ComponentType) xbSensorML.addNewMember().addNewProcess().substitute(new QName(SensorMLConstants.NS_SML, SensorMLConstants.EN_COMPONENT), ComponentType.type);
final org.n52.shetland.ogc.sensorML.Component smlComponent = (org.n52.shetland.ogc.sensorML.Component) sml;
addAbstractProcessValues(xbCompontent, smlComponent);
addComponentValues(xbCompontent, smlComponent);
}
}
}
return sensorMLDoc;
}
use of org.n52.shetland.ogc.sensorML.ProcessModel in project arctic-sea by 52North.
the class SensorMLDecoderV101 method parseProcessModel.
private ProcessModel parseProcessModel(final ProcessModelType xbProcessModel) throws DecodingException {
final ProcessModel processModel = new ProcessModel();
parseAbstractProcess(xbProcessModel, processModel);
parseAbstractPureProcess(xbProcessModel, processModel);
if (xbProcessModel.getMethod() != null) {
processModel.setMethod(parseProcessMethod(xbProcessModel.getMethod()));
}
processModel.setXml(addSensorMLWrapperForXmlDescription(xbProcessModel));
return processModel;
}
use of org.n52.shetland.ogc.sensorML.ProcessModel in project arctic-sea by 52North.
the class SensorMLEncoderv101 method createProcessDescription.
private XmlObject createProcessDescription(final AbstractProcess sensorDesc) throws EncodingException {
// TODO Review: System -> return doc; ProcessModel -> return type
if (sensorDesc instanceof System) {
System system = (System) sensorDesc;
SystemDocument xbSystemDoc = SystemDocument.Factory.newInstance(getXmlOptions());
SystemType xbSystem = xbSystemDoc.addNewSystem();
addAbstractProcessValues(xbSystem, system);
addSystemValues(xbSystem, system);
return xbSystem;
} else if (sensorDesc instanceof ProcessModel) {
// TODO: set values
ProcessModel processModel = (ProcessModel) sensorDesc;
ProcessModelDocument xbProcessModelDoc = ProcessModelDocument.Factory.newInstance(getXmlOptions());
ProcessModelType xbProcessModel = xbProcessModelDoc.addNewProcessModel();
addAbstractProcessValues(xbProcessModel, processModel);
addProcessModelValues(xbProcessModel, processModel);
return xbProcessModel;
} else if (sensorDesc instanceof org.n52.shetland.ogc.sensorML.Component) {
org.n52.shetland.ogc.sensorML.Component component = (org.n52.shetland.ogc.sensorML.Component) sensorDesc;
ComponentDocument cd = ComponentDocument.Factory.newInstance(getXmlOptions());
ComponentType ct = cd.addNewComponent();
addAbstractProcessValues(ct, component);
return ct;
} else {
throw unsupportedDescriptionType();
}
}
Aggregations