Exemplo n.º 1
0
        public override void decodeReportMessage(ModbusMessage msg)//解码报告消息
        {
            String reportType = (String)msg.Data["ReportType"];

            if ("MDF_Current".Equals(reportType))
            {
                MDF_Current1 = double.Parse((String)msg.Data["MDF_Current1"]);
                MDF_Current2 = double.Parse((String)msg.Data["MDF_Current2"]);
                MDF_Current3 = double.Parse((String)msg.Data["MDF_Current3"]);
                MDF_Current4 = double.Parse((String)msg.Data["MDF_Current4"]);
            }
            if ("MDF".Equals(reportType))
            {
                String           Stackcode = (String)msg.Data["MDF_WhichStack"];
                String           Petricode = (String)msg.Data["MDF_WhichDish"];
                String           Barcode   = (String)msg.Data["MDF_BarCode"];
                MDFDispenMessage xinXi     = new MDFDispenMessage();
                xinXi.Stackcode = Stackcode;
                xinXi.Petricode = Petricode;
                xinXi.Barcode   = Barcode;
                lock (DispenMessages)
                {
                    DispenMessages.Add(xinXi);
                }
                lock (RefreshObject)
                {
                    needRefreshMessages = true;
                }
            }
        }
Exemplo n.º 2
0
        //解码报告消息
        public override void decodeReportMessage(ModbusMessage msg)
        {
            String reportType = (String)msg.Data["ReportType"];
            if ("MDF_Current".Equals(reportType))
            {

                MDF_Current1 = double.Parse((String)msg.Data["MDF_Current1"]);
                MDF_Current2 = double.Parse((String)msg.Data["MDF_Current2"]);
                MDF_Current3 = double.Parse((String)msg.Data["MDF_Current3"]);
                MDF_Current4 = double.Parse((String)msg.Data["MDF_Current4"]);
            }
            if ("MDF".Equals(reportType))
            {
                String Stackcode = (String)msg.Data["MDF_WhichStack"];
                String Petricode = (String)msg.Data["MDF_WhichDish"];
                String Barcode = (String)msg.Data["MDF_BarCode"];
                MDFDispenMessage xinXi = new MDFDispenMessage();
                xinXi.Stackcode = Stackcode;
                xinXi.Petricode = Petricode;
                xinXi.Barcode = Barcode;
                lock (DispenMessages)
                {
                    DispenMessages.Add(xinXi);
                }
                lock (RefreshObject)
                {
                    needRefreshMessages = true;
                }
            }
        }