From 9cc8fd11b13813adbdd3c6c31554e5c0bebf4026 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期五, 21 八月 2020 19:53:49 +0800
Subject: [PATCH] 发布到商店的版本

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
index bb9ce8a..46d1dd1 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
@@ -178,6 +178,10 @@
                     //灏嗙綉鍏崇殑鏁版嵁璁剧疆鍒版湰鍦扮紦瀛樹腑
                     this.SetGatewayDataToLocalMemmory(gateway, result);
                 }
+                if (gateway.HomeId == string.Empty)
+                {
+                    gateway.HomeId = Config.Instance.Home.Id;
+                }
                 return gateway;
             }
             catch (Exception ex)
@@ -659,6 +663,11 @@
                     ProgressBar.Close();
                     return false;
                 }
+            }
+            //鍒锋柊鍏ㄩ儴鍦烘櫙
+            if (this.IsMainGateway(realWay) == 1)
+            {
+                HdlSceneLogic.Current.RefreshSceneUIList(false);
             }
 
             //鑾峰彇鍏ㄩ儴璁惧
@@ -1520,7 +1529,7 @@
                     var tempWay = ZbGateway.GateWayList.Find(obj => (obj != null) && (obj.GwId == gateway.GwId));
                     if (tempWay == null)
                     {
-                        ZbGateway.GateWayList.Add(tempWay);
+                        ZbGateway.GateWayList.Add(gateway);
                     }
                 }
             }
@@ -1538,6 +1547,11 @@
         /// <returns></returns>
         public List<FirmwareVersionInfo> GetGatewayAllNewVersion(ZbGateway zbGateway, ShowErrorMode mode = ShowErrorMode.YES)
         {
+            //濡傛灉鏄睍绀烘ā鏉�,鎴栬�呮槸铏氭嫙浣忓畢鐨勮瘽,娌℃湁浠�涔堟柊鐗堟湰鐨勮娉�
+            if (Common.Config.Instance.Home.IsVirtually == true || Common.Config.Instance.Home.IsShowTemplate == true)
+            {
+                return new List<FirmwareVersionInfo> { null, null, null };
+            }
             //鑾峰彇缃戝叧鐗堟湰淇℃伅
             var result = this.GetGatewayInfo(zbGateway, false, mode);
             if (result == null)
@@ -1623,6 +1637,13 @@
         /// <returns></returns>
         public List<ZbGatewayData.DriveCodeObj> GetListVDDriveCode(ZbGateway zbGateway)
         {
+            //濡傛灉鏄睍绀烘ā鏉�,鎴栬�呮槸铏氭嫙浣忓畢鐨勮瘽,鐩存帴鍙栫紦瀛�
+            if (Common.Config.Instance.Home.IsVirtually == true || Common.Config.Instance.Home.IsShowTemplate == true)
+            {
+                //鍙栨湰鍦板璞�
+                var localgw = this.GetLocalGateway(zbGateway.GwId);
+                return localgw != null ? zbGateway.DriveCodeList : zbGateway.DriveCodeList;
+            }
             var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 505 } };
             var result = this.SendJobjectDataToGateway(zbGateway, "VirtualDrive/CatDriveCode", jObject.ToString(), "VirtualDrive/CatDriveCode_Respon");
             if (result.ErrorMsg != null)
@@ -1891,6 +1912,11 @@
                 }
                 return false;
             }
+            if (((decimal)Longitude) == 0 && ((decimal)Latitude) == 0)
+            {
+                //娌℃湁閰嶇疆杩囩粡绾害
+                return true;
+            }
 
             int result = -1;
             Action<string, string> action = (topic, message) =>

--
Gitblit v1.8.0