From 1a2061079e97a738ec7b8959bfd9a6e6c6997403 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期四, 31 十月 2019 09:59:29 +0800
Subject: [PATCH] 2019.10.31
---
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 52838aa..1f00096 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs
@@ -32,14 +32,19 @@
return zbway;
}
}
+
+ /// <summary>
+ /// 鍥炬爣鎺т欢
+ /// </summary>
+ public IconViewControl btnIcon = null;
/// <summary>
/// 鏄剧ず鏂囨湰鎺т欢
/// </summary>
public NormalViewControl btnName = null;
/// <summary>
- /// 鏄剧ずIP鎺т欢
+ /// 鍦ㄧ嚎鐘舵�佺殑鎺т欢
/// </summary>
- private NormalViewControl btnIp = null;
+ public NormalViewControl btnOnline = null;
/// <summary>
/// 鍦ㄧ嚎鐘舵��
@@ -82,7 +87,7 @@
var tempWay = this.zbGateway;
//鍥炬爣
- var btnIcon = frameTable.AddLeftIcon(iconSize);
+ this.btnIcon = frameTable.AddLeftIcon(iconSize);
if (tempWay != null)
{
HdlGatewayLogic.Current.SetGatewayIcon(btnIcon, tempWay);
@@ -95,35 +100,10 @@
//鏃犳硶璇嗗埆鐨勭綉鍏宠澶�
wayName = Language.StringByID(R.MyInternationalizationString.uUnDistinguishTheGatewayDevice);
}
- 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) + ")";
- }
- }
+ this.btnName = frameTable.AddLeftCaption(wayName, 700);
+ this.btnName.Text = wayName;
- 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);
+ tempWay = null;
}
#endregion
@@ -140,28 +120,38 @@
{
this.zbGatewayId = HdlGatewayLogic.Current.GetGatewayId(zbway);
}
- bool bonline = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbway);
+ ZbGateway realWay = null;
+ bool bonline = false;
+ if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, this.zbGatewayId) == true)
+ {
+ bonline = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(realWay);
+ }
this.IsOnline = bonline;
+ this.btnName.Text = HdlGatewayLogic.Current.GetGatewayName(this.zbGateway);
- 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;
+ realWay = null;
}
#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>
/// 璁剧疆鍦ㄧ嚎鐘舵��
@@ -170,13 +160,23 @@
private void SetOnlineStatu(bool online)
{
m_IsOnline = online;
+ if (btnOnline == null)
+ {
+ return;
+ }
if (online == false)
{
- btnName.TextColor = UserCenterColor.Current.TextGrayColor2;
+ //鍒濆鍊硷細绂荤嚎
+ btnOnline.TextID = R.MyInternationalizationString.uOffLine;
+ //鍒濆鍊硷細鐏拌壊
+ btnOnline.TextColor = UserCenterColor.Current.Gray;
}
else
{
- btnName.TextColor = UserCenterColor.Current.TextColor1;
+ //鍦ㄧ嚎
+ btnOnline.TextID = R.MyInternationalizationString.uOnline;
+ //缁胯壊
+ btnOnline.TextColor = UserCenterColor.Current.Green;
}
}
--
Gitblit v1.8.0