From 4f0ab0ad21ce450b7856d50f98322a7899361386 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期二, 22 九月 2020 10:30:01 +0800
Subject: [PATCH] 不要下载这个备份
---
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs | 164 +++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 143 insertions(+), 21 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs
index 8a72cc1..8966fec 100755
--- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs
@@ -46,6 +46,10 @@
/// </summary>
private MostRightIconControl btnSwitch = null;
/// <summary>
+ /// 鐢垫睜鎺т欢
+ /// </summary>
+ private IconViewControl btnBattery = null;
+ /// <summary>
/// 鏄惁鑾峰彇缃戝叧鍙嶉鐨勭粨鏋� 0:娌℃湁鑾峰彇寰楀埌 1:宸茬粡鑾峰彇寰楀埌
/// </summary>
private int ResponeResult = 0;
@@ -146,6 +150,24 @@
this.btnSwitch = new MostRightIconControl(69, 69);
btnSwitch.UnSelectedImagePath = "Item/Switch.png";
btnSwitch.SelectedImagePath = "Item/SwitchSelected.png";
+
+ //鐢垫睜鎺т欢
+ if (this.device.Type == DeviceType.IASZone)
+ {
+ this.btnBattery = new IconViewControl(69);
+ btnBattery.X = this.Width - Application.GetRealWidth(69 + 29);
+ btnBattery.UnSelectedImagePath = "Item/Battery.png";
+ btnBattery.Gravity = Gravity.CenterVertical;
+ this.frameTable.AddChidren(btnBattery, ChidrenBindMode.BindEvent);
+ if (chidrenYaxis != 0)
+ {
+ btnBattery.Y += chidrenYaxis;
+ }
+ if (this.device.IsBatteryDown == false)
+ {
+ btnBattery.Visible = false;
+ }
+ }
//鍒嗕韩鐨勬埧闂�,鍒欎笉鑳界紪杈戝拰鍒犻櫎
if (this.nowSelectRoom.IsSharedRoom == false)
@@ -249,6 +271,13 @@
//绛夊緟缃戝叧鍥炲鍚庝細閲嶆柊鍒锋柊,涓嶇劧涓�鐩存槸鍏抽棴鐘舵��
isOpen = false;
}
+ //濡傛灉鏄紶鎰熷櫒绫�,鍒欓粯璁ゆ槸鍏崇殑鏁堟灉
+ if (this.device.Type == DeviceType.PMSensor || this.device.Type == DeviceType.IASZone
+ || this.device.Type == DeviceType.TemperatureSensor)
+ {
+ isOpen = false;
+ }
+
this.SetRowOpenStatu(isOpen);
}
@@ -263,31 +292,13 @@
{
this.btnStatu.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device);
}
-
- if (this.btnDeviceName.IsSelected == isOpen)
- {
- //鐘舵�佷竴鏍�,鍒欎笉闇�瑕佸鐞�
- return;
- }
- //璁惧鍚嶇О鎺т欢
- this.btnDeviceName.IsSelected = isOpen;
- this.btnDeviceName.IsBold = isOpen;
- //璁惧鐨勮儗鏅渾鍦堝浘
- if (isOpen == true)
- {
- this.frameIconBackGroud.BackgroundColor = Common.ZigbeeColor.Current.GXCSelectedBackgroundColor;
- }
- else
- {
- this.frameIconBackGroud.BackgroundColor = Common.ZigbeeColor.Current.GXCGrayBackgroundColor;
- }
- //璁惧鍥炬爣鎺т欢
- this.btnDeviceIcon.IsSelected = isOpen;
//寮�鍏虫帶浠�
- if (this.btnSwitch != null)
+ if (this.btnSwitch != null && this.btnSwitch.IsSelected != isOpen)
{
this.btnSwitch.IsSelected = isOpen;
}
+ //鍒囨崲鍗$墖鐘舵�佺壒鏁�
+ this.SwitchRowStatuAppeal(isOpen);
}
/// <summary>
@@ -439,6 +450,43 @@
this.ResponeResult = 1;
}
+ /// <summary>
+ /// 鎺ユ敹缃戝叧鍥炲鐨勭姸鎬�(true:宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍥炲 false:杩樻病鏈夋帴鏀跺埌缃戝叧鍥炲)
+ /// </summary>
+ /// <returns></returns>
+ public bool ReceiveResponeResultStatu()
+ {
+ return this.ResponeResult == 1;
+ }
+
+ #endregion
+
+ #region 鈻� 鏄剧ず浣庣數閲廮________________________
+
+ /// <summary>
+ /// 鍒锋柊鐢垫睜鐢甸噺鐘舵��
+ /// </summary>
+ public void RefreshBatteryStatu()
+ {
+ if (this.btnBattery == null) { return; }
+ if (this.device.IsBatteryDown == true)
+ {
+ //鐢甸噺浣�,鏄剧ず鍥炬爣
+ if (this.btnBattery.Visible == false)
+ {
+ this.btnBattery.Visible = true;
+ }
+ }
+ else
+ {
+ //鐢甸噺瓒冲,闅愯棌鍥炬爣
+ if (this.btnBattery.Visible == true)
+ {
+ this.btnBattery.Visible = false;
+ }
+ }
+ }
+
#endregion
#region 鈻� 涓�鑸柟娉昣__________________________
@@ -464,6 +512,80 @@
#endregion
+ #region 鈻� 琛岄棯鐑佺壒鏁坃________________________
+
+ /// <summary>
+ /// 鏄惁澶勪簬鐗规晥涓�
+ /// </summary>
+ private bool isAppeal = false;
+ /// <summary>
+ /// 寮�鍚闂儊鐗规晥
+ /// </summary>
+ public void StartRowLightAppeal()
+ {
+ //璁惧鐘舵�佸繀椤诲埛鏂�
+ this.btnStatu.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device);
+
+ if (this.isAppeal == true) { return; }
+ this.isAppeal = true;
+
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //闂儊5绉�,闂撮殧400姣
+ int count = 5000 / 400;
+ bool isOpen = false;
+ while (this.Parent != null && count >= 0)
+ {
+ //闂儊鐗规晥
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ isOpen = !isOpen;
+ this.SwitchRowStatuAppeal(isOpen);
+ });
+ System.Threading.Thread.Sleep(400);
+ count--;
+ }
+ if (this.Parent != null && isOpen == false)
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //缁撴潫鏃�,榛樿涓烘墦寮�鐗规晥
+ this.SwitchRowStatuAppeal(true);
+ }, ShowErrorMode.NO);
+ }
+ this.isAppeal = false;
+
+ }, ShowErrorMode.NO);
+ }
+
+ /// <summary>
+ /// 鍒囨崲鍗$墖鐘舵�佺壒鏁�
+ /// </summary>
+ public void SwitchRowStatuAppeal(bool isOpen)
+ {
+ if (this.btnDeviceName.IsSelected == isOpen)
+ {
+ //鐘舵�佷竴鏍�,鍒欎笉闇�瑕佸鐞�
+ return;
+ }
+ //璁惧鍚嶇О鎺т欢
+ this.btnDeviceName.IsSelected = isOpen;
+ this.btnDeviceName.IsBold = isOpen;
+ //璁惧鐨勮儗鏅渾鍦堝浘
+ if (isOpen == true)
+ {
+ this.frameIconBackGroud.BackgroundColor = Common.ZigbeeColor.Current.GXCSelectedBackgroundColor;
+ }
+ else
+ {
+ this.frameIconBackGroud.BackgroundColor = Common.ZigbeeColor.Current.GXCGrayBackgroundColor;
+ }
+ //璁惧鍥炬爣鎺т欢
+ this.btnDeviceIcon.IsSelected = isOpen;
+ }
+
+ #endregion
+
#region 鈻� 鎺т欢鎽ф瘉___________________________
/// <summary>
--
Gitblit v1.8.0