public void SetWaitForExecutionHandler(DataObject controlObject, ControlWaitForExecutionHandler handler, object parameter)
            {
                ControlHandlerInfo info = GetControlHandlerInfo(controlObject);

                info.waitForExecHandler          = handler;
                info.waitForExecHandlerParameter = parameter;

                IedServer_setWaitForExecutionHandler(self, controlObject.self, internalControlWaitForExecutionHandler, GCHandle.ToIntPtr(info.handle));
            }
            public void SetCheckHandler(DataObject controlObject, CheckHandler handler, object parameter)
            {
                ControlHandlerInfo info = GetControlHandlerInfo(controlObject);

                info.checkHandler          = handler;
                info.checkHandlerParameter = parameter;

                IedServer_setPerformCheckHandler(self, controlObject.self, internalCheckHandler, GCHandle.ToIntPtr(info.handle));
            }
            public void SetControlHandler(DataObject controlObject, ControlHandler handler, object parameter)
            {
                ControlHandlerInfo info = GetControlHandlerInfo(controlObject);

                info.controlHandler          = handler;
                info.controlHandlerParameter = parameter;

                if (internalControlHandlerRef == null)
                {
                    internalControlHandlerRef = new InternalControlHandler(internalControlHandler);
                }

                IedServer_setControlHandler(self, controlObject.self, internalControlHandlerRef, GCHandle.ToIntPtr(info.handle));
            }
            private ControlHandlerInfo GetControlHandlerInfo(DataObject controlObject)
            {
                ControlHandlerInfo info;

                controlHandlers.TryGetValue(controlObject, out info);

                if (info == null)
                {
                    info = new ControlHandlerInfo(controlObject);
                    controlHandlers.Add(controlObject, info);
                }

                return(info);
            }
            int internalControlWaitForExecutionHandler(IntPtr parameter, IntPtr ctlVal, bool test, bool synchoCheck)
            {
                GCHandle handle = GCHandle.FromIntPtr(parameter);

                ControlHandlerInfo info = (ControlHandlerInfo)handle.Target;

                if (info != null & info.waitForExecHandler != null)
                {
                    return((int)info.waitForExecHandler(info.controlObject, info.waitForExecHandlerParameter, new MmsValue(ctlVal), test, synchoCheck));
                }
                else
                {
                    return((int)ControlHandlerResult.FAILED);
                }
            }
Beispiel #6
0
            int InternalControlWaitForExecutionHandlerImpl(IntPtr action, IntPtr parameter, IntPtr ctlVal, bool test, bool synchoCheck)
            {
                GCHandle handle = GCHandle.FromIntPtr(parameter);

                ControlHandlerInfo info = (ControlHandlerInfo)handle.Target;

                if (info != null & info.waitForExecHandler != null)
                {
                    ControlAction controlAction = new ControlAction(action, info, this);

                    return((int)info.waitForExecHandler(controlAction, info.waitForExecHandlerParameter, new MmsValue(ctlVal), test, synchoCheck));
                }
                else
                {
                    return((int)ControlHandlerResult.FAILED);
                }
            }
Beispiel #7
0
            int InternalCheckHandlerImpl(IntPtr action, IntPtr parameter, IntPtr ctlVal, bool test, bool interlockCheck)
            {
                GCHandle handle = GCHandle.FromIntPtr(parameter);

                ControlHandlerInfo info = (ControlHandlerInfo)handle.Target;

                if (info != null & info.checkHandler != null)
                {
                    ControlAction controlAction = new ControlAction(action, info, this);

                    return((int)info.checkHandler(controlAction, info.checkHandlerParameter, new MmsValue(ctlVal), test, interlockCheck));
                }
                else
                {
                    return((int)CheckHandlerResult.OBJECT_UNDEFINED);
                }
            }
            int internalCheckHandler(IntPtr parameter, IntPtr ctlVal, bool test, bool interlockCheck, IntPtr connection)
            {
                GCHandle handle = GCHandle.FromIntPtr(parameter);

                ControlHandlerInfo info = (ControlHandlerInfo)handle.Target;

                if (info != null & info.checkHandler != null)
                {
                    ClientConnection con = null;

                    clientConnections.TryGetValue(connection, out con);

                    return((int)info.checkHandler(info.controlObject, info.checkHandlerParameter, new MmsValue(ctlVal), test, interlockCheck, con));
                }
                else
                {
                    return((int)CheckHandlerResult.OBJECT_UNDEFINED);
                }
            }