From b2f2494386c4629cf0e0f0a3740e7672919d53a2 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 06 一月 2021 17:09:55 +0800
Subject: [PATCH] 修改了彩灯的百分比计算
---
ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs | 70 ++++++++++++++++++++++++-----------
1 files changed, 48 insertions(+), 22 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs
index 4e1e63a..0d335b8 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs
@@ -44,7 +44,7 @@
/// <summary>
/// 鏄惁鑾峰彇缃戝叧鍙嶉鐨勭粨鏋� 0:娌℃湁鑾峰彇寰楀埌 1:宸茬粡鑾峰彇寰楀埌
/// </summary>
- private int ResponeResult = 0;
+ public int ResponeResult = 0;
/// <summary>
/// 褰撳墠绔偣鐨勫姛鑳界被鍨�
/// </summary>
@@ -87,8 +87,19 @@
btnMore.InitControl();
btnMore.ButtonClickEvent += (sender, e) =>
{
- var detailInfo = new DeviceDetailInfoForm();
- detailInfo.AddForm(device, nowSelectRoom);
+ //鑾峰彇璁惧灞炰簬銆愭櫨琛f灦銆�
+ var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice> { device });
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.Airer)
+ {
+ var form = new Shared.Phone.UserCenter.Device.DeviceFunctionSettionForm();
+ form.AddForm(device, true);
+ }
+ else
+ {
+ var detailInfo = new DeviceDetailInfoForm();
+ detailInfo.AddForm(device, nowSelectRoom);
+ }
+
};
//鍒濆鍖栦腑閮ㄤ俊鎭�
@@ -121,6 +132,17 @@
frameWhiteBack.Gravity = Gravity.CenterHorizontal;
bodyFrameLayout.AddChidren(frameWhiteBack);
+ if (this.device.Type == DeviceType.TemperatureSensor)
+ {
+ //鑾峰彇璁惧绫诲瀷
+ var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
+ //绌烘皵璐ㄩ噺浼犳劅鍣� ,鍗$墖姣旇緝澶�
+ if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+ {
+ frameWhiteBack.Y = Application.GetRealHeight(98);
+ }
+ }
+
//璁惧鍚嶇О
this.btnDeviceName = new NormalViewControl(100, 60, true);
btnDeviceName.Y = Application.GetRealHeight(46);
@@ -146,7 +168,7 @@
frameRoomBlack.Height = Application.GetRealHeight(138);
frameRoomBlack.Width = frameWhiteBack.Width;
frameRoomBlack.BackgroundColor = 0xff232323;
- frameRoomBlack.Radius= (uint)Application.GetRealHeight(17);
+ frameRoomBlack.Radius = (uint)Application.GetRealHeight(17);
frameRoomBlack.Gravity = Gravity.BottomCenter;
frameWhiteBack.AddChidren(frameRoomBlack);
@@ -232,11 +254,9 @@
this.ResponeResult = 0;
//鍏堣鎸囧畾鎺т欢涓嶈兘鐐瑰嚮
- var listSelect = new List<bool>();
foreach (var myContr in listControl)
{
myContr.CanClick = false;
- listSelect.Add(myContr.IsSelected);
}
HdlThreadLogic.Current.RunThread(() =>
@@ -269,14 +289,6 @@
{
var msgContr = new ShowMsgControl(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.FAIL));
msgContr.Show();
- //鍙樻洿鍥炲師鏉ョ殑鐘舵��
- for (int i = 0; i < listSelect.Count; i++)
- {
- if (listSelect[i] != listControl[i].IsSelected)
- {
- listControl[i].IsSelected = listSelect[i];
- }
- }
});
}
//寮�鍏虫寜閽彲浠ュ啀鐐瑰嚮
@@ -310,16 +322,31 @@
HdlGatewayReceiveLogic.Current.AddAttributeEvent("DeviceDetailCardAttribute" + mainKeys, ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
{
string mainKey2 = Common.LocalDevice.Current.GetDeviceMainKeys(report);
- if (mainKeys != mainKey2)
+
+ if (this.device.Type == DeviceType.Airer && this.device.DeviceAddr == report.DeviceAddr)
{
- //涓嶆槸鍚屼竴涓笢瑗�
- return;
+ //鏅捐。鏋剁壒娈婏細5涓洖璺唬琛ㄤ笉鍚岀殑鍔熻兘锛屼絾鏄粯璁ゆ湰鍦板彧鏄剧ず浜嗙涓�涓洖璺�
+ //鎵�浠ユ潯浠剁壒娈婂垽鏂�
+ //妫�娴嬬粨鏋�
+ if (this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, report) == true)
+ {
+ //缁撴灉宸茬粡鎺ユ敹鍒�
+ this.ResponeResult = 1;
+ }
}
- //妫�娴嬬粨鏋�
- if (this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, report) == true)
+ else
{
- //缁撴灉宸茬粡鎺ユ敹鍒�
- this.ResponeResult = 1;
+ if (mainKeys != mainKey2)
+ {
+ //涓嶆槸鍚屼竴涓笢瑗�
+ return;
+ }
+ //妫�娴嬬粨鏋�
+ if (this.CheckResponeResultStatu(ReceiveComandDiv.A璁惧灞炴�т笂鎶�, report) == true)
+ {
+ //缁撴灉宸茬粡鎺ユ敹鍒�
+ this.ResponeResult = 1;
+ }
}
});
}
@@ -374,7 +401,6 @@
public override void CloseFormBefore()
{
string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(this.device);
- HdlGatewayReceiveLogic.Current.RemoveEvent("DeviceDetailCardControl" + mainKeys);
HdlGatewayReceiveLogic.Current.RemoveEvent("DeviceDetailCardAttribute" + mainKeys);
//鍥炶皟鍑芥暟
--
Gitblit v1.8.0