コード例 #1
0
        public ClsQCTDEVICEBF(ClsCommunication comm, string sex, string age, string height, int bfHour, int bfMinu)
        {
            base.m_Comm       = comm;
            base.m_delay      = 0xbb8;
            this.m_Bhour      = bfHour;
            this.m_Bminu      = bfMinu;
            this.bSex         = Convert.ToByte(sex);
            this.bAge         = Convert.ToByte(age);
            this.bHeight      = Convert.ToByte(height);
            this.CommandWrite = new byte[11];
            DateTime now = DateTime.Now;
            byte     num = (this.bSex != 1) ? ((byte)0) : Convert.ToByte((sbyte)(-128));

            this.CommandWrite[0]  = 170;
            this.CommandWrite[1]  = 10;
            this.CommandWrite[2]  = 0x53;
            this.CommandWrite[3]  = 11;
            this.CommandWrite[4]  = 0;
            this.CommandWrite[5]  = (byte)(this.bAge + num);
            this.CommandWrite[6]  = this.bHeight;
            this.CommandWrite[7]  = 1;
            this.CommandWrite[8]  = Convert.ToByte(now.Hour);
            this.CommandWrite[9]  = Convert.ToByte(now.Minute);
            this.CommandWrite[10] = (byte)(((((0xf8 ^ this.CommandWrite[5]) ^ this.CommandWrite[6]) ^ 1) ^ this.CommandWrite[8]) ^ this.CommandWrite[9]);
        }
コード例 #2
0
        public string GetClsCommunicationBP(string com, int baudRate, string deviceName)
        {
            try
            {
                this.m_communicationBP = new ClsCommunicationCom(this.GetOs(), com, baudRate);

                return(deviceName);
            }
            catch (Exception e)
            {
                this.m_communicationBP = null;
            }

            return("");
        }
コード例 #3
0
        public string GetClsCommunicationBM_N(string com, int baudRate, string deviceName)
        {
            try
            {
                this.m_communicationBM_N = new ClsCommunicationCom(this.GetOs(), com, baudRate);

                return(deviceName);
            }
            catch (Exception e)
            {
                //WritelogInfo("99.2." + e.Message);
                this.m_communicationBM_N = null;
            }

            return("");
        }
コード例 #4
0
        public ClsTransInfo(string portType)
        {
            if (portType.ToUpper() == "BLUE")
            {
                this.m_communicationHEM = new ClsCommunicationBlue(this.GetOs());
            }
            else if (portType.ToUpper().StartsWith("COM"))
            {
                this.m_communicationHEM = new ClsCommunicationBlue(this.GetOs());

                if (this.m_communicationBM != null)
                {
                    this.m_communicationBM.DataExchange += new TransMessageHandle(this.m_communication_DataExchange);
                }

                if (this.m_communicationBG != null)
                {
                    this.m_communicationBG.DataExchange += new TransMessageHandle(this.m_communication_DataExchange);
                }

                if (this.m_communicationBP != null)
                {
                    this.m_communicationBP.DataExchange += new TransMessageHandle(this.m_communication_DataExchange);
                }

                if (this.m_communicationHEM != null)
                {
                    this.m_communicationHEM.DataExchange += new TransMessageHandle(this.m_communication_DataExchange);
                }

                if (this.m_communicationUI != null)
                {
                    this.m_communicationUI.DataExchange += new TransMessageHandle(this.m_communication_DataExchange);
                }

                if (this.m_communication != null)
                {
                    this.m_communication.DataExchange += new TransMessageHandle(this.m_communication_DataExchange);
                }

                if (this.m_communicationBT != null)
                {
                    this.m_communicationBT.DataExchange += new TransMessageHandle(this.m_communication_DataExchange);
                }
            }
        }
コード例 #5
0
 public ClsQCTDEVICEBC(ClsCommunication comm)
 {
     base.m_Comm = comm;
 }
コード例 #6
0
 public ClsFMDDEVICEBP(ClsCommunication comm)
 {
     base.m_Comm  = comm;
     base.m_delay = 0xbb8;
 }
コード例 #7
0
 public ClsALKDEVICETF(ClsCommunication comm)
 {
     base.m_Comm  = comm;
     base.m_delay = 5000;
 }
