From c0021397eeb8335d6d1f20990c71533c3d94e7af Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期五, 10 一月 2020 17:02:38 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev-tzy' into DEV_GXC --- ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs | 53 +++++++++++++++++++++++++++++------------------------ 1 files changed, 29 insertions(+), 24 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs index e879acf..6edaca7 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs @@ -266,31 +266,36 @@ } //杩欓噷涓昏鍙槸鑾峰彇鍦ㄧ嚎鐘舵�� var zbway = HdlGatewayLogic.Current.GetLocalGateway(listGwId[i]); - var result = Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, (device) => - { - string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device); - if (listView.Parent == null || dicData.ContainsKey(mainkeys) == false || listCheck.Contains(mainkeys) == true) - { - return; - } - listCheck.Add(mainkeys); + int statu = 0; + var list = Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, ref statu, false, ShowErrorMode.NO); + if (statu != -1) + { + HdlThreadLogic.Current.RunMain(() => + { + for (int j = 0; j < list.Count; j++) + { + string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(list[i]); + if (listView.Parent == null || dicData.ContainsKey(mainkeys) == false || listCheck.Contains(mainkeys) == true) + { + return; + } + listCheck.Add(mainkeys); - var localDevice = Common.LocalDevice.Current.GetDevice(mainkeys); - if (localDevice != null && localDevice.IsOnline != device.IsOnline) - { - //鍦ㄧ嚎鐘舵�佷竴鏍风殑璇濓紝涓嶉渶瑕佸埛鏂� - localDevice.IsOnline = device.IsOnline; - localDevice.ReSave(); - } - if (device.IsOnline == 1) - { - HdlThreadLogic.Current.RunMain(() => - { - dicData[mainkeys].OnlineCount += 1; - dicData[mainkeys].btnOnline.Text = dicData[mainkeys].OnlineCount + "/" + dicData[mainkeys].listDeviceKeys.Count; - }); - } - }, ShowErrorMode.NO); + var localDevice = Common.LocalDevice.Current.GetDevice(mainkeys); + if (localDevice != null && localDevice.IsOnline != list[i].IsOnline) + { + //鍦ㄧ嚎鐘舵�佷竴鏍风殑璇濓紝涓嶉渶瑕佸埛鏂� + localDevice.IsOnline = list[i].IsOnline; + localDevice.ReSave(); + } + if (list[i].IsOnline == 1) + { + dicData[mainkeys].OnlineCount += 1; + dicData[mainkeys].btnOnline.Text = dicData[mainkeys].OnlineCount + "/" + dicData[mainkeys].listDeviceKeys.Count; + } + } + }); + } } }); } -- Gitblit v1.8.0