From 9a4b76398009cf76c508d61f7e48fb6f5cb7ac2d Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期二, 21 七月 2020 09:46:53 +0800
Subject: [PATCH] 请合并最新多功能面板代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs |   94 +++++++++++++++++++++++++++--------------------
 1 files changed, 54 insertions(+), 40 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
index 25ec696..ce4b49b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
@@ -106,8 +106,51 @@
             rowBeloneArea.SelectRoomEvent += (roomKeys) =>
             {
                 //鍙樻洿缃戝叧鎴块棿
-                HdlGatewayLogic.Current.ChangedGatewayRoom(this.zbGateway, roomKeys);
+                HdlGatewayLogic.Current.ChangedGatewayRoom(this.zbGateway.GwId, roomKeys);
             };
+
+            //鎵�灞炰綇瀹�
+            caption = Language.StringByID(R.MyInternationalizationString.uBelongResidence);
+            var btnBeloneArea = new FrameCaptionViewControl(caption, Common.Config.Instance.Home.Name, listview.rowSpace / 2);
+            btnBeloneArea.UseClickStatu = false;
+            listview.AddChidren(btnBeloneArea);
+            btnBeloneArea.InitControl();
+            //鍒掔嚎
+            btnBeloneArea.AddBottomLine();
+
+            //mini缃戝叧鏈変釜鍔熻兘璁剧疆
+            var linuxImageType = this.zbGateway.LinuxImageType;
+            if (linuxImageType == 11)
+            {
+                var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(this.zbGateway.GwId);
+                CommonDevice miniDevice = null;
+                foreach (var device in listDevice)
+                {
+                    //鑾峰彇杩欎釜缃戝叧涓嬬殑灏忓鐏澶�
+                    if (Common.LocalDevice.Current.IsMiniLight(device) == true)
+                    {
+                        miniDevice = device;
+                        break;
+                    }
+                }
+                //濡傛灉鎵惧緱鍒扮殑璇�
+                if (miniDevice != null)
+                {
+                    //鍔熻兘璁剧疆
+                    var rowFunction = new RowLayoutControl(listview.rowSpace / 2);
+                    listview.AddChidren(rowFunction);
+                    rowFunction.frameTable.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uFunctionSettingUp), 700);
+                    //鍙冲浘鏍�
+                    rowFunction.frameTable.AddRightArrow();
+                    //搴曠嚎
+                    rowFunction.frameTable.AddBottomLine();
+                    rowFunction.frameTable.ButtonClickEvent += (sender, e) =>
+                    {
+                        var form = new DeviceLight.MiniNightLightFunctionSettionForm();
+                        form.AddForm(miniDevice);
+                    };
+                }
+            }
 
             //鏁版嵁涓婁紶涓庝笅杞�
             var rowData = new RowLayoutControl(listview.rowSpace / 2);
@@ -120,7 +163,7 @@
             rowData.frameTable.ButtonClickEvent += (sender, e) =>
             {
                 var form = new GatewayUploadAndDownLoadForm();
-                form.AddForm(HdlGatewayLogic.Current.GetGatewayId(this.zbGateway));
+                form.AddForm(this.zbGateway.GwId);
             };
 
             //閫氱敤淇℃伅
@@ -151,7 +194,7 @@
             btnNewVersion.Visible = false;
             btnNewVersion.X = Application.GetRealWidth(242);
             btnNewVersion.Y = Application.GetRealHeight(23);
