tangxu
2022-10-26 295251bf072d48e9cdf7e3819eb0817708bbd842
添加 关机 开机 指令(南通)
已修改3个文件
112 ■■■■■ 文件已修改
Socket/IStation.DataDockingSocket4NT/control/SendControlJobHelper.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Socket/IStation.DataDockingSocket4NT/helper/MsgDataHelper.cs 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Socket/IStation.DataDockingSocket4NT/paras_datadocking_socket_nt.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Socket/IStation.DataDockingSocket4NT/control/SendControlJobHelper.cs
@@ -51,8 +51,14 @@
                        byte[] bts = null;
                        switch (paras.Type)
                        {
                            case 0: bts = MsgDataHelper.GetControlMsg关机(); break;//从辅助类中获取  关闭
                            case 1: bts = MsgDataHelper.GetControlMsg开机(); break;//从辅助类中获取 开启
                            case 0:
                                bts = MsgDataHelper.GetControlMsg关机();
                                LogHelper.Info("关机");
                                break;//从辅助类中获取  关闭
                            case 1:
                                bts = MsgDataHelper.GetControlMsg开机();
                                LogHelper.Info("开机");
                                break;//从辅助类中获取 开启
                            case -1:
                                {
                                    if (string.IsNullOrEmpty(paras.Paras))
@@ -65,14 +71,13 @@
                                        LogHelper.Error($"[调频]参数异常:{paras.Paras}");
                                        return false;
                                    }
                                    else
                                    {
                                        bts = MsgDataHelper.GetControlMsg调频(value);
                                        LogHelper.Info($"[调频]参数:{paras.Paras}");
                                    }
                                     bts = MsgDataHelper.GetControlMsg调频(value);
                                     LogHelper.Info($"[调频]参数:{paras.Paras}");
                                }
                                break;//从辅助类中获取 变频
                            default: break;
                            default:
                                return false;
                        }
                        if (bts != null)
                        {
Socket/IStation.DataDockingSocket4NT/helper/MsgDataHelper.cs
@@ -71,16 +71,7 @@
        }
        /// <summary>
        /// 获取控制指令(关机)
        /// </summary>
        /// <returns></returns>
        public static byte[] GetControlMsg关机()
        {
            return null;
        }
        /// <summary>
        /// 
        /// </summary>
@@ -95,31 +86,6 @@
            }
            return appParas.InstructionQuerys;
        }
        /// <summary>
        /// 获取控制指令(开机)
        /// </summary>
        /// <returns></returns>
        public static byte[] GetControlMsg开机()
        {
            return null;
        }
        /// <summary>
        /// 获取控制指令(调频)
        /// </summary>
        /// <returns></returns>
        public static byte[] GetControlMsg调频(double frequece)
        {
            var iFrequece = (int)(frequece * 10);
            byte[] commandSend = null;
            IStation.DataDockingSocket.ModBusRtuHelper.BuildSendMessage06(0x01, 20, 2, iFrequece, ref commandSend);
            return commandSend;
        }
        /// <summary>
        /// 获取查询指令(监控值)
@@ -127,6 +93,7 @@
        /// <returns></returns>
        public byte[] GetMonitorMsg监控值()
        {
            return new byte[] { 0x01, 0x03, 0x00, 0x19, 0x00, 0x19, 0x55, 0xC7 };
        }
@@ -140,6 +107,54 @@
        {
            return new byte[] { 0x01, 0x03, 0x00, 0x12, 0x00, 0x04, 0xE4, 0x0C };
        }
        /// <summary>
        /// 获取控制指令(开机)
        /// </summary>
        /// <returns></returns>
        public static byte[] GetControlMsg开机()
        {
            var appParas = GetAppParas();
            if (appParas == null || appParas.InstructionStartUp == null || appParas.InstructionStartUp.Content == null)
            {
                return BitTransfer.FromString("01-06-00-0F-00-01-78-09");
            }
            return BitTransfer.FromString(appParas.InstructionStartUp.Content);
        }
        /// <summary>
        /// 获取控制指令(关机)
        /// </summary>
        /// <returns></returns>
        public static byte[] GetControlMsg关机()
        {
            var appParas = GetAppParas();
            if (appParas == null || appParas.InstructionStartUp == null || appParas.InstructionStartUp.Content == null)
            {
                return BitTransfer.FromString("01-06-00-10-00-01-49-CF");
            }
            return BitTransfer.FromString(appParas.InstructionShutDown.Content);
        }
        /// <summary>
        /// 获取控制指令(调频)
        /// </summary>
        /// <returns></returns>
        public static byte[] GetControlMsg调频(double frequece)
        {
            var iFrequece = (int)(frequece * 10);
            byte[] commandSend = null;
            IStation.DataDockingSocket.ModBusRtuHelper.BuildSendMessage06(0x01, 20, 2,
                iFrequece, ref commandSend);
            return commandSend;
        }
        /// <summary>
@@ -456,7 +471,7 @@
        }
        #region MyRegion
        #region 数据转化
        private static int GetInt2Byte(byte[] byteMessage, int startPosition, out string info)
        {
            byte[] value = new byte[2];
Socket/IStation.DataDockingSocket4NT/paras_datadocking_socket_nt.json
@@ -13,10 +13,10 @@
    //}
  ],
  "InstructionStartUp": {
    "Content": "01-03-00-19-00-19-55-C7"
    "Content": "01-06-00-0F-00-01-78-09"
  },
  "InstructionShutDown": {
    "Content": "01-03-00-19-00-19-55-C7"
    "Content": "01-06-00-10-00-01-49-CF"
  },
  "Debug": true,
  "Src": true