コード例 #8
0
        /// <summary>
        /// 血压计
        /// </summary>
        public void ThreadExectueBP()
        {
            string str = "";

Label_0000:

            this.m_communicationBP = null;
            str = GetClsCommunicationBP(ConfigurationManager.AppSettings["CHITBP"], 9600, ConfigurationManager.AppSettings["TFDeviceName"]);

            if (str == "")
            {
                this.m_DeviceBP = null;
                Thread.Sleep(200);
                goto Label_0000;
            }

            try
            {
                //this.m_communicationBM = new ClsCommunicationCom(this.GetOs(), com, baudRate);

                if (this.m_communicationBP != null)
                {
                    this.m_communicationBP.DataExchange += new TransMessageHandle(this.m_communication_DataExchange);
                }

                this.m_DeviceBP = ClsDeviceFactory.CreateDevice(this.m_communicationBP, str, sex, age, height, m_BFHour, m_BFMinu);

                if (this.m_DeviceBP != null)
                {
                    if (ReadMode)
                    {
                        ClsResult.ResultFlag = false;
                        Thread.Sleep(1000);
                        this.SendMsg("CONNECT" + str);

                        this.m_communicationBP.StartDeviceListen();

                        if (this.m_DeviceBP.ExecQuery())
                        {
                            if (ClsResult.ResultFlag == true)
                            {
                                this.m_DeviceBP.ExecClose();

                                this.m_communicationBP.WriteDataLog();
                                this.SendMsg("TRANSEND");
                                Thread.Sleep(500);
                            }
                        }
                        else
                        {
                            this.m_communicationBP.WriteDataLog();
                            this.SendMsg("ERROR");
                        }
                    }
                    else
                    {
                        this.m_DeviceBP.ExecClose();
                    }
                }
                else
                {
                    this.SendMsg("UNKNOWN" + str);
                }

                if (this.m_DeviceBP != null)
                {
                    if (ClsResult.ResultFlag == true)
                    {
                        Thread.Sleep(this.m_DeviceBP.m_delay);
                    }
                }
                else
                {
                    Thread.Sleep(3000);
                }

                this.m_communicationBP.Disconnect();
                this.m_communicationBP.StopHardListen();

                if (ClsResult.ResultFlag == true)
                {
                    Thread.Sleep(1000);
                }

                goto Label_0000;
            }
            catch (Exception ex)
            {
                goto Label_0000;
            }
        }
コード例 #9
0
        /// <summary>
        /// 电子称-新
        /// </summary>
        public void ThreadExectueBM_N()
        {
            string str = "";

Label_0000:

            this.m_communicationBM_N = null;

            str = GetClsCommunicationBM_N(ConfigurationManager.AppSettings["CHITBM"], 115200, "CHITBM_N");
            bool getResult = false;

            if (str == "")
            {
                WritelogInfo("1.str=''");
                this.m_DeviceBM_N = null;

                System.Windows.Forms.Application.DoEvents();
                Thread.Sleep(200);
                goto Label_0000;
            }

            try
            {
                if (this.m_communicationBM_N != null)
                {
                    this.m_communicationBM_N.DataExchange += new TransMessageHandle(this.m_communication_DataExchange);
                }

                if (this.m_DeviceBM_N == null)
                {
                    this.m_DeviceBM_N = ClsDeviceFactory.CreateDevice(this.m_communicationBM_N, str, sex, age, height, m_BFHour, m_BFMinu);
                }

                if (this.m_DeviceBM_N != null)
                {
                    if (ReadMode)
                    {
                        ClsResult.ResultFlag = false;
                        //this.SendMsg("CONNECT" + str);

                        this.m_communicationBM_N.StartDeviceListen();

                        if (this.m_DeviceBM_N.ExecQuery())
                        {
                            if (ClsResult.ResultFlag == true)
                            {
                                WritelogInfo("2.ResultFlag == true");
                                getResult = true;

                                this.m_communicationBM_N.WriteDataLog();
                                this.SendMsg("TRANSEND");
                                WritelogInfo("TRANSEND:" + ClsResult.DeviceValue.QCTBM.TiZhong);
                                //Thread.Sleep(500);
                                System.Windows.Forms.Application.DoEvents();
                            }
                        }
                        else
                        {
                            WritelogInfo("3.m_DeviceBM_N.ExecQuery()=false");
                            this.m_communicationBM_N.WriteDataLog();
                            this.SendMsg("ERROR");

                            //Thread.Sleep(500);
                            System.Windows.Forms.Application.DoEvents();

                            this.m_DeviceBM_N.ExecClose();
                        }
                    }

                    if (ClsResult.ResultFlag == true)
                    {
                        WritelogInfo("4.this.m_DeviceBM_N.m_delay");
                        Thread.Sleep(this.m_DeviceBM_N.m_delay);
                    }
                }
                else
                {
                    Thread.Sleep(200);

                    WritelogInfo("5.this.m_DeviceBM_N =null");
                }

                this.m_communicationBM_N.Disconnect();
                this.m_communicationBM_N.StopHardListen();
                System.Windows.Forms.Application.DoEvents();

                goto Label_0000;
            }
            catch (Exception ex)
            {
                WritelogInfo("99." + ex.Message + ex.StackTrace);
                goto Label_0000;
            }
        }
