Beispiel #1
0
        /// <summary>
        /// 执行控制命令
        /// </summary>
        /// <param name="output"></param>
        public void RunCmd(Action <string, eOutputType> output)
        {
            CmcsAppRemoteControlCmd appRemoteControlCmd = commonDAO.GetNewestAppRemoteControlCmd(GlobalVars.MachineCode_HYGPJ_1);

            if (appRemoteControlCmd != null)
            {
                if (appRemoteControlCmd.CmdCode == "卸车刷卡")
                {
                    output("接收远程命令:" + appRemoteControlCmd.CmdCode + ",参数:" + appRemoteControlCmd.Param, eOutputType.Normal);
                    Dictionary <string, object> cmd = new Dictionary <string, object>();
                    cmd.Add("送样小车.卸车端." + "卸车刷卡", true);
                    if (opcServere.WriteOPCItemValue(cmd))
                    {
                        // 更新执行结果
                        commonDAO.SetAppRemoteControlCmdResultCode(appRemoteControlCmd, eEquInfCmdResultCode.成功);
                        commonDAO.SaveSysMessage(appRemoteControlCmd.AppIdentifier + "卸车刷卡", appRemoteControlCmd.AppIdentifier + "卸车刷卡执行成功");
                    }
                }
                else if (appRemoteControlCmd.CmdCode == "装车刷卡")
                {
                    output("接收远程命令:" + appRemoteControlCmd.CmdCode + ",参数:" + appRemoteControlCmd.Param, eOutputType.Normal);
                    Dictionary <string, object> cmd = new Dictionary <string, object>();
                    cmd.Add("送样小车.卸车端." + "装车刷卡", true);
                    if (opcServere.WriteOPCItemValue(cmd))
                    {
                        // 更新执行结果
                        commonDAO.SetAppRemoteControlCmdResultCode(appRemoteControlCmd, eEquInfCmdResultCode.成功);
                        commonDAO.SaveSysMessage(appRemoteControlCmd.AppIdentifier + "装车刷卡", appRemoteControlCmd.AppIdentifier + "装车刷卡执行成功");
                    }
                }
            }
        }
        /// <summary>
        /// 采样机1执行控制命令
        /// </summary>
        /// <param name="output"></param>
        public void RunCmd1(Action <string, eOutputType> output)
        {
            CmcsAppRemoteControlCmd appRemoteControlCmd = commonDAO.GetNewestAppRemoteControlCmd(GlobalVars.MachineCode_QCJXCYJ_1);

            if (appRemoteControlCmd != null)
            {
                if (appRemoteControlCmd.CmdCode == "急停")
                {
                    output("接收远程命令:" + appRemoteControlCmd.CmdCode + ",参数:" + appRemoteControlCmd.Param, eOutputType.Normal);
                    Dictionary <string, object> cmd = new Dictionary <string, object>();
                    cmd.Add("汽车机械采样机.#1采样机." + "急停/复位", appRemoteControlCmd.Param == "1" ? true : false);
                    if (opcServere.WriteOPCItemValue(cmd))
                    {
                        // 更新执行结果
                        commonDAO.SetAppRemoteControlCmdResultCode(appRemoteControlCmd, eEquInfCmdResultCode.成功);
                        commonDAO.SaveSysMessage(appRemoteControlCmd.AppIdentifier + "急停/复位", appRemoteControlCmd.AppIdentifier + appRemoteControlCmd.Param == "1"? "急停执行成功" : "复位执行成功");
                    }
                }
                else if (appRemoteControlCmd.CmdCode == "制样急停")
                {
                    output("接收远程命令:" + appRemoteControlCmd.CmdCode + ",参数:" + appRemoteControlCmd.Param, eOutputType.Normal);
                    Dictionary <string, object> cmd = new Dictionary <string, object>();
                    cmd.Add("汽车机械采样机.#1采样机." + "启动/停止", appRemoteControlCmd.Param == "1" ? true : false);
                    if (opcServere.WriteOPCItemValue(cmd))
                    {
                        // 更新执行结果
                        commonDAO.SetAppRemoteControlCmdResultCode(appRemoteControlCmd, eEquInfCmdResultCode.成功);
                        commonDAO.SaveSysMessage(appRemoteControlCmd.AppIdentifier + "制样急停", appRemoteControlCmd.AppIdentifier + appRemoteControlCmd.Param == "1" ? "急停执行成功" : "复位执行成功");
                    }
                }
            }
        }