Search in sources :

Example 1 with AggregateProcess

use of org.n52.shetland.ogc.sensorML.v20.AggregateProcess in project arctic-sea by 52North.

the class SensorMLDecoderV20 method parseAggregateProcess.

private DescribedObject parseAggregateProcess(AggregateProcessType describedObject) throws DecodingException {
    AggregateProcess ap = new AggregateProcess();
    parseAbstractProcess(describedObject, ap);
    parseDescribedObject(describedObject, ap);
    if (describedObject.isSetComponents()) {
        ap.addComponents(parseComponents(describedObject.getComponents()));
        List<Integer> compsToRemove = checkComponentsForRemoval(describedObject.getComponents().getComponentList());
        compsToRemove.forEach(describedObject.getComponents().getComponentList()::removeComponent);
        if (removeEmptyComponents(describedObject.getComponents())) {
            describedObject.unsetComponents();
        }
    }
    if (describedObject.isSetConnections()) {
        ap.setConnections(parseConnections(describedObject.getConnections()));
    }
    return ap;
}
Also used : AggregateProcess(org.n52.shetland.ogc.sensorML.v20.AggregateProcess)

Example 2 with AggregateProcess

use of org.n52.shetland.ogc.sensorML.v20.AggregateProcess in project arctic-sea by 52North.

the class SensorMLEncoderv20 method addAggregateProcessValues.

private void addAggregateProcessValues(AggregateProcessType apt, AggregateProcess abstractProcess) throws EncodingException {
    addAbstractProcessValues(apt, abstractProcess);
    addDescribedObjectValues(apt, abstractProcess);
    // set components
    if (abstractProcess.isSetComponents()) {
        List<SmlComponent> smlComponents = checkForComponents(abstractProcess);
        if (!smlComponents.isEmpty()) {
            ComponentListPropertyType clpt = createComponents(smlComponents);
            if (clpt != null && clpt.getComponentList() != null && clpt.getComponentList().sizeOfComponentArray() > 0) {
                apt.setComponents(clpt);
            }
        }
    }
// set connections
}
Also used : ComponentListPropertyType(net.opengis.sensorml.x20.ComponentListPropertyType) SmlComponent(org.n52.shetland.ogc.sensorML.elements.SmlComponent)

Aggregations

ComponentListPropertyType (net.opengis.sensorml.x20.ComponentListPropertyType)1 SmlComponent (org.n52.shetland.ogc.sensorML.elements.SmlComponent)1 AggregateProcess (org.n52.shetland.ogc.sensorML.v20.AggregateProcess)1