Beispiel #1
0
        /// <summary>
        /// 记录发送到通道的数据到日志系统
        /// </summary>
        /// <param name="buffer"></param>
        protected void RecordSendDataToLog(string meterAddr, byte[] buffer, string socketHandle)
        {
            string serviceNo = System.Configuration.ConfigurationManager.AppSettings["CJServiceNo"];

            Log.Log.getInstance().Write(new Log.DTULogMsg(serviceNo, meterAddr, Log.DUTDataType.S, buffer));
            Log.Log.getInstance().Write(new Log.OneMeterDataLogMsg(meterAddr, string.Format("发送[{0}]-> ", socketHandle) + MyDataConvert.BytesToHexStr(buffer)));
        }
Beispiel #2
0
        /// <summary>
        /// 记录通道接收的数据到日志系统
        /// </summary>
        /// <param name="buffer"></param>
        protected void RecordRevDataToLog(string meterAddr, byte[] buffer, string socketHandle = "")
        {
            string serviceNo = ConfigurationManager.AppSettings["CJServiceNo"];

            //Console.WriteLine(string.Format("接收到主站发送的请求帧:{0}\r", MyDataConvert.BytesToHexStr(buffer)));
            Log.Log.getInstance().Write(new Log.DTULogMsg(serviceNo, meterAddr, Log.DUTDataType.R, buffer));
            Log.Log.getInstance().Write(new Log.OneMeterDataLogMsg(meterAddr, string.Format("接收[{0}]-> ", socketHandle) + MyDataConvert.BytesToHexStr(buffer)));
            //Console.WriteLine(string.Format("接收到主站发送的请求帧:{0}\r", MyDataConvert.BytesToHexStr(buffer)));
        }