From 31497bb69602433d94c8a28ea01c3ee3c7cc8576 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 24 十月 2019 14:32:30 +0800
Subject: [PATCH] 完全合并了Wjc,Xm 的 代码

---
 ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs |   33 +++++++++++++++++++++++++++++----
 1 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs
index 99a78c5..5174ff6 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs
@@ -1,6 +1,8 @@
 锘縰sing System;
 using System.Collections.Generic;
 using Shared;
+using ZigBee.Device;
+
 namespace Shared.Phone.Device.Logic
 {
     public class LogicIfon
@@ -11,7 +13,7 @@
         /// </summary>
         /// <param name="common">Common.</param>
         /// <param name="objecttype">Objecttype.</param>
-        public static void AddDeviceconditions(ZigBee.Device.CommonDevice common, Dictionary<string, string> objecttype)
+        public static void AddDeviceconditions(CommonDevice common, Dictionary<string, string> objecttype)
         {
             for (int i = 0; i < Common.Logic.CurrentLogic.Conditions.Count; i++)
             {
@@ -19,9 +21,32 @@
                 {
                     if ((Common.Logic.CurrentLogic.Conditions[i]["MacAddr"] == common.DeviceAddr) && (Common.Logic.CurrentLogic.Conditions[i]["Epoint"] == common.DeviceEpoint.ToString()))
                     {
-                        Common.Logic.CurrentLogic.Conditions.RemoveAt(i);
-                        Common.Logic.CurrentLogic.Conditions.Insert(i, objecttype);
-                        return;
+                        if (common.Type == DeviceType.TemperatureSensor)//璁惧娓╁害浼犳劅鍣ㄦ湁鐐圭壒鍒�
+                        {
+                            var dev = common as TemperatureSensor;
+                            string str = "";
+                            if (dev.SensorDiv == 1)
+                            {
+                                str = "1026";
+                            }
+                            else
+                            {
+                                str = "1029";
+                            }
+                            if (Common.Logic.CurrentLogic.Conditions[i]["Cluster_ID"] == str)
+                            {
+                                Common.Logic.CurrentLogic.Conditions.RemoveAt(i);
+                                Common.Logic.CurrentLogic.Conditions.Insert(i, objecttype);
+                                return;
+                            }
+
+                        }
+                        else
+                        {
+                            Common.Logic.CurrentLogic.Conditions.RemoveAt(i);
+                            Common.Logic.CurrentLogic.Conditions.Insert(i, objecttype);
+                            return;
+                        }
                     }
 
                 }

--
Gitblit v1.8.0