Beispiel #1
0
 private void threadBean(LedTypeBean ledBean)
 {
     ledBean.ThreadLab = true;
     while (ledBean.LabVisiTime > 0 && !modelClose)
     {
         if (!ledBean.NodeReca && ledBean.Count < 5)
         {
             try
             {
                 Thread.Sleep(500);
                 if (!ledBean.NodeReca)
                 {
                     sendDataInLED(ledBean.SendByte, 0, "");
                     ledBean.Count++;
                     continue;
                 }
             }
             catch { }
         }
         ledBean.LabVisiTime -= 1;
         try
         {
             Thread.Sleep(1000);
         }
         catch { }
     }
     if (labVisi != null && !modelClose)
     {
         labVisi(ledBean.Type, false);
     }
     //threadComLab = false;
     ledBean.ThreadLab = false;
 }
Beispiel #2
0
        public LEDCONTROL_model()
        {
            receVeByteHandle = 0xfe;                         //接收包头
            receVeByteend    = 0xfd;                         //接收包尾
            comMode          = CommunicationMode.SERIALPORT; //是UDP通信,但是此处是为了处理多包功能

            comBean       = new LedTypeBean(1);
            sleepTimeBean = new LedTypeBean(2);
            GlBean        = new LedTypeBean(3);
        }