From 18a7f9f40e5fab3bee5d4ac3d8fd0273dea052d6 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期日, 26 四月 2020 12:05:28 +0800
Subject: [PATCH] 先上传一个非最新的版本
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/GatewayRowControl.cs | 103 ++++++++++++++++++++++++++++-----------------------
1 files changed, 57 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..dbf5e20 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>
+ public NormalViewControl btnIp = null;
/// <summary>
/// 鍦ㄧ嚎鐘舵��
@@ -100,10 +99,42 @@
//鏃犳硶璇嗗埆鐨勭綉鍏宠澶�
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 = string.Empty;
+ if (tempWay != null)
+ {
+ strIp = tempWay.getGatewayBaseInfo.IpAddress;
+ }
+ 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 +151,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 +181,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