From 580a4715eeb88e13128e65963834b159768444cf Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期三, 08 一月 2020 10:19:39 +0800
Subject: [PATCH] 2019.1.8
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs | 84 +++++++++++++++++++++++++++--------------
1 files changed, 55 insertions(+), 29 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
index 55c143d..850137d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
@@ -24,6 +24,10 @@
/// </summary>
private bool m_isOnline = false;
/// <summary>
+ /// 浼犳劅鍣ㄦ帹閫佷腑
+ /// </summary>
+ private bool sensorPushing = false;
+ /// <summary>
/// 鍦ㄧ嚎鐘舵��
/// </summary>
public bool isOnline
@@ -42,13 +46,13 @@
/// </summary>
public IconViewControl btnIcon = null;
/// <summary>
- /// 璁惧绫诲瀷鎺т欢
- /// </summary>
- private NormalViewControl btnDeviceObject = null;
- /// <summary>
/// 璁惧澶囨敞鎺т欢
/// </summary>
private NormalViewControl btnDeviceName = null;
+ /// <summary>
+ /// 璁惧鎴块棿鎺т欢
+ /// </summary>
+ private NormalViewControl btnDeviceRoom = null;
#endregion
@@ -72,34 +76,22 @@
var listDevice = Common.LocalDevice.Current.GetDevicesByMac(this.deviceMac);
//鍥炬爣
btnIcon = frameTable.AddLeftIcon(81);
- Common.LocalDevice.Current.SetDeviceBeloneIconToControl(btnIcon, listDevice);
-
- //璁惧绫诲瀷
- string objText = Common.LocalDevice.Current.GetDeviceObjectText(listDevice);
- btnDeviceObject = frameTable.AddLeftCaption(objText, 800, 60, true);
- btnDeviceObject.TextSize = 15;
- //杩欎釜鍧愭爣鏈夌偣鐗规畩
- btnDeviceObject.Y = Application.GetRealHeight(12) + this.chidrenYaxis;
- btnDeviceObject.Text = Common.LocalDevice.Current.GetDeviceObjectText(listDevice);
- frameTable.AddChidren(btnDeviceObject, ChidrenBindMode.BindEventOnly);
+ Common.LocalDevice.Current.SetDeviceObjectIconToControl(btnIcon, listDevice);
//璁惧
string deviceName = Common.LocalDevice.Current.GetDeviceMacName(listDevice[0]);
- btnDeviceName = frameTable.AddLeftCaption(deviceName, 800, 49, true);
- //杩欎釜鍧愭爣鏈夌偣鐗规畩
- btnDeviceName.Y = Application.GetRealHeight(72) + this.chidrenYaxis;
- btnDeviceName.TextSize = 12;
- btnDeviceName.TextColor = UserCenterColor.Current.TextGrayColor1;
- btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceMacName(listDevice[0]);
+ btnDeviceName = frameTable.AddTopView(deviceName, 800);
frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
+
+ //鎴块棿
+ string roomName = Common.LocalDevice.Current.GeteRealDeviceRoomName(listDevice[0]);
+ btnDeviceRoom = frameTable.AddBottomView(roomName, 800);
//搴曠嚎
frameTable.AddBottomLine();
//璁剧疆鍦ㄧ嚎鐘舵�佺殑鐗规晥
this.isOnline = listDevice[0].IsOnline == 1;
-
- listDevice = null;
}
#endregion
@@ -114,11 +106,11 @@
{
if (isOnline == false)
{
- btnDeviceObject.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnDeviceName.TextColor = UserCenterColor.Current.TextGrayColor1;
}
else
{
- btnDeviceObject.TextColor = UserCenterColor.Current.TextColor1;
+ btnDeviceName.TextColor = UserCenterColor.Current.TextColor1;
}
}
@@ -136,16 +128,50 @@
var listDevice = Common.LocalDevice.Current.GetDevicesByMac(this.deviceMac);
//鍥炬爣
- Common.LocalDevice.Current.SetDeviceBeloneIconToControl(btnIcon, listDevice);
- //璁惧绫诲瀷
- btnDeviceObject.Text = Common.LocalDevice.Current.GetDeviceObjectText(listDevice);
+ Common.LocalDevice.Current.SetDeviceObjectIconToControl(btnIcon, listDevice);
//璁惧
btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceMacName(listDevice[0]);
+ //璁惧鎴块棿
+ btnDeviceRoom.Text = Common.LocalDevice.Current.GeteRealDeviceRoomName(listDevice[0]);
//璁剧疆鍦ㄧ嚎鐘舵�佺殑鐗规晥
this.isOnline = listDevice[0].IsOnline == 1;
-
- listDevice = null;
}
+
+
+ /// <summary>
+ /// 鏄剧ず浼犳劅鍣ㄤ笂鎶ョ殑鐗规晥
+ /// </summary>
+ public void StartSensorPushAppeal()
+ {
+ if (this.sensorPushing == true)
+ {
+ //浼犳劅鍣ㄦ鍦ㄧ壒鏁堜腑
+ return;
+ }
+ this.sensorPushing = true;
+ //璁惧
+ uint oldTextColor1 = btnDeviceName.TextColor;
+ btnDeviceName.TextColor = UserCenterColor.Current.TextOrangeColor;
+ //璁惧鎴块棿
+ uint oldTextColor2 = btnDeviceRoom.TextColor;
+ btnDeviceRoom.TextColor = UserCenterColor.Current.TextOrangeColor;
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ System.Threading.Thread.Sleep(5000);
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ if (btnDeviceName.Parent != null)
+ {
+ //璁惧
+ btnDeviceName.TextColor = oldTextColor1;
+ //璁惧鎴块棿
+ btnDeviceRoom.TextColor = oldTextColor2;
+ }
+ this.sensorPushing = false;
+ }, ShowErrorMode.NO);
+ });
+ }
+
#endregion
}
}
--
Gitblit v1.8.0