From 9ef48d7b2da7c408b53f73be0f6eef3cbac1c84a Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 19 十一月 2020 10:23:45 +0800
Subject: [PATCH] Evoyo.Home1.1.0120111601_Release

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs |   37 +++++++++++++++++++++----------------
 1 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
index 899ed8e..83fbee8 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
@@ -261,7 +261,7 @@
                 btnPosition.ButtonClickEvent += (sender, e) =>
                 {
                     //瀹氫綅
-                    Common.LocalDevice.Current.SetFixedPositionCommand(listdevice[0]);
+                    Common.LocalDevice.Current.SetFixedPositionCommand(listdevice[0], true);
                 };
             }
 
@@ -309,7 +309,7 @@
                     return;
                 }
                 var listMacDevice = LocalDevice.Current.GetDevicesByMac(deviceMac, false);
-                if (LocalDevice.Current.IsMiniLight(listMacDevice[0]) == true)
+                if (listMacDevice.Count > 0 && LocalDevice.Current.IsMiniLight(listMacDevice[0]) == true)
                 {
                     //mini澶滅伅鐨勫姛鑳借缃晫闈�
                     var room = HdlRoomLogic.Current.GetRoomByDevice(listMacDevice[0]);
@@ -710,7 +710,7 @@
             }
             //濡傛灉鏄湪绾跨殑
             var nowGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.NowSelectGatewayId);
-            if (HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(nowGateway) == true)
+            if (HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(nowGateway) == true)
             {
                 //妫�娴嬪箍鎾埌鐨勮繖涓綉鍏虫槸鍚︽嫢鏈変綇瀹匢D
                 ZbGateway realWay = null;
@@ -726,6 +726,11 @@
                         ProgressBar.Close();
                         if (result2 == -1)
                         {
+                            HdlThreadLogic.Current.RunMain(() =>
+                            {
+                                //闅愯棌涓嬫媺鍒锋柊鐗规晥
+                                listView.EndHeaderRefreshing();
+                            });
                             return;
                         }
                     }
@@ -737,7 +742,7 @@
             }
 
             //鑾峰彇鍏ㄩ儴璁惧
-            int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(nowGateway, false);
+            int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(nowGateway.GwId, false);
             if (this.Parent == null)
             {
                 return;
@@ -778,7 +783,7 @@
                 {
                     if (this.gatewayViewRow != null && this.gatewayViewRow.zbGatewayId == selectGwId)
                     {
-                        bool online = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbGateway);
+                        bool online = HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(zbGateway);
                         //鍒锋柊鎺т欢鍦ㄧ嚎鐘舵��
                         this.gatewayViewRow?.RefreshOnlineStatu();
                         //鏍规嵁缃戝叧鍦ㄧ嚎鐘舵�佸埛鏂拌澶囧湪绾跨姸鎬�
@@ -974,10 +979,10 @@
                         return;
                     }
                     //娣诲姞鍗囩骇鍥轰欢淇℃伅(鎴愪笉鎴愬姛閮芥棤鎵�璋�)
-                    var result = HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.ZigbeeDevice, ota.HwVersion.ToString(), ota.ImgTypeId.ToString());
+                    var result = HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.A璁惧, ota.HwVersion.ToString(), ota.ImgTypeId.ToString());
 
                     //鑾峰彇璁惧鏈�鏂扮増鏈�
-                    var deviceFirmware = HdlFirmwareUpdateLogic.GetFirmwareMostVersionInfo(FirmwareLevelType.ZigbeeDevice,
+                    var deviceFirmware = HdlFirmwareUpdateLogic.GetFirmwareMostVersionInfo(FirmwareLevelType.A璁惧,
                         ota.HwVersion.ToString(),
                         ota.ImgTypeId.ToString(),
                         ota.ImgVersion);
@@ -1219,9 +1224,9 @@
             /// </summary>
             private NormalViewControl btnName = null;
             /// <summary>
-            /// 鍦ㄧ嚎鐘舵��
+            /// 鍦ㄧ嚎鐘舵��(鍒濆鐘舵�佷负鍦ㄧ嚎)
             /// </summary>
-            public bool isOnline = false;
+            public bool isOnline = true;
 
             /// <summary>
             /// 鑷畾涔夌綉鍏虫帶浠�
@@ -1266,11 +1271,11 @@
                 {
                     btnName.Text = HdlGatewayLogic.Current.GetGatewayName(zbway);
                     //鍦ㄧ嚎鐘舵��
-                    this.isOnline = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbway);
-                    if (this.isOnline == false)
-                    {
-                        btnName.TextColor = UserCenterColor.Current.TextGrayColor1;
-                    }
+                    //this.isOnline = HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(zbway);
+                    //if (this.isOnline == false)
+                    //{
+                    //    btnName.TextColor = UserCenterColor.Current.TextGrayColor1;
+                    //}
                 }
                 else
                 {
@@ -1335,7 +1340,7 @@
                     return;
                 }
                 //鍦ㄧ嚎鐘舵��
-                bool statu = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbway);
+                bool statu = HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(zbway);
                 if (this.isOnline != statu)
                 {
                     this.isOnline = statu;
@@ -1392,7 +1397,7 @@
                 btnName.Height = Application.GetRealHeight(60);
                 btnName.TextSize = 15;
                 btnName.Y = Application.GetRealHeight(57);
-                btnName.Text = "灏忓害灏忓害";
+                btnName.Text = "鏅鸿兘闊崇";
 
                 this.AddRightArrow();
                 this.AddMostRightView("", 300, false).Name = "smartSoundLayout";

--
Gitblit v1.8.0