Search in sources :

Example 6 with NodeWriteException

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());
}
Also used : NodeContainer(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)

Example 7 with NodeWriteException

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());
}
Also used : NodeContainer(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.NodeContainer) ProfilePair(com.alliander.osgp.adapter.protocol.iec61850.domain.valueobjects.ProfilePair)

Example 8 with NodeWriteException

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);
}
Also used : NodeContainer(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)

Example 9 with NodeWriteException

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);
}
Also used : NodeContainer(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)

Example 10 with NodeWriteException

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);
    }
}
Also used : NodeWriteException(com.alliander.osgp.adapter.protocol.iec61850.exceptions.NodeWriteException) Iec61850EnableReportingCommand(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850EnableReportingCommand)

Aggregations

NodeContainer (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)10 NodeWriteException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.NodeWriteException)7 ProtocolAdapterException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.ProtocolAdapterException)2 Iec61850EnableReportingCommand (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850EnableReportingCommand)2 Array (org.openmuc.openiec61850.Array)2 DeviceMessageLog (com.alliander.osgp.adapter.protocol.iec61850.domain.valueobjects.DeviceMessageLog)1 ProfilePair (com.alliander.osgp.adapter.protocol.iec61850.domain.valueobjects.ProfilePair)1 ConnectionFailureException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.ConnectionFailureException)1 NodeReadException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.NodeReadException)1 Iec61850ClientBaseEventListener (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.reporting.Iec61850ClientBaseEventListener)1 Iec61850ClearReportCommand (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850ClearReportCommand)1 Iec61850SetGpsCoordinatesCommand (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850SetGpsCoordinatesCommand)1 Ssld (com.alliander.osgp.core.db.api.iec61850.entities.Ssld)1 IOException (java.io.IOException)1 Timer (java.util.Timer)1 TimerTask (java.util.TimerTask)1 BdaFloat32 (org.openmuc.openiec61850.BdaFloat32)1 BdaTimestamp (org.openmuc.openiec61850.BdaTimestamp)1 SclParseException (org.openmuc.openiec61850.SclParseException)1