From f71e74b5f0d2716fbf05da016cdaa18d64e09f80 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期四, 31 十二月 2020 17:01:18 +0800
Subject: [PATCH] 又换完成最新门锁。空气质量传感器完成数据和基本配置功能。开发图表和自动化的同事可下载此代码

---
 ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs |   30 ++++++++++++++++++++++++------
 1 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
index f92d5a7..ee172c0 100644
--- a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
@@ -423,10 +423,10 @@
 
             nowSelectDeviceInfo = rowInfo;
             HdlThreadLogic.Current.RunMainInThread(() =>
-             {
-               //鍒濆鍖栬澶囧垪琛ㄦ帶浠�
-               this.InitListDeviceControls(listDeviceView, rowInfo, room);
-             });
+                    {
+                      //鍒濆鍖栬澶囧垪琛ㄦ帶浠�
+                      this.InitListDeviceControls(listDeviceView, rowInfo, room);
+                    });
           }
         };
 
@@ -526,6 +526,17 @@
           {
             cardContr = new Controls.DevicePmSensorRowControl();
           }
+          // 绌烘皵璐ㄩ噺浼犳劅鍣�
+          else if (device.Type == DeviceType.TemperatureSensor)
+          {
+            //鑾峰彇璁惧绫诲瀷
+            var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
+            //绌烘皵璐ㄩ噺浼犳劅鍣�
+            if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+            {
+              cardContr = new Controls.DeviceAirQualitySensorRowControl();
+            }
+          }
           //褰╃伅(璋冨厜鍣�)
           else if (device.Type == DeviceType.DimmableLight)
           {
@@ -587,6 +598,7 @@
         }
         HdlThreadLogic.Current.RunThread(() =>
               {
+                int sendCount = 0;
                 while (listView.Parent != null)
                 {
                   bool hadSend = false;
@@ -602,7 +614,7 @@
                       //鍙戦�佽幏鍙栫姸鎬佺殑鍛戒护
                       listContr[i].SendStatuComand();
                       hadSend = true;
-                      System.Threading.Thread.Sleep(200);
+                      System.Threading.Thread.Sleep(300);
                     }
                   }
                   if (hadSend == false)
@@ -610,7 +622,13 @@
                     //濡傛灉宸茬粡鍏ㄩ儴鍥炶矾閮芥帴鏀朵簡缃戝叧鍥炲,鍒欎笉鍐嶄簩娆″彂閫�
                     break;
                   }
-                  System.Threading.Thread.Sleep(2000);
+                  sendCount++;
+                  if (sendCount == 2)
+                  {
+                    //灏卞彂2娆�
+                    break;
+                  }
+                  System.Threading.Thread.Sleep(5000);
                 }
 
               }, ShowErrorMode.NO);

--
Gitblit v1.8.0