Search in sources :

Example 1 with CaptureObject

use of org.opensmartgridplatform.simulator.protocol.dlms.cosem.CaptureObject in project open-smart-grid-platform by OSGP.

the class CosemDateTimeFilterTest method createRangeDescriptor.

private List<DataObject> createRangeDescriptor() {
    final DataObject captureObject = new CaptureObject(8, "0.0.1.0.0.255", (byte) 2, 0).asDataObject();
    final DataObject dateTimeFrom = this.asDataObject(new DateTime(2017, 1, 1, 0, 0), 0, false);
    final DataObject dateTimeTo = this.asDataObject(new DateTime(2017, 1, 2, 0, 0), 0, false);
    return Arrays.asList(captureObject, dateTimeFrom, dateTimeTo);
}
Also used : CaptureObject(org.opensmartgridplatform.simulator.protocol.dlms.cosem.CaptureObject) DataObject(org.openmuc.jdlms.datatypes.DataObject) DateTime(org.joda.time.DateTime) CosemDateTime(org.openmuc.jdlms.datatypes.CosemDateTime)

Example 2 with CaptureObject

use of org.opensmartgridplatform.simulator.protocol.dlms.cosem.CaptureObject in project open-smart-grid-platform by OSGP.

the class E650LoadProfile1 method initCaptureObjects.

private static CaptureObjectDefinitionCollection initCaptureObjects() {
    final CaptureObjectDefinitionCollection definitions = new CaptureObjectDefinitionCollection();
    // Clock
    definitions.add(new CaptureObjectDefinition(new CaptureObject(8, "0.0.1.0.0.255", (byte) 2, 0), new CosemDateTimeProcessor()));
    // Event register, EDIS_Status_LoPr
    definitions.add(new CaptureObjectDefinition(new CaptureObject(3, "0.0.96.240.12.255", (byte) 18, 0), new UInteger32DataProcessor()));
    // Current average active power +
    definitions.add(new CaptureObjectDefinition(new CaptureObject(5, "1.1.1.4.0.255", (byte) 3, 0), new Integer32DataProcessor()));
    // Current average active power -
    definitions.add(new CaptureObjectDefinition(new CaptureObject(5, "1.1.2.4.0.255", (byte) 3, 0), new Integer32DataProcessor()));
    // Current average reactive power +
    definitions.add(new CaptureObjectDefinition(new CaptureObject(5, "1.1.3.4.0.255", (byte) 3, 0), new Integer32DataProcessor()));
    // Current average reactive power -
    definitions.add(new CaptureObjectDefinition(new CaptureObject(5, "1.1.4.4.0.255", (byte) 3, 0), new Integer32DataProcessor()));
    // Instantaneous power factor phase 1
    definitions.add(new CaptureObjectDefinition(new CaptureObject(3, "1.1.33.7.0.255", (byte) 11, 0), new Integer32DataProcessor()));
    // Instantaneous power factor phase 2
    definitions.add(new CaptureObjectDefinition(new CaptureObject(3, "1.1.53.7.0.255", (byte) 11, 0), new Integer32DataProcessor()));
    // Instantaneous power factor phase 3
    definitions.add(new CaptureObjectDefinition(new CaptureObject(3, "1.1.73.7.0.255", (byte) 11, 0), new Integer32DataProcessor()));
    return definitions;
}
Also used : CaptureObjectDefinition(org.opensmartgridplatform.simulator.protocol.dlms.cosem.processing.CaptureObjectDefinition) CaptureObject(org.opensmartgridplatform.simulator.protocol.dlms.cosem.CaptureObject) Integer32DataProcessor(org.opensmartgridplatform.simulator.protocol.dlms.cosem.processing.Integer32DataProcessor) UInteger32DataProcessor(org.opensmartgridplatform.simulator.protocol.dlms.cosem.processing.UInteger32DataProcessor) CaptureObjectDefinitionCollection(org.opensmartgridplatform.simulator.protocol.dlms.cosem.processing.CaptureObjectDefinitionCollection) UInteger32DataProcessor(org.opensmartgridplatform.simulator.protocol.dlms.cosem.processing.UInteger32DataProcessor) CosemDateTimeProcessor(org.opensmartgridplatform.simulator.protocol.dlms.cosem.processing.CosemDateTimeProcessor)

Example 3 with CaptureObject