-            rowUpDate.AddChidren(btnNewVersion, ChidrenBindMode.BindEventOnly);
+            rowUpDate.AddChidren(btnNewVersion, ChidrenBindMode.BindEvent);
             rowUpDate.ButtonClickEvent += (sender, e) =>
             {
                 btnNewVersion.Visible = false;
@@ -177,7 +220,7 @@
                 if (oldName != btnNote.Text)
                 {
                     //淇敼鍚嶅瓧
-                    this.SetGatewayName(btnNote.Text, false);
+                    this.SetGatewayName(btnNote.Text, true);
                 }
                 else
                 {
@@ -235,7 +278,7 @@
 
             //鍒囨崲
             MenuName = Language.StringByID(R.MyInternationalizationString.uSwitch1);
-            string strWayId = HdlGatewayLogic.Current.GetGatewayId(zbGateway);
+            string strWayId = this.zbGateway.GwId;
             if (strWayId == GatewayResourse.AppOldSelectGatewayId)
             {
                 MenuName = Language.StringByID(R.MyInternationalizationString.uRefresh);
@@ -283,10 +326,10 @@
         /// 妫�娴嬫柊鐗堟湰
         /// </summary>
         /// <param name="btnNewVersion">鎻愮ず鏈夋柊鐗堟湰鐨勬帶浠�</param>
-        private async void CheckNewVersion(PicViewControl btnNewVersion)
+        private void CheckNewVersion(PicViewControl btnNewVersion)
         {
             //鑾峰彇缃戝叧鐗堟湰淇℃伅
-            var result = await HdlGatewayLogic.Current.GetGatewayAllNewVersion(this.zbGateway);
+            var result = HdlGatewayLogic.Current.GetGatewayAllNewVersion(this.zbGateway);
             if (result == null)
             {
                 return;
@@ -306,44 +349,16 @@
 
         #endregion
 
-        #region 鈻� 瀹屾垚鎸夐挳鎸変笅_______________________
-
-        /// <summary>
-        /// 瀹屾垚鎸夐挳鎸変笅
-        /// </summary>
-        /// <param name="gatewayName">缃戝叧鍚�</param>
-        private void FinishButtonClick(string gatewayName)
-        {
-            if (string.IsNullOrEmpty(gatewayName) == true)
-            {
-                //璇疯緭鍏ョ綉鍏冲悕绉�
-                string msg = Language.StringByID(R.MyInternationalizationString.uGatewayNameMastInput);
-                this.ShowMassage(ShowMsgType.Error, msg);
-                return;
-            }
-            string nameValue = HdlGatewayLogic.Current.GetGatewayName(zbGateway);
-            if (nameValue == gatewayName)
-            {
-                //鍚屽悕涓嶉渶瑕佸鐞�
-                this.CloseForm();
-                return;
-            }
-            //淇敼鍚嶅瓧
-            this.SetGatewayName(gatewayName, true);
-        }
-
-        #endregion
-
         #region 鈻� 淇敼鍚嶅瓧___________________________
 
         /// <summary>
         /// 璁剧疆缃戝叧鍚嶅瓧
         /// </summary>
         /// <param name="gatewayName">缃戝叧鍚嶇О</param>
-        private async void SetGatewayName(string gatewayName, bool closeForm)
+        private void SetGatewayName(string gatewayName, bool closeForm)
         {
             //淇敼缃戝叧鍚�
-            var result = await HdlGatewayLogic.Current.ReName(zbGateway, gatewayName);
+            var result = HdlGatewayLogic.Current.ReName(zbGateway, gatewayName);
             //缃戝叧淇敼澶辫触
             if (result == false)
             {
@@ -366,8 +381,7 @@
         /// <param name="online"></param>
         private async void DoSwitchGateway()
         {
-            string gatewayId = HdlGatewayLogic.Current.GetGatewayId(zbGateway);
-            var result = await HdlGatewayLogic.Current.DoSwitchGateway(gatewayId);
+            var result = await HdlGatewayLogic.Current.DoSwitchGateway(zbGateway.GwId);
             if (result == false)
             {
                 return;
@@ -394,7 +408,7 @@
                 else
                 {
                     //鍒锋柊涓荤敾闈�(涓嶉噸鏂拌幏鍙栬澶囩姸鎬�)
-                    this.LoadFormMethodByName("DeviceListMainForm", "InitMiddleFrame", false);
+                    this.LoadFormMethodByName("DeviceListMainForm", "InitMiddleFrame");
                 }
             });
         }

--
Gitblit v1.8.0