Exemple #1
0
 private void 手环测试_Load(object sender, EventArgs e)
 {
     Value.Run       = true;
     button1.Enabled = false;
     //   LoginIDE.Create();
     CITemp = new Value.CheckInfor();
 }
Exemple #2
0
        private string GetContextString(Value.CheckInfor CI)
        {
            string Temp;

            Temp  = CI.COMName + ",";
            Temp += CI.Date + ",";
            Temp += CI.MAC + ",";
            Temp += CI.SN + ",";
            Temp += CI.电量 + ",";
            Temp += CI.版本 + ",";
            Temp += CI.FlashID + ",";
            Temp += CI.Flash + ",";
            Temp += CI.GsensorID + ",";
            Temp += CI.Gsensor自检 + ",";
            Temp += CI.心率TIA + ",";
            Temp += CI.ADC + ",";
            Temp += CI.心率校验 + ",";
            Temp += CI.充电状态;
            return(Temp);
        }
Exemple #3
0
        private void 自动()
        {
            int i = 0, z = 0;

            if (Frits)
            {
                button3_Click(null, null);//初始化
                z     = WhileDo(1, 0);
                Frits = false;
            }
            SecCount = 0;
            A1 : button6_Click(null, null);//搜索
            z = WhileDo(2, 2);
            if (z > 0)
            {
                goto A1;
            }
            Thread.Sleep(200);
            A2 : button1_Click(null, null);//连接
            z = WhileDo(3, 2);
            z = WhileDo(3, 2);
            if (z > 0)
            {
                goto A2;
            }
            Thread.Sleep(2000);
            SendAT(Value.BLE测试);
            z = WhileDo(5, 2);
            if (z > 0)
            {
                goto A2;
            }
            Thread.Sleep(5000);
            SendAT(Value.BLE获取内容ff01);
            Thread.Sleep(1000);
            SendAT(Value.BLE获取内容ff0c);
            Thread.Sleep(1000);
            SendAT(Value.BLE获取内容ff03);
            Thread.Sleep(1000);
            SendAT(Value.BLE断开设备);
            Value.CheckInfor CI = Create.CreateInfor(CITemp.MAC, CITemp.版本, CITemp.电量, CITemp.Status, "0");
            CIWrite         = Create.CreateInfor(CITemp.MAC, CITemp.版本, CITemp.电量, CITemp.Status, "0");
            CIWrite.WriteOk = true;
            CI.RISS         = CITemp.RISS;
            BeginInvoke(new MethodInvoker(delegate()
            {
                button10.Text        = "自动";
                progressBar1.Maximum = 0;
                if (CI.Flash == "错误")
                {
                    panel6.BackColor = Color.Red;
                }
                else
                {
                    panel6.BackColor = Color.Green;
                }
                if (CI.GsensorID == "错误")
                {
                    panel7.BackColor = Color.Red;
                }
                else
                {
                    panel7.BackColor = Color.Green;
                }
                if (CI.Gsensor自检 == "错误")
                {
                    panel10.BackColor = Color.Red;
                }
                else
                {
                    panel10.BackColor = Color.Green;
                }
                if (CI.ADC == "错误")
                {
                    panel8.BackColor = Color.Red;
                }
                else
                {
                    panel8.BackColor = Color.Green;
                }
                if (CI.充电状态 == "连接")
                {
                    panel9.BackColor = Color.Red;
                }
                else
                {
                    panel9.BackColor = Color.Green;
                }
                label7.Text     = "MAC:" + CI.MAC;
                label8.Text     = "电量:" + CI.电量;
                label9.Text     = "信号:" + CI.RISS;
                button1.Enabled = true;
                timer2.Enabled  = false;
            }));
        }
Exemple #4
0
 public static Value.CheckInfor CreateInfor(string mac, string 版本, string 电量, byte Char, string 位号)
 {
     Value.CheckInfor CI = new Value.CheckInfor();
     CI.MAC = mac;
     CI.电量  = 电量;
     CI.版本  = 版本;
     CI.位号  = 位号;
     if ((Char & (byte)(1 << 0)) > 0)
     {
         CI.FlashID = "错误";
     }
     else
     {
         CI.FlashID = "正确";
     }
     if ((Char & (byte)(1 << 1)) > 0)
     {
         CI.Flash = "错误";
     }
     else
     {
         CI.Flash = "正确";
     }
     if ((Char & (byte)(1 << 2)) > 0)
     {
         CI.GsensorID = "错误";
     }
     else
     {
         CI.GsensorID = "正确";
     }
     if ((Char & (byte)(1 << 3)) > 0)
     {
         CI.Gsensor自检 = "错误";
     }
     else
     {
         CI.Gsensor自检 = "正确";
     }
     if ((Char & (byte)(1 << 4)) > 0)
     {
         CI.心率TIA = "错误";
     }
     else
     {
         CI.心率TIA = "正确";
     }
     if ((Char & (byte)(1 << 5)) > 0)
     {
         CI.ADC = "错误";
     }
     else
     {
         CI.ADC = "正确";
     }
     if ((Char & (byte)(1 << 6)) > 0)
     {
         CI.心率校验 = "错误";
     }
     else
     {
         CI.心率校验 = "正确";
     }
     if ((Char & (byte)(1 << 7)) > 0)
     {
         CI.充电状态 = "连接";
     }
     else
     {
         CI.充电状态 = "断开";
     }
     return(CI);
 }