Search in sources :

Example 1 with SmlDataInterface

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

the class SensorMLDecoderV20 method parseDataInterfaceType.

protected SmlDataInterface parseDataInterfaceType(DataInterfaceType xbDataInterface) throws DecodingException {
    SmlDataInterface dataInterface = new SmlDataInterface();
    // TODO implement- no funding at the moment available
    // When starting implementation: Do not forget to activate the already
    // available unit tests
    Object data = decodeXmlElement(xbDataInterface.getData());
    if (data instanceof SweDataStream) {
        dataInterface.setData((SweDataStream) data);
    }
    if (xbDataInterface.isSetInterfaceParameters()) {
        Object parameter = decodeXmlElement(xbDataInterface.getInterfaceParameters());
        if (parameter instanceof SweDataRecord) {
            dataInterface.setInputParameters((SweDataRecord) parameter);
        }
    // TODO throw exception if not instance of SweDataRecord
    }
    return dataInterface;
}
Also used : SweDataStream(org.n52.shetland.ogc.swe.SweDataStream) SweDataRecord(org.n52.shetland.ogc.swe.SweDataRecord) DescribedObject(org.n52.shetland.ogc.sensorML.v20.DescribedObject) XmlObject(org.apache.xmlbeans.XmlObject) SmlDataInterface(org.n52.shetland.ogc.sensorML.v20.SmlDataInterface)

Example 2 with SmlDataInterface

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

the class SensorMLDecoderV20Test method shouldDecodeDataInterface.

@Test
@Ignore("not yet implemented")
public void shouldDecodeDataInterface() throws DecodingException {
    DataInterfaceType xbDataInterface = DataInterfaceType.Factory.newInstance();
    SmlDataInterface parsedDataInterface = getDecoder().parseDataInterfaceType(xbDataInterface);
    assertThat(parsedDataInterface, is(notNullValue()));
}
Also used : DataInterfaceType(net.opengis.sensorml.x20.DataInterfaceType) SmlDataInterface(org.n52.shetland.ogc.sensorML.v20.SmlDataInterface) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 3 with SmlDataInterface

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

the class SensorMLDecoderV20Test method shouldDecodeDataInterfaceInterfaceParameters.

@Test
@Ignore("not yet implemented")
public void shouldDecodeDataInterfaceInterfaceParameters() throws DecodingException {
    DataInterfaceType xbDataInterface = DataInterfaceType.Factory.newInstance();
    DataRecordPropertyType xbInterfaceParameters = xbDataInterface.addNewInterfaceParameters();
    Field field = xbInterfaceParameters.addNewDataRecord().addNewField();
    field.setName("test-field-name");
    SmlDataInterface parsedDataInterface = getDecoder().parseDataInterfaceType(xbDataInterface);
    assertThat(parsedDataInterface.isSetInterfaceParameters(), is(true));
    assertThat(parsedDataInterface.getInterfaceParameters(), CoreMatchers.isA(SweDataRecord.class));
}
Also used : Field(net.opengis.swe.x20.DataRecordType.Field) DataInterfaceType(net.opengis.sensorml.x20.DataInterfaceType) SweDataRecord(org.n52.shetland.ogc.swe.SweDataRecord) DataRecordPropertyType(net.opengis.swe.x20.DataRecordPropertyType) SmlDataInterface(org.n52.shetland.ogc.sensorML.v20.SmlDataInterface) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 4 with SmlDataInterface

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

the class SensorMLDecoderV20Test method shouldDecodeDataInterfaceData.

@Test
@Ignore("not yet implemented")
public void shouldDecodeDataInterfaceData() throws DecodingException {
    DataInterfaceType xbDataInterface = DataInterfaceType.Factory.newInstance();
    xbDataInterface.addNewData();
    SmlDataInterface parsedDataInterface = getDecoder().parseDataInterfaceType(xbDataInterface);
    assertThat(parsedDataInterface.getData(), is(notNullValue()));
}
Also used : DataInterfaceType(net.opengis.sensorml.x20.DataInterfaceType) SmlDataInterface(org.n52.shetland.ogc.sensorML.v20.SmlDataInterface) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

SmlDataInterface (org.n52.shetland.ogc.sensorML.v20.SmlDataInterface)4 DataInterfaceType (net.opengis.sensorml.x20.DataInterfaceType)3 Ignore (org.junit.Ignore)3 Test (org.junit.Test)3 SweDataRecord (org.n52.shetland.ogc.swe.SweDataRecord)2 DataRecordPropertyType (net.opengis.swe.x20.DataRecordPropertyType)1 Field (net.opengis.swe.x20.DataRecordType.Field)1 XmlObject (org.apache.xmlbeans.XmlObject)1 DescribedObject (org.n52.shetland.ogc.sensorML.v20.DescribedObject)1 SweDataStream (org.n52.shetland.ogc.swe.SweDataStream)1