コード例 #10
0
        public static ClsQCTDevice CreateDevice(ClsCommunication comm, string devicename, string sex, string age, string height, int m_BFHour, int m_BFMinu)
        {
            //µ¥µ¼Ðĵç
            if (devicename.StartsWith("QCTBE"))
            {
                return(new ClsQCTDEVICEBE(comm));
            }

            //ÈËÌå³É·Ö
            if (devicename.StartsWith("QCTBF"))
            {
                return(new ClsQCTDEVICEBF(comm, sex, age, height, m_BFHour, m_BFMinu));
            }

            //ѪÌÇ
            if (devicename.StartsWith("QCTBG"))
            {
                return(new ClsQCTDEVICEBG(comm));
            }

            //Ѫѹ
            if (devicename.StartsWith("QCTBP") && !devicename.StartsWith("QCTBPT"))
            {
                return(new ClsQCTDEVICEBP(comm));
            }

            //Ѫѹ
            if (devicename.StartsWith("Fmd"))
            {
                return(new ClsFMDDEVICEBP(comm));
            }

            //Ѫѹ
            if (devicename.StartsWith("CHITBP"))
            {
                return(new ClsCHITDEVICEBP(comm));
            }

            //Ѫѹ
            if (devicename.StartsWith("QCRBP"))
            {
                return(new ClsCHITDEVICEBPR(comm));
            }

            //¶îÎÂ
            if (devicename.StartsWith("ALKTF"))
            {
                return(new ClsALKDEVICETF(comm));
            }

            //¶îÎÂ
            if (devicename.StartsWith("QCATF"))
            {
                return(new ClsALKDEVICETF(comm));
            }

            //¶îÎÂ
            if (devicename.StartsWith("QCTTF"))
            {
                return(new ClsQCTDEVICETF(comm));
            }

            //ѪÌÇ
            if (devicename.StartsWith("CHITBG"))
            {
                return(new ClsCHITDEVICEBG(comm));
            }

            // ÐÂÌåÖØ
            if (devicename.StartsWith("CHITBM_N"))
            {
                return(new ClsQCTDEVICEBM_N(comm));
            }

            //ÌåÖØ
            if (devicename.StartsWith("CHITBM"))
            {
                return(new ClsCHITDEVICEBM(comm));
            }

            //ÌåÖØ
            if (devicename.StartsWith("QCABM"))
            {
                return(new ClsQCTDEVICEBM(comm));
            }

            //ÄòÒº·ÖÎö
            if (devicename.StartsWith("EMPUI"))
            {
                return(new ClsEMPDEVICEUI(comm));
            }

            //ѪѹѪÑõÒ»Ìå»ú
            if (devicename.StartsWith("QCTBPT"))
            {
                return(new ClsQCTDEVICEBPT(comm));
            }

            //ѪÑõ
            if (devicename.StartsWith("QCTBT"))
            {
                return(new ClsQCTDEVICEBT(comm));
            }

            //ѪҺ
            if (devicename.StartsWith("QCTBU"))
            {
                return(new ClsQCTDEVICEBU(comm));
            }

            //ÌåÖØ
            if (devicename.StartsWith("QCTBM"))
            {
                return(new ClsQCTDEVICEBW(comm));
            }

            //ÌåÖØ
            if (devicename.StartsWith("QCTBM"))
            {
                return(new ClsQCTDEVICEBM(comm));
            }

            //ÌåÎÂ
            if (devicename.StartsWith("QCTTF"))
            {
                return(new ClsQCTDEVICETF(comm));
            }

            //ÄòÒº·ÖÎö
            if (devicename.StartsWith("QCTUI"))
            {
                return(new ClsQCTDEVICEUI(comm));
            }

            //ÄòÒº·ÖÎö
            if (devicename.StartsWith("QCTUR"))
            {
                return(new ClsQCTDEVICEUR(comm));
            }

            //Éí¸ß
            if (devicename.StartsWith("QCTBH"))
            {
                return(new ClsQCTDEVICEBH(comm));
            }

            //×ÛºÏÊý¾Ý²É¼¯ÒÇ
            if (devicename.StartsWith("QCTBC"))
            {
                return(new ClsQCTDEVICEBC(comm));
            }

            //:Èü¶û¸£ÐĵçÊý¾Ý½»»¥
            if (devicename.StartsWith("QCTSE"))
            {
                return(new ClsQCTDEVICESE(comm));
            }

            //ѪÉú»¯
            if (devicename.StartsWith("QCTPA"))
            {
                return(new ClsQCTDeviceComBU(comm));
            }

            //Ѫѹ
            if (devicename.StartsWith("HEM"))
            {
                return(new ClsQCTDeviceHEM(comm));
            }

            //ѪÑõ
            if (devicename.StartsWith("DT-806"))
            {
                return(new ClsQCTDeviceDT(comm));
            }

            return(null);
        }
