From 1f6f024bddf48dea1c17c54ade1535a10ef7b39b Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期一, 23 三月 2020 17:16:37 +0800
Subject: [PATCH] 2020-03-23-2

---
 ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs |   40 +++++++++++++++++++++++++++++-----------
 1 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
index d3feb0d..713effb 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using System.Text;
 using Newtonsoft.Json.Linq;
 
@@ -19,13 +18,15 @@
         /// <param name="flage">If set to <c>true</c> flage.</param>
         public static void DebugPrintLog(string msg, bool flage = true)
         {
+#if DEBUG
             if (flage == true)
             {
-                //if (msg.Contains("DeviceStatusReport") == false)
-                //{
-                System.Console.WriteLine(msg);
-                //}
+                if (msg.Contains("DeviceStatusReport") == false)
+                {
+                    System.Console.WriteLine(msg + "  " + System.DateTime.Now.ToLongTimeString() + " " + System.DateTime.Now.Millisecond);
+                }
             }
+#endif
         }
 
         /// <summary>
@@ -163,6 +164,10 @@
             else if (strDeviceType == ZigBee.Device.DeviceType.DoorLock.ToString())
             {
                 return Newtonsoft.Json.JsonConvert.DeserializeObject<DoorLock>(strDeviceByte);
+            }
+            else if (strDeviceType == ZigBee.Device.DeviceType.TemperatureSensor.ToString())
+            {
+                return Newtonsoft.Json.JsonConvert.DeserializeObject<TemperatureSensor>(strDeviceByte);
             }
             return null;
         }
@@ -208,12 +213,12 @@
                 else if (this.Type == DeviceType.ColorDimmableLight)
                 {
                     //褰╃伅
-                    IconPath = "Device/ColorDimmableLight.png";
+                    IconPath = "Device/ColorLight.png";
                 }
                 else if (this.Type == DeviceType.DimmableLight)
                 {
                     //璋冨厜鍣�
-                    IconPath = "Device/ColorDimmableLight.png";
+                    IconPath = "Device/Light.png";
                 }
                 else if (this.Type == DeviceType.OnOffOutput)
                 {
@@ -225,12 +230,25 @@
                     //绌鸿皟
                     IconPath = "Device/AirConditionerEpoint.png";
                 }
+                else if (this.Type == DeviceType.TemperatureSensor)
+                {
+                    if (((TemperatureSensor)this).SensorDiv == 1)
+                    {
+                        //娓╁害浼犳劅鍣�
+                        IconPath = "Device/SensorTemperature.png";
+                    }
+                    else if (((TemperatureSensor)this).SensorDiv == 2)
+                    {
+                        //婀垮害浼犳劅鍣�
+                        IconPath = "Device/SensorHumidity.png";
+                    }
+                }
                 else if (this.Type != DeviceType.UnKown)
                 {
                     //鍏朵粬鐨勫浘鏍囨湁鐐圭壒娈�
                     string unSelectPic = string.Empty;
                     string selectPic = string.Empty;
-                    Shared.Common.LocalDevice.Current.GetDeviceBeloneIcon(new List<CommonDevice> { this }, ref unSelectPic, ref selectPic);
+                    Shared.Common.LocalDevice.Current.GetDeviceObjectIcon(new List<CommonDevice> { this }, ref unSelectPic, ref selectPic);
                     IconPath = unSelectPic;
                 }
                 Shared.Common.Global.WriteFileByBytesByHomeId(FilePath, System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)));
@@ -276,9 +294,9 @@
         /// </summary>
         public DeviceType Type = DeviceType.UnKown;
         /// <summary>
-        /// 璁惧鐨勫姛鑳界被鍨�(姝ょ被鍨嬬洰鍓嶅彧閽堝缁х數鍣ㄥ洖璺湁鏁�,榛樿涓虹伅鍏�)
+        /// 璁惧鐨勫姛鑳界被鍨�(姝ょ被鍨嬬洰鍓嶅彧閽堝缁х數鍣ㄥ洖璺湁鏁�,榛樿鏈寚瀹�)
         /// </summary>
-        public DeviceFunctionType DfunctionType = DeviceFunctionType.A鐏厜;
+        public DeviceFunctionType DfunctionType = DeviceFunctionType.A鏈畾涔�;
         /// <summary>
         /// MAC鍦板潃
         /// </summary>
@@ -984,7 +1002,7 @@
             /// <summary>
             /// 璁惧鎵�鍦ㄧ綉鍏崇殑缃戝叧id
             /// </summary>
-            public int GwId;
+            public string GwId;
             /// <summary>
             /// 璁惧鍚�
             /// </summary>

--
Gitblit v1.8.0