示例#1
0
        //*/
        private void decodeReportMessage(ModbusMessage msg)//解码报告消息
        {
            String reportType = (String)msg.Data["ReportType"];

            if ("Currency".Equals(reportType))
            {
                MDF_Current1 = double.Parse((String)msg.Data["Currency1"]);
                MDF_Current2 = double.Parse((String)msg.Data["Currency2"]);
                MDF_Current3 = double.Parse((String)msg.Data["Currency3"]);
            }
            if ("ShenKongBan".Equals(reportType))
            {
                String         KongBanHao = (String)msg.Data["KongBanHao"];
                String         TiaoMaHao  = (String)msg.Data["TiaoMaHao"];
                FenZhuangXinXi xinXi      = new FenZhuangXinXi();
                xinXi.DuiMaHao  = KongBanHao;
                xinXi.TiaoMaHao = TiaoMaHao;
                lock (FenZhuangMessages)
                {
                    FenZhuangMessages.Add(xinXi);
                }
                lock (RefreshObject)
                {
                    needRefreshMessages = true;
                }
            }
            if ("PeiYangMin".Equals(reportType))
            {
                String         DuiMaHao      = (String)msg.Data["DuiMaHao"];
                String         PeiYangMinHao = (String)msg.Data["PeiYangMinHao"];
                String         TiaoMaHao     = (String)msg.Data["TiaoMaHao"];
                FenZhuangXinXi xinXi         = new FenZhuangXinXi();
                xinXi.DuiMaHao      = DuiMaHao;
                xinXi.PeiYangMinHao = PeiYangMinHao;
                xinXi.TiaoMaHao     = TiaoMaHao;
                lock (FenZhuangMessages)
                {
                    FenZhuangMessages.Add(xinXi);
                }
                lock (RefreshObject)
                {
                    needRefreshMessages = true;
                }
            }
        }
示例#2
0
 //解码报告消息
 //*/
 private void decodeReportMessage(ModbusMessage msg)
 {
     String reportType = (String)msg.Data["ReportType"];
     if ("Currency".Equals(reportType))
     {
         MDF_Current1 = double.Parse((String)msg.Data["Currency1"]);
         MDF_Current2 = double.Parse((String)msg.Data["Currency2"]);
         MDF_Current3 = double.Parse((String)msg.Data["Currency3"]);
     }
     if ("ShenKongBan".Equals(reportType))
     {
         String KongBanHao = (String)msg.Data["KongBanHao"];
         String TiaoMaHao = (String)msg.Data["TiaoMaHao"];
         FenZhuangXinXi xinXi = new FenZhuangXinXi();
         xinXi.DuiMaHao = KongBanHao;
         xinXi.TiaoMaHao = TiaoMaHao;
         lock (FenZhuangMessages)
         {
             FenZhuangMessages.Add(xinXi);
         }
         lock (RefreshObject)
         {
             needRefreshMessages = true;
         }
     }
     if ("PeiYangMin".Equals(reportType))
     {
         String DuiMaHao = (String)msg.Data["DuiMaHao"];
         String PeiYangMinHao = (String)msg.Data["PeiYangMinHao"];
         String TiaoMaHao = (String)msg.Data["TiaoMaHao"];
         FenZhuangXinXi xinXi = new FenZhuangXinXi();
         xinXi.DuiMaHao = DuiMaHao;
         xinXi.PeiYangMinHao = PeiYangMinHao;
         xinXi.TiaoMaHao = TiaoMaHao;
         lock (FenZhuangMessages)
         {
             FenZhuangMessages.Add(xinXi);
         }
         lock (RefreshObject)
         {
             needRefreshMessages = true;
         }
     }
 }