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);
}
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;
}
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);
}
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;
}
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;
}
Aggregations