Example #1
0
 public void RspRemoteCommandToHost(HostRemoteCommandArg arg, ObjParameterData[] replyParams)
 {
     if (arg.HcAck != 0)
     {
         this.commandService.CommandFailed(new CustomAckCodeException("", Convert.ToInt32(arg.HcAck)), Convert.ToInt32(arg.nObjectID));
     }
     else
     {
         this.commandService.CommandAcknowledge(new CommandReply(replyParams, arg.nSB, true), Convert.ToInt32(arg.nObjectID));
     }
 }
Example #2
0
        public CommandReply ExecuteCommandAsynchronous(EcsCommand command, string[] parameterNames, object[] parameterValues, long closure, int transactionId)
        {
            ObjParameterData[] replyParams = new ObjParameterData[parameterNames.Length];
            for (int i = 0; i < parameterNames.Length; i++)
            {
                replyParams[i] = new ObjParameterData(parameterNames[i], parameterValues[i]);
            }

            HostRemoteCommandArg arg = new HostRemoteCommandArg(transactionId, 2, 41, closure, command.CommandName);

            for (int i = 0; i < parameterNames.Length; i++)
            {
                arg.SetCPVal(parameterNames[i], parameterValues[i].ToString());
            }

            OnChangeControl?.BeginInvoke(this, new ControlArg("RemoteCommand", arg, replyParams), null, null);

            ////Test
            //arg.SetHcAck(1);
            //RspRemoteCommandToHost(arg, replyParams);
            ////Test

            return(null);
        }