From ecba45c93391066bc30c7bd602c3a7683fbb99a7 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期五, 31 七月 2020 10:56:12 +0800
Subject: [PATCH] 临时备份
---
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs | 159 ++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 134 insertions(+), 25 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs
index d3cc6fc..5c9d0eb 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs
@@ -50,6 +50,10 @@
/// </summary>
private IconViewControl btnCollect = null;
/// <summary>
+ /// 鐢垫睜鎺т欢
+ /// </summary>
+ private IconViewControl btnBattery = null;
+ /// <summary>
/// 鏄惁鑾峰彇缃戝叧鍙嶉鐨勭粨鏋� 0:娌℃湁鑾峰彇寰楀埌 1:宸茬粡鑾峰彇寰楀埌
/// </summary>
private int ResponeResult = 0;
@@ -166,6 +170,21 @@
btnSwitch.UnSelectedImagePath = "Item/Switch1.png";
btnSwitch.SelectedImagePath = "Item/SwitchSelected1.png";
+ //鐢垫睜鎺т欢
+ if (this.device.Type == DeviceType.IASZone)
+ {
+ this.btnBattery = new IconViewControl(69);
+ btnBattery.X = HdlControlLogic.Current.GetPictrueRealSize(348);
+ btnBattery.Y = HdlControlLogic.Current.GetPictrueRealSize(236);
+ btnBattery.UnSelectedImagePath = "Item/Battery.png";
+ btnBattery.SelectedImagePath = "Item/BatterySelected.png";
+ this.AddChidren(btnBattery, ChidrenBindMode.BindEvent);
+ if (this.device.IsBatteryDown == false)
+ {
+ btnBattery.Visible = false;
+ }
+ }
+
//鍒锋柊淇℃伅
this.RefreshControlInfo(i_device);
}
@@ -222,35 +241,14 @@
{
//璁惧鐘舵�佸繀椤诲埛鏂�
this.btnStatu.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device);
-
- if (this.btnBackGroud.IsSelected == isOpen)
- {
- //鐘舵�佷竴鏍�,鍒欎笉闇�瑕佸鐞�
- return;
- }
- //鑳屾櫙鍥剧墖
- this.btnBackGroud.IsSelected = isOpen;
- //璁惧鍚嶇О鎺т欢
- this.btnDeviceName.IsSelected = isOpen;
- this.btnDeviceName.IsBold = isOpen;
- //璁惧鐨勮儗鏅渾鍦堝浘
- if (isOpen == true)
- {
- fraDeviceRound.BackgroundColor = Common.ZigbeeColor.Current.GXCForFunctionBackgroundColor;
- }
- else
- {
- fraDeviceRound.BackgroundColor = Common.ZigbeeColor.Current.GXCForFunctionUnSelectedBackgroundColor;
- }
- //璁惧鍥炬爣鎺т欢
- this.btnDeviceIcon.IsSelected = isOpen;
- //鐘舵�佹枃鏈帶浠�
- this.btnStatu.IsSelected = isOpen;
//寮�鍏虫帶浠�
- if (btnSwitch != null)
+ if (btnSwitch != null && this.btnSwitch.IsSelected != isOpen)
{
this.btnSwitch.IsSelected = isOpen;
}
+
+ //鍒囨崲鍗$墖鐘舵�佺壒鏁�
+ this.SwitchCardStatuAppeal(isOpen);
}
/// <summary>
@@ -405,6 +403,34 @@
#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 鈻� 涓�鑸柟娉昣__________________________
/// <summary>
@@ -428,6 +454,89 @@
#endregion
+ #region 鈻� 鍗$墖闂儊鐗规晥_______________________
+
+ /// <summary>
+ /// 鏄惁澶勪簬鐗规晥涓�
+ /// </summary>
+ private bool isAppeal = false;
+ /// <summary>
+ /// 寮�鍚崱鐗囬棯鐑佺壒鏁�
+ /// </summary>
+ public void StartCardLightAppeal()
+ {
+ //璁惧鐘舵�佸繀椤诲埛鏂�
+ 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.SwitchCardStatuAppeal(isOpen);
+ });
+ System.Threading.Thread.Sleep(400);
+ count--;
+ }
+ if (this.Parent != null && isOpen == false)
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //缁撴潫鏃�,榛樿涓烘墦寮�鐗规晥
+ this.SwitchCardStatuAppeal(true);
+ }, ShowErrorMode.NO);
+ }
+ this.isAppeal = false;
+
+ }, ShowErrorMode.NO);
+ }
+
+ /// <summary>
+ /// 鍒囨崲鍗$墖鐘舵�佺壒鏁�
+ /// </summary>
+ private void SwitchCardStatuAppeal(bool isOpen)
+ {
+ if (this.btnBackGroud.IsSelected == isOpen)
+ {
+ //鐘舵�佷竴鏍�,鍒欎笉闇�瑕佸鐞�
+ return;
+ }
+ //鑳屾櫙鍥剧墖
+ this.btnBackGroud.IsSelected = isOpen;
+ //璁惧鍚嶇О鎺т欢
+ this.btnDeviceName.IsSelected = isOpen;
+ this.btnDeviceName.IsBold = isOpen;
+ //璁惧鐨勮儗鏅渾鍦堝浘
+ if (isOpen == true)
+ {
+ fraDeviceRound.BackgroundColor = Common.ZigbeeColor.Current.GXCForFunctionBackgroundColor;
+ }
+ else
+ {
+ fraDeviceRound.BackgroundColor = Common.ZigbeeColor.Current.GXCForFunctionUnSelectedBackgroundColor;
+ }
+ //璁惧鍥炬爣鎺т欢
+ this.btnDeviceIcon.IsSelected = isOpen;
+ //鐘舵�佹枃鏈帶浠�
+ this.btnStatu.IsSelected = isOpen;
+ //鐢垫睜鎺т欢
+ if (this.btnBattery != null && this.btnBattery.Visible == true)
+ {
+ this.btnBattery.IsSelected = isOpen;
+ }
+ }
+
+ #endregion
+
#region 鈻� 鎺т欢鎽ф瘉___________________________
/// <summary>
--
Gitblit v1.8.0