From f759dc1e6f49c53733eafda82207c85af18f9931 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 28 五月 2020 15:46:54 +0800
Subject: [PATCH] 2020-05-28-1
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
index 9a6ce1c..e9c72d8 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
@@ -20,24 +20,27 @@
/// </summary>
private bool hadRefresh = false;
/// <summary>
- /// 鍦ㄧ嚎鐘舵��
- /// </summary>
- private bool m_isOnline = false;
- /// <summary>
/// 浼犳劅鍣ㄦ帹閫佷腑
/// </summary>
private bool sensorPushing = false;
/// <summary>
/// 鍦ㄧ嚎鐘舵��
/// </summary>
- public bool isOnline
+ private bool m_isOnline = true;
+ /// <summary>
+ /// 鍦ㄧ嚎鐘舵��
+ /// </summary>
+ public bool IsOnline
{
get { return m_isOnline; }
set
{
- m_isOnline = value;
- //璁剧疆鍦ㄧ嚎鐘舵�佺殑鐗规晥
- this.SetOnlineStatu(m_isOnline);
+ if (m_isOnline != value)
+ {
+ m_isOnline = value;
+ //璁剧疆鍦ㄧ嚎鐘舵�佺殑鐗规晥
+ this.SetOnlineStatu(m_isOnline);
+ }
}
}
@@ -62,7 +65,7 @@
/// 鍋氭垚涓�涓樉绀鸿澶囩被鍨�+璁惧MAC澶囨敞鐨凴owLayout
/// </summary>
/// <param name="i_deviceMac">璁惧鐨凪ac鍦板潃</param>
- /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param>
+ /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(銆愬垪琛ㄦ帶浠剁殑rowSpace/2銆戝嵆鍙�,涓嶆噦榛樿涓�0鍗冲彲)</param>
public DeviceObjectControl(string i_deviceMac, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
{
this.deviceMac = i_deviceMac;
@@ -96,7 +99,7 @@
frameTable.AddBottomLine();
//璁剧疆鍦ㄧ嚎鐘舵�佺殑鐗规晥
- this.isOnline = listDevice[0].IsOnline == 1;
+ this.IsOnline = Common.LocalDevice.Current.CheckDeviceIsOnline(listDevice[0]);
}
#endregion
@@ -106,10 +109,10 @@
/// <summary>
/// 璁剧疆鍦ㄧ嚎鐘舵�佺殑鐗规晥
/// </summary>
- /// <param name="isOnline"></param>
- private void SetOnlineStatu(bool isOnline)
+ /// <param name="i_isOnline"></param>
+ private void SetOnlineStatu(bool i_isOnline)
{
- if (isOnline == false)
+ if (i_isOnline == false)
{
btnDeviceName.TextColor = UserCenterColor.Current.TextGrayColor1;
}
@@ -143,8 +146,6 @@
btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceMacName(listDevice[0]);
//璁惧鎴块棿
btnDeviceRoom.Text = Common.LocalDevice.Current.GeteRealDeviceRoomName(listDevice[0]);
- //璁剧疆鍦ㄧ嚎鐘舵�佺殑鐗规晥
- this.isOnline = listDevice[0].IsOnline == 1;
}
--
Gitblit v1.8.0