コード例 #11
0
 public ClsQCTDEVICEBG(ClsCommunication comm)
 {
     base.m_Comm  = comm;
     base.m_delay = 10000;
 }
コード例 #12
0
 public ClsQCTDEVICEBM(ClsCommunication comm)
 {
     base.m_Comm  = comm;
     base.m_delay = 0x3e8;
 }
コード例 #13
0
 public ClsQCTDeviceDT(ClsCommunication comm)
 {
     base.m_Comm  = comm;
     base.m_delay = 0x1388;
 }
コード例 #14
0
 public ClsCHITDEVICEBM(ClsCommunication comm)
 {
     base.m_Comm  = comm;
     base.m_delay = 5000;
 }
コード例 #15
0
 public ClsQCTDEVICEBM_N(ClsCommunication comm)
 {
     base.m_Comm  = comm;
     base.m_delay = 200;
 }
コード例 #16
0
 public ClsEMPDEVICEUI(ClsCommunication comm)
 {
     base.m_Comm  = comm;
     base.m_delay = 20000;
 }
コード例 #17
0
 public ClsQCTDeviceHEM(ClsCommunication comm)
 {
     base.m_Comm  = comm;
     base.m_delay = 10000;
 }
コード例 #18
0
 public ClsQCTDeviceComBU(ClsCommunication comm)
 {
     this.m_ResultStr = "";
     base.m_Comm      = comm;
     base.m_delay     = 0xbb8;
 }
コード例 #19
0
 public ClsQCTDEVICEUI(ClsCommunication comm)
 {
     base.m_Comm  = comm;
     base.m_delay = 0xbb8;
 }
コード例 #20
0
        /// <summary>
        /// 电子称
        /// </summary>
        public void ThreadExectueBM()
        {
            string str = "";

Label_0000:

            this.m_communicationBM = null;
            str = GetClsCommunicationBM(ConfigurationManager.AppSettings["CHITBM"], 4800, ConfigurationManager.AppSettings["TFDeviceName"]);
            bool getResult = false;

            if (str == "")
            {
                this.m_DeviceBM = null;
                Thread.Sleep(200);
                goto Label_0000;
            }

            try
            {
                //this.m_communicationBM = new ClsCommunicationCom(this.GetOs(), com, baudRate);

                if (this.m_communicationBM != null)
                {
                    this.m_communicationBM.DataExchange += new TransMessageHandle(this.m_communication_DataExchange);
                }

                this.m_DeviceBM = ClsDeviceFactory.CreateDevice(this.m_communicationBM, str, sex, age, height, m_BFHour, m_BFMinu);

                if (this.m_DeviceBM != null)
                {
                    if (ReadMode)
                    {
                        ClsResult.ResultFlag = false;
                        Thread.Sleep(1000);
                        this.SendMsg("CONNECT" + str);

                        this.m_communicationBM.StartDeviceListen();

                        if (this.m_DeviceBM.ExecQuery())
                        {
                            //if (!str.StartsWith("QCTBF") || (ClsResult.DeviceMsg != "参数设置已经完成,请进行测量."))
                            //{
                            if (ClsResult.ResultFlag == true)
                            {
                                getResult = true;
                                //this.m_DeviceBM.ExecClose();

                                this.m_communicationBM.WriteDataLog();
                                this.SendMsg("TRANSEND");
                                Thread.Sleep(500);
                            }
                            //}
                        }
                        else
                        {
                            this.m_communicationBM.WriteDataLog();
                            this.SendMsg("ERROR");
                        }
                    }
                    else
                    {
                        this.m_DeviceBM.ExecClose();
                    }

                    if (ClsResult.ResultFlag == true)
                    {
                        Thread.Sleep(this.m_DeviceBM.m_delay);
                    }
                }
                else
                {
                    this.SendMsg("UNKNOWN" + str);
                    Thread.Sleep(1000);
                }

                this.m_communicationBM.Disconnect();
                this.m_communicationBM.StopHardListen();

                if (ClsResult.ResultFlag == true)
                {
                    Thread.Sleep(500);
                }

                goto Label_0000;
            }
            catch (Exception ex)
            {
                goto Label_0000;
            }
        }