From 97e259d966cb5cb5d73c105d5dbaadcc1f920614 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期五, 18 十月 2019 13:48:43 +0800
Subject: [PATCH] 合并了全部的代码

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs |   94 +++++++++++++++++++++++-----------------------
 1 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs
index 1f00096..52838aa 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs
@@ -32,19 +32,14 @@
                 return zbway;
             }
         }
-
-        /// <summary>
-        /// 鍥炬爣鎺т欢
-        /// </summary>
-        public IconViewControl btnIcon = null;
         /// <summary>
         /// 鏄剧ず鏂囨湰鎺т欢
         /// </summary>
         public NormalViewControl btnName = null;
         /// <summary>
-        /// 鍦ㄧ嚎鐘舵�佺殑鎺т欢
+        /// 鏄剧ずIP鎺т欢
         /// </summary>
-        public NormalViewControl btnOnline = null;
+        private NormalViewControl btnIp = null;
 
         /// <summary>
         /// 鍦ㄧ嚎鐘舵��
@@ -87,7 +82,7 @@
             var tempWay = this.zbGateway;
 
             //鍥炬爣
-            this.btnIcon = frameTable.AddLeftIcon(iconSize);
+            var btnIcon = frameTable.AddLeftIcon(iconSize);
             if (tempWay != null)
             {
                 HdlGatewayLogic.Current.SetGatewayIcon(btnIcon, tempWay);
@@ -100,10 +95,35 @@
                 //鏃犳硶璇嗗埆鐨勭綉鍏宠澶�
                 wayName = Language.StringByID(R.MyInternationalizationString.uUnDistinguishTheGatewayDevice);
             }
-            this.btnName = frameTable.AddLeftCaption(wayName, 700);
-            this.btnName.Text = wayName;
+            else
+            {
+                var value = HdlGatewayLogic.Current.IsMainGateway(this.zbGatewayId);
+                if (value == 1)
+                {
+                    //涓荤綉鍏�
+                    wayName += "(" + Language.StringByID(R.MyInternationalizationString.uMainGateway) + ")";
+                }
+                else if (value == 2)
+                {
+                    //浠庣綉鍏�
+                    wayName += "(" + Language.StringByID(R.MyInternationalizationString.uChidrenGateway) + ")";
+                }
+            }
 
-            tempWay = null;
+            this.btnName = frameTable.AddLeftCaption(wayName, 700, 60);
+            btnName.TextSize = 15;
+            //杩欎釜鍧愭爣鏈夌偣鐗规畩
+            btnName.Y = Application.GetRealHeight(12) + this.chidrenYaxis;
+            frameTable.AddChidren(btnName, ChidrenBindMode.BindEventOnly);
+
+            //鎴块棿
+            string strIp = HdlGatewayLogic.Current.GetGatewayBaseInfoAttribute(tempWay, "IpAddress").ToString();
+            this.btnIp = frameTable.AddLeftCaption(strIp, 600, 50, true);
+            //杩欎釜鍧愭爣鏈夌偣鐗规畩
+            btnIp.Y = Application.GetRealHeight(72) + this.chidrenYaxis;
+            btnIp.TextSize = 12;
+            btnIp.TextColor = UserCenterColor.Current.TextGrayColor1;
+            frameTable.AddChidren(btnIp, ChidrenBindMode.BindEventOnly);
         }
 
         #endregion
@@ -120,38 +140,28 @@
             {
                 this.zbGatewayId = HdlGatewayLogic.Current.GetGatewayId(zbway);
             }
-            ZbGateway realWay = null;
-            bool bonline = false;
-            if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, this.zbGatewayId) == true)
-            {
-                bonline = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(realWay);
-            }
+            bool bonline = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbway);
 
             this.IsOnline = bonline;
-            this.btnName.Text = HdlGatewayLogic.Current.GetGatewayName(this.zbGateway);
 
-            realWay = null;
+            string wayName = HdlGatewayLogic.Current.GetGatewayName(this.zbGateway);
+            var value = HdlGatewayLogic.Current.IsMainGateway(this.zbGatewayId);
+            if (value == 1)
+            {
+                //涓荤綉鍏�
+                wayName += "(" + Language.StringByID(R.MyInternationalizationString.uMainGateway) + ")";
+            }
+            else if (value == 2)
+            {
+                //浠庣綉鍏�
+                wayName += "(" + Language.StringByID(R.MyInternationalizationString.uChidrenGateway) + ")";
+            }
+            this.btnName.Text = wayName;
         }
 
         #endregion
 
         #region 鈻� 鍦ㄧ嚎鐘舵�乢__________________________
-
-        /// <summary>
-        /// 娣诲姞鍦ㄧ嚎鐘舵�佺殑鎺т欢(鍙宠竟鏈夊浘鏍囩殑璇�,鍏堟坊鍔犲浘鏍�,鍐嶆坊鍔犳鎺т欢)
-        /// </summary>
-        public void AddOnLineControl()
-        {
-            this.btnOnline = frameTable.AddMostRightView(string.Empty, 270);
-
-            ZbGateway realWay = null;
-            bool bonline = false;
-            if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, zbGateway) == true)
-            {
-                bonline = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(realWay);
-            }
-            this.SetOnlineStatu(bonline);
-        }
 
         /// <summary>
         /// 璁剧疆鍦ㄧ嚎鐘舵��
@@ -160,23 +170,13 @@
         private void SetOnlineStatu(bool online)
         {
             m_IsOnline = online;
-            if (btnOnline == null)
-            {
-                return;
-            }
             if (online == false)
             {
-                //鍒濆鍊硷細绂荤嚎
-                btnOnline.TextID = R.MyInternationalizationString.uOffLine;
-                //鍒濆鍊硷細鐏拌壊
-                btnOnline.TextColor = UserCenterColor.Current.Gray;
+                btnName.TextColor = UserCenterColor.Current.TextGrayColor2;
             }
             else
             {
-                //鍦ㄧ嚎
-                btnOnline.TextID = R.MyInternationalizationString.uOnline;
-                //缁胯壊
-                btnOnline.TextColor = UserCenterColor.Current.Green;
+                btnName.TextColor = UserCenterColor.Current.TextColor1;
             }
         }
 

--
Gitblit v1.8.0