|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
/*
|
|
|
|
|
* Control.cs
|
|
|
|
|
*
|
|
|
|
|
* Copyright 2014 Michael Zillgith
|
|
|
|
|
* Copyright 2014-2025 Michael Zillgith
|
|
|
|
|
*
|
|
|
|
|
* This file is part of libIEC61850.
|
|
|
|
|
*
|
|
|
|
@ -21,15 +21,15 @@
|
|
|
|
|
* See COPYING file for the complete license text.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using IEC61850.Common;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
|
|
using IEC61850.Common;
|
|
|
|
|
|
|
|
|
|
namespace IEC61850
|
|
|
|
|
{
|
|
|
|
|
// IEC 61850 common API parts (used by client and server API)
|
|
|
|
|
namespace Common {
|
|
|
|
|
{
|
|
|
|
|
// IEC 61850 common API parts (used by client and server API)
|
|
|
|
|
namespace Common
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Control model
|
|
|
|
@ -39,7 +39,7 @@ namespace IEC61850
|
|
|
|
|
/** status only */
|
|
|
|
|
STATUS_ONLY = 0,
|
|
|
|
|
/** direct with normal security */
|
|
|
|
|
DIRECT_NORMAL= 1,
|
|
|
|
|
DIRECT_NORMAL = 1,
|
|
|
|
|
/** select before operate (SBO) with normal security */
|
|
|
|
|
SBO_NORMAL = 2,
|
|
|
|
|
/** direct with enhanced security */
|
|
|
|
@ -51,7 +51,8 @@ namespace IEC61850
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Originator category
|
|
|
|
|
/// </summary>
|
|
|
|
|
public enum OrCat {
|
|
|
|
|
public enum OrCat
|
|
|
|
|
{
|
|
|
|
|
/** Not supported - should not be used */
|
|
|
|
|
NOT_SUPPORTED = 0,
|
|
|
|
|
/** Control operation issued from an operator using a client located at bay level */
|
|
|
|
@ -70,33 +71,33 @@ namespace IEC61850
|
|
|
|
|
MAINTENANCE = 7,
|
|
|
|
|
/** Status change occurred without control action (for example external trip of a circuit breaker or failure inside the breaker) */
|
|
|
|
|
PROCESS = 8
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace Client
|
|
|
|
|
{
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
|
|
internal struct LastApplErrorInternal
|
|
|
|
|
{
|
|
|
|
|
public int ctlNum;
|
|
|
|
|
public int error;
|
|
|
|
|
public int addCause;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class LastApplError
|
|
|
|
|
{
|
|
|
|
|
public int ctlNum;
|
|
|
|
|
public int error;
|
|
|
|
|
public ControlAddCause addCause;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
internal LastApplError(LastApplErrorInternal lastApplError)
|
|
|
|
|
{
|
|
|
|
|
addCause = (ControlAddCause)lastApplError.addCause;
|
|
|
|
|
error = lastApplError.error;
|
|
|
|
|
ctlNum = lastApplError.ctlNum;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace Client
|
|
|
|
|
{
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
|
|
internal struct LastApplErrorInternal
|
|
|
|
|
{
|
|
|
|
|
public int ctlNum;
|
|
|
|
|
public int error;
|
|
|
|
|
public int addCause;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class LastApplError
|
|
|
|
|
{
|
|
|
|
|
public int ctlNum;
|
|
|
|
|
public int error;
|
|
|
|
|
public ControlAddCause addCause;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
internal LastApplError (LastApplErrorInternal lastApplError)
|
|
|
|
|
{
|
|
|
|
|
this.addCause = (ControlAddCause) lastApplError.addCause;
|
|
|
|
|
this.error = lastApplError.error;
|
|
|
|
|
this.ctlNum = lastApplError.ctlNum;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum ControlActionType
|
|
|
|
|
{
|
|
|
|
@ -108,37 +109,37 @@ namespace IEC61850
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Control object.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class ControlObject : IDisposable
|
|
|
|
|
{
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern LastApplErrorInternal ControlObjectClient_getLastApplError(IntPtr self);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern IntPtr ControlObjectClient_create(string objectReference, IntPtr connection);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern void ControlObjectClient_destroy(IntPtr self);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern int ControlObjectClient_getControlModel(IntPtr self);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern int ControlObjectClient_getCtlValType(IntPtr self);
|
|
|
|
|
public class ControlObject : IDisposable
|
|
|
|
|
{
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern LastApplErrorInternal ControlObjectClient_getLastApplError(IntPtr self);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern IntPtr ControlObjectClient_create(string objectReference, IntPtr connection);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern void ControlObjectClient_destroy(IntPtr self);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern int ControlObjectClient_getControlModel(IntPtr self);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern int ControlObjectClient_getCtlValType(IntPtr self);
|
|
|
|
|
|
|
|
|
|
[DllImport ("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern int ControlObjectClient_getLastError (IntPtr self);
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern int ControlObjectClient_getLastError(IntPtr self);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
[return: MarshalAs(UnmanagedType.I1)]
|
|
|
|
|
private static extern bool ControlObjectClient_operate(IntPtr self, IntPtr ctlVal, UInt64 operTime);
|
|
|
|
|
[return: MarshalAs(UnmanagedType.I1)]
|
|
|
|
|
private static extern bool ControlObjectClient_operate(IntPtr self, IntPtr ctlVal, UInt64 operTime);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Handler for asynchronous control actions (select, operate, cancel)
|
|
|
|
|
/// </summary>
|
|
|
|
|
public delegate void ControlActionHandler (UInt32 invokeId, Object parameter, IedClientError error, ControlActionType type, bool success);
|
|
|
|
|
public delegate void ControlActionHandler(UInt32 invokeId, Object parameter, IedClientError error, ControlActionType type, bool success);
|
|
|
|
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
|
private delegate void ControlObjectClient_ControlActionHandler (UInt32 invokeId, IntPtr parameter, int err, int type, [MarshalAs(UnmanagedType.I1)] bool success);
|
|
|
|
|
private delegate void ControlObjectClient_ControlActionHandler(UInt32 invokeId, IntPtr parameter, int err, int type, [MarshalAs(UnmanagedType.I1)] bool success);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern UInt32 ControlObjectClient_operateAsync(IntPtr self, out int err, IntPtr ctlVal, UInt64 operTime,
|
|
|
|
@ -169,53 +170,53 @@ namespace IEC61850
|
|
|
|
|
private static extern bool ControlObjectClient_cancel(IntPtr self);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern void ControlObjectClient_setOrigin(IntPtr self, string orIdent, int orCat);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern void ControlObjectClient_setInterlockCheck(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool value);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern void ControlObjectClient_setSynchroCheck(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool value);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern void ControlObjectClient_setTestMode(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool value);
|
|
|
|
|
private static extern void ControlObjectClient_setOrigin(IntPtr self, string orIdent, int orCat);
|
|
|
|
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
|
private delegate void InternalCommandTerminationHandler(IntPtr parameter,IntPtr controlClient);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern void ControlObjectClient_setCommandTerminationHandler(IntPtr self,
|
|
|
|
|
InternalCommandTerminationHandler handler, IntPtr handlerParameter);
|
|
|
|
|
|
|
|
|
|
public delegate void CommandTerminationHandler (Object parameter, ControlObject controlObject);
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern void ControlObjectClient_setInterlockCheck(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool value);
|
|
|
|
|
|
|
|
|
|
private IedConnection iedConnection;
|
|
|
|
|
private IntPtr self;
|
|
|
|
|
|
|
|
|
|
private CommandTerminationHandler commandTerminationHandler = null;
|
|
|
|
|
private Object commandTerminationHandlerParameter = null;
|
|
|
|
|
|
|
|
|
|
private void MyCommandTerminationHandler (IntPtr paramter, IntPtr controlClient)
|
|
|
|
|
{
|
|
|
|
|
if (commandTerminationHandler != null)
|
|
|
|
|
commandTerminationHandler(commandTerminationHandlerParameter, this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private InternalCommandTerminationHandler intCommandTerminationHandler;
|
|
|
|
|
|
|
|
|
|
internal ControlObject (string objectReference, IntPtr connection, IedConnection iedConnection)
|
|
|
|
|
{
|
|
|
|
|
this.iedConnection = iedConnection;
|
|
|
|
|
|
|
|
|
|
this.self = ControlObjectClient_create(objectReference, connection);
|
|
|
|
|
|
|
|
|
|
if (this.self == System.IntPtr.Zero)
|
|
|
|
|
throw new IedConnectionException("Control object not found", 0);
|
|
|
|
|
|
|
|
|
|
intCommandTerminationHandler = new InternalCommandTerminationHandler (MyCommandTerminationHandler);
|
|
|
|
|
|
|
|
|
|
ControlObjectClient_setCommandTerminationHandler(self, intCommandTerminationHandler, self);
|
|
|
|
|
}
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern void ControlObjectClient_setSynchroCheck(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool value);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern void ControlObjectClient_setTestMode(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool value);
|
|
|
|
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
|
private delegate void InternalCommandTerminationHandler(IntPtr parameter, IntPtr controlClient);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
private static extern void ControlObjectClient_setCommandTerminationHandler(IntPtr self,
|
|
|
|
|
InternalCommandTerminationHandler handler, IntPtr handlerParameter);
|
|
|
|
|
|
|
|
|
|
public delegate void CommandTerminationHandler(Object parameter, ControlObject controlObject);
|
|
|
|
|
|
|
|
|
|
private IedConnection iedConnection;
|
|
|
|
|
private IntPtr self;
|
|
|
|
|
|
|
|
|
|
private CommandTerminationHandler commandTerminationHandler = null;
|
|
|
|
|
private Object commandTerminationHandlerParameter = null;
|
|
|
|
|
|
|
|
|
|
private void MyCommandTerminationHandler(IntPtr paramter, IntPtr controlClient)
|
|
|
|
|
{
|
|
|
|
|
if (commandTerminationHandler != null)
|
|
|
|
|
commandTerminationHandler(commandTerminationHandlerParameter, this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private InternalCommandTerminationHandler intCommandTerminationHandler;
|
|
|
|
|
|
|
|
|
|
internal ControlObject(string objectReference, IntPtr connection, IedConnection iedConnection)
|
|
|
|
|
{
|
|
|
|
|
this.iedConnection = iedConnection;
|
|
|
|
|
|
|
|
|
|
self = ControlObjectClient_create(objectReference, connection);
|
|
|
|
|
|
|
|
|
|
if (self == System.IntPtr.Zero)
|
|
|
|
|
throw new IedConnectionException("Control object not found", 0);
|
|
|
|
|
|
|
|
|
|
intCommandTerminationHandler = new InternalCommandTerminationHandler(MyCommandTerminationHandler);
|
|
|
|
|
|
|
|
|
|
ControlObjectClient_setCommandTerminationHandler(self, intCommandTerminationHandler, self);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the control model.
|
|
|
|
@ -223,23 +224,23 @@ namespace IEC61850
|
|
|
|
|
/// <returns>
|
|
|
|
|
/// The control model.
|
|
|
|
|
/// </returns>
|
|
|
|
|
public ControlModel GetControlModel ()
|
|
|
|
|
{
|
|
|
|
|
ControlModel controlModel = (ControlModel) ControlObjectClient_getControlModel(self);
|
|
|
|
|
|
|
|
|
|
return controlModel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get the type of ctlVal.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>MmsType required for the ctlVal value.</returns>
|
|
|
|
|
public MmsType GetCtlValType ()
|
|
|
|
|
{
|
|
|
|
|
MmsType ctlValType = (MmsType) ControlObjectClient_getCtlValType (self);
|
|
|
|
|
|
|
|
|
|
return ctlValType;
|
|
|
|
|
}
|
|
|
|
|
public ControlModel GetControlModel()
|
|
|
|
|
{
|
|
|
|
|
ControlModel controlModel = (ControlModel)ControlObjectClient_getControlModel(self);
|
|
|
|
|
|
|
|
|
|
return controlModel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get the type of ctlVal.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>MmsType required for the ctlVal value.</returns>
|
|
|
|
|
public MmsType GetCtlValType()
|
|
|
|
|
{
|
|
|
|
|
MmsType ctlValType = (MmsType)ControlObjectClient_getCtlValType(self);
|
|
|
|
|
|
|
|
|
|
return ctlValType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets the origin parameter used by control commands.
|
|
|
|
@ -250,18 +251,20 @@ namespace IEC61850
|
|
|
|
|
/// <param name='originatorCategory'>
|
|
|
|
|
/// Originator category.
|
|
|
|
|
/// </param>
|
|
|
|
|
public void SetOrigin (string originator, OrCat originatorCategory)
|
|
|
|
|
public void SetOrigin(string originator, OrCat originatorCategory)
|
|
|
|
|
{
|
|
|
|
|
ControlObjectClient_setOrigin(self, originator, (int) originatorCategory);
|
|
|
|
|
ControlObjectClient_setOrigin(self, originator, (int)originatorCategory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the error code of the last synchronous control action (operate, select, select-with-value, cancel)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>error code.</value>
|
|
|
|
|
public IedClientError LastError {
|
|
|
|
|
get {
|
|
|
|
|
return (IedClientError)ControlObjectClient_getLastError (self);
|
|
|
|
|
public IedClientError LastError
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (IedClientError)ControlObjectClient_getLastError(self);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -270,10 +273,10 @@ namespace IEC61850
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name='ctlVal'>the new value of the control</param>
|
|
|
|
|
/// <returns>true when the operation has been successful, false otherwise</returns>
|
|
|
|
|
public bool Operate (bool ctlVal)
|
|
|
|
|
{
|
|
|
|
|
return Operate (ctlVal, 0);
|
|
|
|
|
}
|
|
|
|
|
public bool Operate(bool ctlVal)
|
|
|
|
|
{
|
|
|
|
|
return Operate(ctlVal, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Operate the control with the specified control value (time activated control).
|
|
|
|
@ -281,22 +284,22 @@ namespace IEC61850
|
|
|
|
|
/// <param name='ctlVal'>the new value of the control</param>
|
|
|
|
|
/// <param name='operTime'>the time when the operation will be executed</param>
|
|
|
|
|
/// <returns>true when the operation has been successful, false otherwise</returns>
|
|
|
|
|
public bool Operate (bool ctlVal, UInt64 operTime)
|
|
|
|
|
{
|
|
|
|
|
MmsValue value = new MmsValue(ctlVal);
|
|
|
|
|
|
|
|
|
|
return Operate (value, operTime);
|
|
|
|
|
}
|
|
|
|
|
public bool Operate(bool ctlVal, UInt64 operTime)
|
|
|
|
|
{
|
|
|
|
|
MmsValue value = new MmsValue(ctlVal);
|
|
|
|
|
|
|
|
|
|
return Operate(value, operTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Operate the control with the specified control value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name='ctlVal'>the new value of the control</param>
|
|
|
|
|
/// <returns>true when the operation has been successful, false otherwise</returns>
|
|
|
|
|
public bool Operate (float ctlVal)
|
|
|
|
|
{
|
|
|
|
|
return Operate (ctlVal, 0);
|
|
|
|
|
}
|
|
|
|
|
public bool Operate(float ctlVal)
|
|
|
|
|
{
|
|
|
|
|
return Operate(ctlVal, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Operate the control with the specified control value (time activated control).
|
|
|
|
@ -304,22 +307,22 @@ namespace IEC61850
|
|
|
|
|
/// <param name='ctlVal'>the new value of the control</param>
|
|
|
|
|
/// <param name='operTime'>the time when the operation will be executed</param>
|
|
|
|
|
/// <returns>true when the operation has been successful, false otherwise</returns>
|
|
|
|
|
public bool Operate (float ctlVal, UInt64 operTime)
|
|
|
|
|
{
|
|
|
|
|
MmsValue value = new MmsValue(ctlVal);
|
|
|
|
|
|
|
|
|
|
return Operate (value, operTime);
|
|
|
|
|
}
|
|
|
|
|
public bool Operate(float ctlVal, UInt64 operTime)
|
|
|
|
|
{
|
|
|
|
|
MmsValue value = new MmsValue(ctlVal);
|
|
|
|
|
|
|
|
|
|
return Operate(value, operTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Operate the control with the specified control value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name='ctlVal'>the new value of the control</param>
|
|
|
|
|
/// <returns>true when the operation has been successful, false otherwise</returns>
|
|
|
|
|
public bool Operate (int ctlVal)
|
|
|
|
|
{
|
|
|
|
|
return Operate (ctlVal, 0);
|
|
|
|
|
}
|
|
|
|
|
public bool Operate(int ctlVal)
|
|
|
|
|
{
|
|
|
|
|
return Operate(ctlVal, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Operate the control with the specified control value (time activated control).
|
|
|
|
@ -327,22 +330,22 @@ namespace IEC61850
|
|
|
|
|
/// <param name='ctlVal'>the new value of the control</param>
|
|
|
|
|
/// <param name='operTime'>the time when the operation will be executed</param>
|
|
|
|
|
/// <returns>true when the operation has been successful, false otherwise</returns>
|
|
|
|
|
public bool Operate (int ctlVal, UInt64 operTime)
|
|
|
|
|
{
|
|
|
|
|
MmsValue value = new MmsValue(ctlVal);
|
|
|
|
|
|
|
|
|
|
return Operate (value, operTime);
|
|
|
|
|
}
|
|
|
|
|
public bool Operate(int ctlVal, UInt64 operTime)
|
|
|
|
|
{
|
|
|
|
|
MmsValue value = new MmsValue(ctlVal);
|
|
|
|
|
|
|
|
|
|
return Operate(value, operTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Operate the control with the specified control value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name='ctlVal'>the new value of the control</param>
|
|
|
|
|
/// <returns>true when the operation has been successful, false otherwise</returns>
|
|
|
|
|
public bool Operate (MmsValue ctlVal)
|
|
|
|
|
{
|
|
|
|
|
return Operate (ctlVal, 0);
|
|
|
|
|
}
|
|
|
|
|
public bool Operate(MmsValue ctlVal)
|
|
|
|
|
{
|
|
|
|
|
return Operate(ctlVal, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Operate the control with the specified control value (time activated control).
|
|
|
|
@ -350,18 +353,18 @@ namespace IEC61850
|
|
|
|
|
/// <param name='ctlVal'>the new value of the control</param>
|
|
|
|
|
/// <param name='operTime'>the time when the operation will be executed</param>
|
|
|
|
|
/// <returns>true when the operation has been successful, false otherwise</returns>
|
|
|
|
|
public bool Operate (MmsValue ctlVal, UInt64 operTime)
|
|
|
|
|
{
|
|
|
|
|
return ControlObjectClient_operate(self, ctlVal.valueReference, operTime);
|
|
|
|
|
}
|
|
|
|
|
public bool Operate(MmsValue ctlVal, UInt64 operTime)
|
|
|
|
|
{
|
|
|
|
|
return ControlObjectClient_operate(self, ctlVal.valueReference, operTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ControlObjectClient_ControlActionHandler internalOperateHandler = null;
|
|
|
|
|
|
|
|
|
|
private void nativeOperateHandler (UInt32 invokeId, IntPtr parameter, int err, int type, bool success)
|
|
|
|
|
private void nativeOperateHandler(UInt32 invokeId, IntPtr parameter, int err, int type, bool success)
|
|
|
|
|
{
|
|
|
|
|
GCHandle handle = GCHandle.FromIntPtr(parameter);
|
|
|
|
|
|
|
|
|
|
Tuple<ControlActionHandler, object> callbackInfo = handle.Target as Tuple<ControlActionHandler, object>;
|
|
|
|
|
Tuple<ControlActionHandler, object> callbackInfo = handle.Target as Tuple<ControlActionHandler, object>;
|
|
|
|
|
|
|
|
|
|
ControlActionHandler handler = callbackInfo.Item1;
|
|
|
|
|
object handlerParameter = callbackInfo.Item2;
|
|
|
|
@ -370,7 +373,7 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
IedClientError clientError = (IedClientError)err;
|
|
|
|
|
|
|
|
|
|
handler(invokeId, handlerParameter, clientError, (ControlActionType) type, success);
|
|
|
|
|
handler(invokeId, handlerParameter, clientError, (ControlActionType)type, success);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -382,11 +385,11 @@ namespace IEC61850
|
|
|
|
|
/// <param name="parameter">User provided callback parameter. Will be passed to the callback function</param>
|
|
|
|
|
/// <returns>the invoke ID of the sent request</returns>
|
|
|
|
|
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
|
|
|
|
|
public UInt32 OperateAsync (bool ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
public UInt32 OperateAsync(bool ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
{
|
|
|
|
|
return OperateAsync (ctlVal, 0, handler, parameter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return OperateAsync(ctlVal, 0, handler, parameter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Operate the control with the specified control value (time activated control).
|
|
|
|
|
/// </summary>
|
|
|
|
@ -396,13 +399,13 @@ namespace IEC61850
|
|
|
|
|
/// <param name="parameter">User provided callback parameter. Will be passed to the callback function</param>
|
|
|
|
|
/// <returns>the invoke ID of the sent request</returns>
|
|
|
|
|
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
|
|
|
|
|
public UInt32 OperateAsync (bool ctlVal, UInt64 operTime, ControlActionHandler handler, object parameter)
|
|
|
|
|
public UInt32 OperateAsync(bool ctlVal, UInt64 operTime, ControlActionHandler handler, object parameter)
|
|
|
|
|
{
|
|
|
|
|
MmsValue value = new MmsValue(ctlVal);
|
|
|
|
|
|
|
|
|
|
return OperateAsync (value, operTime, handler, parameter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return OperateAsync(value, operTime, handler, parameter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Operate the control with the specified control value.
|
|
|
|
|
/// </summary>
|
|
|
|
@ -411,11 +414,11 @@ namespace IEC61850
|
|
|
|
|
/// <param name="parameter">User provided callback parameter. Will be passed to the callback function</param>
|
|
|
|
|
/// <returns>the invoke ID of the sent request</returns>
|
|
|
|
|
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
|
|
|
|
|
public UInt32 OperateAsync (float ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
public UInt32 OperateAsync(float ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
{
|
|
|
|
|
return OperateAsync (ctlVal, 0, handler, parameter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return OperateAsync(ctlVal, 0, handler, parameter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Operate the control with the specified control value (time activated control).
|
|
|
|
|
/// </summary>
|
|
|
|
@ -425,13 +428,13 @@ namespace IEC61850
|
|
|
|
|
/// <param name="parameter">User provided callback parameter. Will be passed to the callback function</param>
|
|
|
|
|
/// <returns>the invoke ID of the sent request</returns>
|
|
|
|
|
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
|
|
|
|
|
public UInt32 OperateAsync (float ctlVal, UInt64 operTime, ControlActionHandler handler, object parameter)
|
|
|
|
|
public UInt32 OperateAsync(float ctlVal, UInt64 operTime, ControlActionHandler handler, object parameter)
|
|
|
|
|
{
|
|
|
|
|
MmsValue value = new MmsValue(ctlVal);
|
|
|
|
|
|
|
|
|
|
return OperateAsync (value, operTime, handler, parameter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return OperateAsync(value, operTime, handler, parameter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Operate the control with the specified control value.
|
|
|
|
|
/// </summary>
|
|
|
|
@ -440,9 +443,9 @@ namespace IEC61850
|
|
|
|
|
/// <param name="parameter">User provided callback parameter. Will be passed to the callback function</param>
|
|
|
|
|
/// <returns>the invoke ID of the sent request</returns>
|
|
|
|
|
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
|
|
|
|
|
public UInt32 OperateAsync (int ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
public UInt32 OperateAsync(int ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
{
|
|
|
|
|
return OperateAsync (ctlVal, 0, handler, parameter);
|
|
|
|
|
return OperateAsync(ctlVal, 0, handler, parameter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -454,9 +457,9 @@ namespace IEC61850
|
|
|
|
|
/// <param name="parameter">User provided callback parameter. Will be passed to the callback function</param>
|
|
|
|
|
/// <returns>the invoke ID of the sent request</returns>
|
|
|
|
|
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
|
|
|
|
|
public UInt32 OperateAsync (int ctlVal, UInt64 operTime, ControlActionHandler handler, object parameter)
|
|
|
|
|
public UInt32 OperateAsync(int ctlVal, UInt64 operTime, ControlActionHandler handler, object parameter)
|
|
|
|
|
{
|
|
|
|
|
return OperateAsync (ctlVal, operTime, handler, parameter);
|
|
|
|
|
return OperateAsync(ctlVal, operTime, handler, parameter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -467,9 +470,9 @@ namespace IEC61850
|
|
|
|
|
/// <param name="parameter">User provided callback parameter. Will be passed to the callback function</param>
|
|
|
|
|
/// <returns>the invoke ID of the sent request</returns>
|
|
|
|
|
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
|
|
|
|
|
public UInt32 OperateAsync (MmsValue ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
public UInt32 OperateAsync(MmsValue ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
{
|
|
|
|
|
return OperateAsync (ctlVal, 0, handler, parameter);
|
|
|
|
|
return OperateAsync(ctlVal, 0, handler, parameter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -481,7 +484,7 @@ namespace IEC61850
|
|
|
|
|
/// <param name="parameter">User provided callback parameter. Will be passed to the callback function</param>
|
|
|
|
|
/// <returns>the invoke ID of the sent request</returns>
|
|
|
|
|
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
|
|
|
|
|
public UInt32 OperateAsync (MmsValue ctlVal, UInt64 operTime, ControlActionHandler handler, object parameter)
|
|
|
|
|
public UInt32 OperateAsync(MmsValue ctlVal, UInt64 operTime, ControlActionHandler handler, object parameter)
|
|
|
|
|
{
|
|
|
|
|
int error;
|
|
|
|
|
|
|
|
|
@ -507,7 +510,7 @@ namespace IEC61850
|
|
|
|
|
/// Select the control object.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>true when the selection has been successful, false otherwise</returns>
|
|
|
|
|
public bool Select ()
|
|
|
|
|
public bool Select()
|
|
|
|
|
{
|
|
|
|
|
return ControlObjectClient_select(self);
|
|
|
|
|
}
|
|
|
|
@ -546,7 +549,7 @@ namespace IEC61850
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name='ctlVal'>the value to be checked.</param>
|
|
|
|
|
/// <returns>true when the selection has been successful, false otherwise</returns>
|
|
|
|
|
public bool SelectWithValue (MmsValue ctlVal)
|
|
|
|
|
public bool SelectWithValue(MmsValue ctlVal)
|
|
|
|
|
{
|
|
|
|
|
return ControlObjectClient_selectWithValue(self, ctlVal.valueReference);
|
|
|
|
|
}
|
|
|
|
@ -558,7 +561,7 @@ namespace IEC61850
|
|
|
|
|
/// the value to be checked.
|
|
|
|
|
/// </param>
|
|
|
|
|
/// <returns>true when the selection has been successful, false otherwise</returns>
|
|
|
|
|
public bool SelectWithValue (bool ctlVal)
|
|
|
|
|
public bool SelectWithValue(bool ctlVal)
|
|
|
|
|
{
|
|
|
|
|
return SelectWithValue(new MmsValue(ctlVal));
|
|
|
|
|
}
|
|
|
|
@ -570,7 +573,7 @@ namespace IEC61850
|
|
|
|
|
/// the value to be checked.
|
|
|
|
|
/// </param>
|
|
|
|
|
/// <returns>true when the selection has been successful, false otherwise</returns>
|
|
|
|
|
public bool SelectWithValue (int ctlVal)
|
|
|
|
|
public bool SelectWithValue(int ctlVal)
|
|
|
|
|
{
|
|
|
|
|
return SelectWithValue(new MmsValue(ctlVal));
|
|
|
|
|
}
|
|
|
|
@ -582,7 +585,7 @@ namespace IEC61850
|
|
|
|
|
/// the value to be checked.
|
|
|
|
|
/// </param>
|
|
|
|
|
/// <returns>true when the selection has been successful, false otherwise</returns>
|
|
|
|
|
public bool SelectWithValue (float ctlVal)
|
|
|
|
|
public bool SelectWithValue(float ctlVal)
|
|
|
|
|
{
|
|
|
|
|
return SelectWithValue(new MmsValue(ctlVal));
|
|
|
|
|
}
|
|
|
|
@ -595,7 +598,7 @@ namespace IEC61850
|
|
|
|
|
/// <param name="parameter">User provided callback parameter. Will be passed to the callback function</param>
|
|
|
|
|
/// <returns>the invoke ID of the sent request</returns>
|
|
|
|
|
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
|
|
|
|
|
public UInt32 SelectWithValueAsync (bool ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
public UInt32 SelectWithValueAsync(bool ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
{
|
|
|
|
|
return SelectWithValueAsync(new MmsValue(ctlVal), handler, parameter);
|
|
|
|
|
}
|
|
|
|
@ -608,7 +611,7 @@ namespace IEC61850
|
|
|
|
|
/// <param name="parameter">User provided callback parameter. Will be passed to the callback function</param>
|
|
|
|
|
/// <returns>the invoke ID of the sent request</returns>
|
|
|
|
|
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
|
|
|
|
|
public UInt32 SelectWithValueAsync (int ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
public UInt32 SelectWithValueAsync(int ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
{
|
|
|
|
|
return SelectWithValueAsync(new MmsValue(ctlVal), handler, parameter);
|
|
|
|
|
}
|
|
|
|
@ -621,11 +624,11 @@ namespace IEC61850
|
|
|
|
|
/// <param name="parameter">User provided callback parameter. Will be passed to the callback function</param>
|
|
|
|
|
/// <returns>the invoke ID of the sent request</returns>
|
|
|
|
|
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
|
|
|
|
|
public UInt32 SelectWithValueAsync (float ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
public UInt32 SelectWithValueAsync(float ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
{
|
|
|
|
|
return SelectWithValueAsync(new MmsValue(ctlVal), handler, parameter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Send a select with value command for generic MmsValue instances - asynchronous version
|
|
|
|
|
/// </summary>
|
|
|
|
@ -634,7 +637,7 @@ namespace IEC61850
|
|
|
|
|
/// <param name="parameter">User provided callback parameter. Will be passed to the callback function</param>
|
|
|
|
|
/// <returns>the invoke ID of the sent request</returns>
|
|
|
|
|
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
|
|
|
|
|
public UInt32 SelectWithValueAsync (MmsValue ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
public UInt32 SelectWithValueAsync(MmsValue ctlVal, ControlActionHandler handler, object parameter)
|
|
|
|
|
{
|
|
|
|
|
int error;
|
|
|
|
|
|
|
|
|
@ -664,7 +667,7 @@ namespace IEC61850
|
|
|
|
|
/// <param name="parameter">User provided callback parameter. Will be passed to the callback function</param>
|
|
|
|
|
/// <returns>the invoke ID of the sent request</returns>
|
|
|
|
|
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
|
|
|
|
|
public bool Cancel ()
|
|
|
|
|
public bool Cancel()
|
|
|
|
|
{
|
|
|
|
|
return ControlObjectClient_cancel(self);
|
|
|
|
|
}
|
|
|
|
@ -698,90 +701,93 @@ namespace IEC61850
|
|
|
|
|
/// Enables the synchro check for operate commands
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Obsolete("use SetSynchroCheck instead")]
|
|
|
|
|
public void EnableSynchroCheck ()
|
|
|
|
|
{
|
|
|
|
|
ControlObjectClient_setSynchroCheck (self, true);
|
|
|
|
|
public void EnableSynchroCheck()
|
|
|
|
|
{
|
|
|
|
|
ControlObjectClient_setSynchroCheck(self, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Enables the interlock check for operate and select commands
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Obsolete("use SetInterlockCheck instead")]
|
|
|
|
|
public void EnableInterlockCheck ()
|
|
|
|
|
{
|
|
|
|
|
ControlObjectClient_setInterlockCheck (self, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets the value of the interlock check flag for operate and select commands
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void SetInterlockCheck (bool value)
|
|
|
|
|
{
|
|
|
|
|
ControlObjectClient_setInterlockCheck (self, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets the value of the synchro check flag for operate command
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void SetSynchroCheck (bool value)
|
|
|
|
|
{
|
|
|
|
|
ControlObjectClient_setSynchroCheck (self, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets the value of the test flag for the operate command
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void SetTestMode (bool value)
|
|
|
|
|
{
|
|
|
|
|
ControlObjectClient_setTestMode (self, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the last received LastApplError (Additional Cause Diagnostics) value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>
|
|
|
|
|
/// The last appl error.
|
|
|
|
|
/// </returns>
|
|
|
|
|
public LastApplError GetLastApplError ()
|
|
|
|
|
{
|
|
|
|
|
LastApplErrorInternal lastApplError = ControlObjectClient_getLastApplError(self);
|
|
|
|
|
|
|
|
|
|
return new LastApplError(lastApplError);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets the command termination handler.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name='handler'>
|
|
|
|
|
/// the handler (delegate) that is invoked when a CommandTerminationMessage is received.
|
|
|
|
|
/// </param>
|
|
|
|
|
/// <param name='parameter'>
|
|
|
|
|
/// Parameter.
|
|
|
|
|
/// </param>
|
|
|
|
|
public void SetCommandTerminationHandler (CommandTerminationHandler handler, Object parameter)
|
|
|
|
|
{
|
|
|
|
|
this.commandTerminationHandler = handler;
|
|
|
|
|
this.commandTerminationHandlerParameter = parameter;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual void Dispose(bool disposing) {
|
|
|
|
|
if (this.self != System.IntPtr.Zero) {
|
|
|
|
|
ControlObjectClient_destroy (self);
|
|
|
|
|
this.self = System.IntPtr.Zero;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Dispose() {
|
|
|
|
|
Dispose (true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
~ControlObject()
|
|
|
|
|
{
|
|
|
|
|
Dispose (false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[Obsolete("use SetInterlockCheck instead")]
|
|
|
|
|
public void EnableInterlockCheck()
|
|
|
|
|
{
|
|
|
|
|
ControlObjectClient_setInterlockCheck(self, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets the value of the interlock check flag for operate and select commands
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void SetInterlockCheck(bool value)
|
|
|
|
|
{
|
|
|
|
|
ControlObjectClient_setInterlockCheck(self, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets the value of the synchro check flag for operate command
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void SetSynchroCheck(bool value)
|
|
|
|
|
{
|
|
|
|
|
ControlObjectClient_setSynchroCheck(self, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets the value of the test flag for the operate command
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void SetTestMode(bool value)
|
|
|
|
|
{
|
|
|
|
|
ControlObjectClient_setTestMode(self, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the last received LastApplError (Additional Cause Diagnostics) value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>
|
|
|
|
|
/// The last appl error.
|
|
|
|
|
/// </returns>
|
|
|
|
|
public LastApplError GetLastApplError()
|
|
|
|
|
{
|
|
|
|
|
LastApplErrorInternal lastApplError = ControlObjectClient_getLastApplError(self);
|
|
|
|
|
|
|
|
|
|
return new LastApplError(lastApplError);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets the command termination handler.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name='handler'>
|
|
|
|
|
/// the handler (delegate) that is invoked when a CommandTerminationMessage is received.
|
|
|
|
|
/// </param>
|
|
|
|
|
/// <param name='parameter'>
|
|
|
|
|
/// Parameter.
|
|
|
|
|
/// </param>
|
|
|
|
|
public void SetCommandTerminationHandler(CommandTerminationHandler handler, Object parameter)
|
|
|
|
|
{
|
|
|
|
|
commandTerminationHandler = handler;
|
|
|
|
|
commandTerminationHandlerParameter = parameter;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual void Dispose(bool disposing)
|
|
|
|
|
{
|
|
|
|
|
if (self != System.IntPtr.Zero)
|
|
|
|
|
{
|
|
|
|
|
ControlObjectClient_destroy(self);
|
|
|
|
|
self = System.IntPtr.Zero;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
|
|
|
|
Dispose(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
~ControlObject()
|
|
|
|
|
{
|
|
|
|
|
Dispose(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|