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/DeviceInfoIconControl.cs | 53 +++++++++++++----------------------------------------
1 files changed, 13 insertions(+), 40 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs
index c93d200..b0c3624 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs
@@ -6,7 +6,7 @@
namespace Shared.Phone.UserCenter
{
/// <summary>
- /// 璁惧淇℃伅鐣岄潰鐨勮澶囧浘鏍囨帶浠�(鍏煎缃戝叧)
+ /// 璁惧淇℃伅鐣岄潰鐨勮澶囧浘鏍囨帶浠�
/// </summary>
public class DeviceInfoIconControl : FrameLayout
{
@@ -15,11 +15,11 @@
/// <summary>
/// 璁惧Mac鍦板潃
/// </summary>
- private string deviceMac = null;
+ private string deviceMac = string.Empty;
/// <summary>
- /// 缃戝叧瀵硅薄
+ /// 璁惧绔偣
/// </summary>
- private ZbGateway zbGateway = null;
+ private int deviceEpoint = 0;
/// <summary>
/// 鍥炬爣鎺т欢
/// </summary>
@@ -32,8 +32,12 @@
/// <summary>
/// 璁惧淇℃伅鐣岄潰鐨勮澶囧浘鏍囨帶浠�
/// </summary>
- public DeviceInfoIconControl()
+ /// <param name="i_device">璁惧鍥炶矾瀵硅薄</param>
+ public DeviceInfoIconControl(CommonDevice i_device)
{
+ deviceMac = i_device.DeviceAddr;
+ deviceEpoint = i_device.DeviceEpoint;
+
//绗竴灞傚簳鑹�
this.Height = Application.GetMinRealAverage(207);
this.Width = Application.GetMinRealAverage(207);
@@ -42,12 +46,10 @@
}
/// <summary>
- /// 鍒濆鍖�(璁惧)
+ /// 鍒濆鍖�
/// </summary>
- /// <param name="i_device">璁惧瀵硅薄</param>
- public void InitControl(CommonDevice i_device)
+ public void InitControl()
{
- this.deviceMac = i_device.DeviceAddr;
//绗簩灞傚簳鑹�
var btnIcon2 = new NormalViewControl(Application.GetMinRealAverage(184), Application.GetMinRealAverage(184), false);
btnIcon2.BackgroundColor = 0xfffef1ed;
@@ -62,27 +64,6 @@
this.AddChidren(btnIcon);
}
- /// <summary>
- /// 鍒濆鍖�(缃戝叧)
- /// </summary>
- /// <param name="i_gateway">缃戝叧瀵硅薄</param>
- public void InitControl(ZbGateway i_gateway)
- {
- this.zbGateway = i_gateway;
- //绗簩灞傚簳鑹�
- var btnIcon2 = new NormalViewControl(Application.GetMinRealAverage(184), Application.GetMinRealAverage(184), false);
- btnIcon2.BackgroundColor = 0xfffef1ed;
- btnIcon2.Radius = (uint)Application.GetMinRealAverage(184);
- btnIcon2.Gravity = Gravity.Center;
- this.AddChidren(btnIcon2);
-
- //璁惧鍥炬爣
- btnIcon = new NormalViewControl(Application.GetMinRealAverage(121), Application.GetMinRealAverage(121), false);
- btnIcon.Gravity = Gravity.Center;
- HdlGatewayLogic.Current.SetGatewayIcon(btnIcon, i_gateway);
- this.AddChidren(btnIcon);
- }
-
#endregion
#region 鈻� 涓�鑸柟娉昣__________________________
@@ -92,16 +73,8 @@
/// </summary>
public void RefreshControl()
{
- if (this.deviceMac != null)
- {
- //鍒锋柊鍥炬爣
- Common.LocalDevice.Current.SetDeviceBeloneIconToControl(btnIcon, Common.LocalDevice.Current.GetDevicesByMac(deviceMac));
- }
- else
- {
- //鍒锋柊鍥炬爣
- HdlGatewayLogic.Current.SetGatewayIcon(btnIcon, this.zbGateway);
- }
+ //鍒锋柊鍥炬爣
+ Common.LocalDevice.Current.SetDeviceBeloneIconToControl(btnIcon, Common.LocalDevice.Current.GetDevicesByMac(deviceMac));
}
#endregion
--
Gitblit v1.8.0