use of org.openmuc.jdlms.SelectiveAccessDescription in project open-smart-grid-platform by OSGP.
the class DlmsObjectConfigService method getAccessDescription.
private SelectiveAccessDescription getAccessDescription(final AddressRequest addressRequest, final List<DlmsCaptureObject> selectedObjects) {
final DlmsObject object = addressRequest.getDlmsObject();
final DateTime from = addressRequest.getFrom();
final DateTime to = addressRequest.getTo();
if (!(object instanceof DlmsProfile) || from == null || to == null) {
return null;
} else {
final int accessSelector = 1;
final DataObject selectedValues = this.getSelectedValues(addressRequest, selectedObjects);
final DataObject accessParameter = this.dlmsHelper.getAccessSelectionTimeRangeParameter(from, to, selectedValues);
return new SelectiveAccessDescription(accessSelector, accessParameter);
}
}
use of org.openmuc.jdlms.SelectiveAccessDescription in project open-smart-grid-platform by OSGP.
the class DlmsObjectConfigService method getAttributeAddressForProfile.
private AttributeAddressForProfile getAttributeAddressForProfile(final AddressRequest addressRequest) {
final List<DlmsCaptureObject> selectedObjects = new ArrayList<>();
final SelectiveAccessDescription access = this.getAccessDescription(addressRequest, selectedObjects);
final DlmsObject dlmsObject = addressRequest.getDlmsObject();
final ObisCode obisCode = this.replaceChannel(dlmsObject.getObisCodeAsString(), addressRequest.getChannel());
return new AttributeAddressForProfile(new AttributeAddress(dlmsObject.getClassId(), obisCode, dlmsObject.getDefaultAttributeId(), access), selectedObjects);
}
use of org.openmuc.jdlms.SelectiveAccessDescription in project open-smart-grid-platform by OSGP.
the class GetPeriodicMeterReadsCommandExecutorIntegrationTest method createSelectiveAccessDescriptionDsmr4Daily.
private SelectiveAccessDescription createSelectiveAccessDescriptionDsmr4Daily(final DataObject from, final DataObject to) {
final DataObject selectedValues = DataObject.newArrayData(Arrays.asList(this.CLOCK, this.STATUS, this.ACTIVE_ENERGY_IMPORT_RATE_1, this.ACTIVE_ENERGY_IMPORT_RATE_2, this.ACTIVE_ENERGY_EXPORT_RATE_1, this.ACTIVE_ENERGY_EXPORT_RATE_2));
final DataObject expectedAccessParam = DataObject.newStructureData(Arrays.asList(this.CLOCK, from, to, selectedValues));
return new SelectiveAccessDescription(1, expectedAccessParam);
}
use of org.openmuc.jdlms.SelectiveAccessDescription in project open-smart-grid-platform by OSGP.
the class GetPeriodicMeterReadsGasCommandExecutorIntegrationTest method createSelectiveAccessDescriptionDsmr4Monthly.
private SelectiveAccessDescription createSelectiveAccessDescriptionDsmr4Monthly(final DataObject from, final DataObject to) {
final DataObject selectedValues = DataObject.newArrayData(Arrays.asList(this.CLOCK, this.GAS_VALUE_DSMR4, this.GAS_CAPTURE_TIME_DSMR4));
final DataObject expectedAccessParam = DataObject.newStructureData(Arrays.asList(this.CLOCK, from, to, selectedValues));
return new SelectiveAccessDescription(1, expectedAccessParam);
}
use of org.openmuc.jdlms.SelectiveAccessDescription in project open-smart-grid-platform by OSGP.
the class GetPeriodicMeterReadsGasCommandExecutorIntegrationTest method createSelectiveAccessDescriptionSmr5.
private SelectiveAccessDescription createSelectiveAccessDescriptionSmr5(final DataObject from, final DataObject to) {
final DataObject selectedValues = DataObject.newArrayData(Collections.emptyList());
final DataObject expectedAccessParam = DataObject.newStructureData(Arrays.asList(this.CLOCK, from, to, selectedValues));
return new SelectiveAccessDescription(1, expectedAccessParam);
}
Aggregations