From 081ea8d273048fd03756718ac6fb48a3c09218e9 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期二, 29 十月 2019 13:10:00 +0800 Subject: [PATCH] Merge branch 'dev-tzy' into DEV_GXC --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs | 99 ++++++++++++++++++++++++++----------------------- 1 files changed, 53 insertions(+), 46 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..c3a0bc0 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs @@ -32,19 +32,18 @@ return zbway; } } - - /// <summary> - /// 鍥炬爣鎺т欢 - /// </summary> - public IconViewControl btnIcon = null; /// <summary> /// 鏄剧ず鏂囨湰鎺т欢 /// </summary> public NormalViewControl btnName = null; /// <summary> - /// 鍦ㄧ嚎鐘舵�佺殑鎺т欢 + /// 鍥炬爣鎺т欢 /// </summary> - public NormalViewControl btnOnline = null; + public IconViewControl btnIcon = null; + /// <summary> + /// 鏄剧ずIP鎺т欢 + /// </summary> + private NormalViewControl btnIp = null; /// <summary> /// 鍦ㄧ嚎鐘舵�� @@ -100,10 +99,38 @@ //鏃犳硶璇嗗埆鐨勭綉鍏宠澶� 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); + + //鍒濆鍊煎湪绾� + this.IsOnline = true; } #endregion @@ -120,38 +147,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 +177,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