use of org.opensmartgridplatform.simulator.protocol.dlms.cosem.CaptureObject in project open-smart-grid-platform by OSGP.

the class CaptureObjectDefinitionCollection method captureObjectsAsDataObject.

public DataObject captureObjectsAsDataObject() {
    final List<DataObject> initList = new ArrayList<>();
    final List<CaptureObject> captureObjects = this.allCaptureObjects();
    for (final CaptureObject captureObject : captureObjects) {
        initList.add(captureObject.asDataObject());
    }
    return DataObject.newArrayData(initList);
}
Also used : CaptureObject(org.opensmartgridplatform.simulator.protocol.dlms.cosem.CaptureObject) DataObject(org.openmuc.jdlms.datatypes.DataObject) ArrayList(java.util.ArrayList)

Example 4 with CaptureObject

use of org.opensmartgridplatform.simulator.protocol.dlms.cosem.CaptureObject in project open-smart-grid-platform by OSGP.

the class CaptureObjectDefinitionCollection method selectedCaptureObjects.

private List<CaptureObject> selectedCaptureObjects(final List<DataObject> rangeDescriptor) {
    final List<CaptureObject> selectedObjects = new ArrayList<>();
    final List<DataObject> selectedValues = rangeDescriptor.get(3).getValue();
    for (final DataObject selectedValue : selectedValues) {
        selectedObjects.add(CaptureObject.newCaptureObject(selectedValue));
    }
    return selectedObjects;
}
Also used : CaptureObject(org.opensmartgridplatform.simulator.protocol.dlms.cosem.CaptureObject) DataObject(org.openmuc.jdlms.datatypes.DataObject) ArrayList(java.util.ArrayList)

Example 5 with CaptureObject

use of org.opensmartgridplatform.simulator.protocol.dlms.cosem.CaptureObject in project open-smart-grid-platform by OSGP.

the class CaptureObjectDefinitionCollection method selectedIndexes.

private List<Integer> selectedIndexes(final List<DataObject> rangeDescriptor) {
    final List<Integer> selectedIndexes = new ArrayList<>();
    final List<CaptureObject> selectedValues = this.selectedCaptureObjects(rangeDescriptor);
    final boolean addAll = selectedValues.isEmpty();
    for (int i = 0; i < this.captureObjectProcessors.size(); i++) {
        final CaptureObject captureObject = this.captureObjectProcessors.get(i).getCaptureObject();
        if (addAll || selectedValues.contains(captureObject)) {
            selectedIndexes.add(i);
        }
    }
    return selectedIndexes;
}
Also used : CaptureObject(org.opensmartgridplatform.simulator.protocol.dlms.cosem.CaptureObject) ArrayList(java.util.ArrayList)

Aggregations

CaptureObject (org.opensmartgridplatform.simulator.protocol.dlms.cosem.CaptureObject)9 CaptureObjectDefinition (org.opensmartgridplatform.simulator.protocol.dlms.cosem.processing.CaptureObjectDefinition)4 CaptureObjectDefinitionCollection (org.opensmartgridplatform.simulator.protocol.dlms.cosem.processing.CaptureObjectDefinitionCollection)4 CosemDateTimeProcessor (org.opensmartgridplatform.simulator.protocol.dlms.cosem.processing.CosemDateTimeProcessor)4 UInteger32DataProcessor (org.opensmartgridplatform.simulator.protocol.dlms.cosem.processing.UInteger32DataProcessor)4 ArrayList (java.util.ArrayList)3 DataObject (org.openmuc.jdlms.datatypes.DataObject)3 Integer32DataProcessor (org.opensmartgridplatform.simulator.protocol.dlms.cosem.processing.Integer32DataProcessor)3 DateTime (org.joda.time.DateTime)1 CosemDateTime (org.openmuc.jdlms.datatypes.CosemDateTime)1 BoolDataProcessor (org.opensmartgridplatform.simulator.protocol.dlms.cosem.processing.BoolDataProcessor)1 Integer64DataProcessor (org.opensmartgridplatform.simulator.protocol.dlms.cosem.processing.Integer64DataProcessor)1 OctetStringDataProcessor (org.opensmartgridplatform.simulator.protocol.dlms.cosem.processing.OctetStringDataProcessor)1 UInteger8DataProcessor (org.opensmartgridplatform.simulator.protocol.dlms.cosem.processing.UInteger8DataProcessor)1