use of com.alliander.osgp.adapter.protocol.iec61850.exceptions.NodeWriteException in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850SetGpsCoordinatesCommand method setGpsCoordinates.
public void setGpsCoordinates(final DeviceConnection deviceConnection, final Float longitude, final Float latitude) throws NodeWriteException {
final NodeContainer astronomical = deviceConnection.getFcModelNode(LogicalDevice.LIGHTING, LogicalNode.STREET_LIGHT_CONFIGURATION, DataAttribute.ASTRONOMICAL, Fc.CF);
astronomical.writeFloat(SubDataAttribute.GPS_LONGITUDE, longitude);
astronomical.writeFloat(SubDataAttribute.GPS_LATITUDE, latitude);
LOGGER.info("longitude: {}, latitude: {} written for device: {}", longitude, latitude, deviceConnection.getDeviceIdentification());
}
use of com.alliander.osgp.adapter.protocol.iec61850.exceptions.NodeWriteException in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850ScheduleAbsTimeCommand method executeWrite.
@Override
public void executeWrite(final Iec61850Client client, final DeviceConnection connection, final LogicalDevice logicalDevice, final int logicalDeviceIndex, final ProfileDto profile) throws NodeWriteException {
this.checkProfile(profile);
final NodeContainer containingNode = connection.getFcModelNode(logicalDevice, logicalDeviceIndex, this.logicalNode, DATA_ATTRIBUTE, FC);
final ProfilePair profilePair = this.convert(profile.getProfileEntries());
containingNode.writeFloatArray(SubDataAttribute.VALUES, profilePair.getValues());
containingNode.writeDateArray(SubDataAttribute.TIMES, profilePair.getTimes());
}
use of com.alliander.osgp.adapter.protocol.iec61850.exceptions.NodeWriteException in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850ScheduleCatCommand method executeWrite.
@Override
public void executeWrite(final Iec61850Client client, final DeviceConnection connection, final LogicalDevice logicalDevice, final int logicalDeviceIndex, final SetPointDto setPoint) throws NodeWriteException {
final int value = this.checkValue(setPoint.getValue());
final NodeContainer containingNode = connection.getFcModelNode(logicalDevice, logicalDeviceIndex, this.logicalNode, DATA_ATTRIBUTE_RTU, FC);
containingNode.writeInteger(SUB_DATA_ATTRIBUTE, value);
}
use of com.alliander.osgp.adapter.protocol.iec61850.exceptions.NodeWriteException in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850ScheduleIdCommand method executeWrite.
@Override
public void executeWrite(final Iec61850Client client, final DeviceConnection connection, final LogicalDevice logicalDevice, final int logicalDeviceIndex, final SetPointDto setPoint) throws NodeWriteException {
final int value = this.checkValue(setPoint.getValue());
final NodeContainer containingNode = connection.getFcModelNode(logicalDevice, logicalDeviceIndex, this.logicalNode, DATA_ATTRIBUTE, FC);
containingNode.writeInteger(SUB_DATA_ATTRIBUTE, value);
}
use of com.alliander.osgp.adapter.protocol.iec61850.exceptions.NodeWriteException in project Protocol-Adapter-IEC61850 by OSGP.
the class DeviceRegistrationService method enableReporting.
protected void enableReporting(final DeviceConnection deviceConnection) {
try {
new Iec61850EnableReportingCommand().enableReportingOnDeviceWithoutUsingSequenceNumber(DeviceRegistrationService.this.iec61850DeviceConnectionService.getIec61850Client(), deviceConnection);
// Don't disconnect now! The device should be able to send
// reports.
this.waitClearReportAndDisconnect(deviceConnection);
} catch (final NodeWriteException e) {
LOGGER.error("Unable to enabele reporting for device: " + deviceConnection.getDeviceIdentification(), e);
DeviceRegistrationService.this.iec61850DeviceConnectionService.disconnect(deviceConnection, null);
}
}
Aggregations