From adb12dcdbb2ddaeac687c3aa9e57bb7ed459ab7e Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 24 六月 2020 15:26:46 +0800
Subject: [PATCH] 2020.06.24.01

---
 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs |   73 +++++++++++++++++++-----------------
 1 files changed, 39 insertions(+), 34 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
index 4bbb6c1..ff1fb33 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
@@ -118,6 +118,40 @@
             //鍒掔嚎
             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);
             listview.AddChidren(rowData);
@@ -129,7 +163,7 @@
             rowData.frameTable.ButtonClickEvent += (sender, e) =>
             {
                 var form = new GatewayUploadAndDownLoadForm();
-                form.AddForm(HdlGatewayLogic.Current.GetGatewayId(this.zbGateway));
+                form.AddForm(this.zbGateway.GwId);
             };
 
             //閫氱敤淇℃伅
@@ -160,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;
@@ -186,7 +220,7 @@
                 if (oldName != btnNote.Text)
                 {
                     //淇敼鍚嶅瓧
-                    this.SetGatewayName(btnNote.Text, false);
+                    this.SetGatewayName(btnNote.Text, true);
                 }
                 else
                 {
@@ -244,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);
@@ -315,34 +349,6 @@
 
         #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>
@@ -375,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;

--
Gitblit v1.8.0