From 351bdda734832d821a9764b0cde8be5d83c4ec50 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期四, 01 十二月 2022 09:56:25 +0800
Subject: [PATCH] 2022年12月01日09:56:23
---
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs
index f0464ee..89c017a 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs
@@ -19,10 +19,6 @@
/// </summary>
private List<ButtonBase> listControl = new List<ButtonBase>();
/// <summary>
- /// MaxLevel
- /// </summary>
- private const int MaxLevel = 254;
- /// <summary>
/// 褰╃伅鎺т欢
/// </summary>
private WaveSeekBar waveSeekBar = null;
@@ -77,7 +73,7 @@
waveSeekBar.Gravity = Gravity.CenterHorizontal;
waveSeekBar.WavePadding = Application.GetRealWidth(8);
waveSeekBar.MaxValue = 100;
- waveSeekBar.Progress = (int)(((ColorTemperatureLight)this.device).Level * 1.0 / MaxLevel * 100);
+ waveSeekBar.Progress = HdlDeviceCommonLogic.Current.CalculateLightLevelPersent(((ColorTemperatureLight)this.device).Level);
waveSeekBar.CornerRadius = Application.GetRealHeight(58);
if (this.IsLightOpen == true)
{
@@ -155,7 +151,7 @@
else
{
//濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴鏀圭紦瀛�
- ((ColorTemperatureLight)this.device).Level = value * MaxLevel / 100;
+ ((ColorTemperatureLight)this.device).Level = HdlDeviceCommonLogic.Current.CalculateLightLevel(value);
//浜害 XX
this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uBrightness) + " " + HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
}
@@ -216,7 +212,7 @@
if (nowProgressValue != oldProgressValue)
{
oldProgressValue = nowProgressValue;
- ((ColorTemperatureLight)this.device).SetLevel((int)(oldProgressValue * MaxLevel / 100.0));
+ ((ColorTemperatureLight)this.device).SetLevel(HdlDeviceCommonLogic.Current.CalculateLightLevel(oldProgressValue));
}
//鍙戦�佽壊娓╁��
if (nowColorValue != oldColorValue)
@@ -230,7 +226,7 @@
if (nowProgressValue != oldProgressValue)
{
//鍙戦�佷寒搴﹀��
- ((ColorTemperatureLight)this.device).SetLevel((int)(nowProgressValue * MaxLevel / 100.0));
+ ((ColorTemperatureLight)this.device).SetLevel(HdlDeviceCommonLogic.Current.CalculateLightLevel(nowProgressValue));
}
if (nowColorValue != oldColorValue)
{
@@ -292,7 +288,7 @@
if (level == 0)
{
//濡傛灉褰撳墠鏄墦寮�鐘舵��,骞朵笖浜害涓�0鐨勮瘽,鍒欓渶瑕佸彉鎴�100%浜害
- this.device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, this.device, new object[] { 254 });
+ this.device.GetType().InvokeMember("SetLevel", System.Reflection.BindingFlags.InvokeMethod, null, this.device, new object[] { 255 });
}
else
{
@@ -366,7 +362,11 @@
if (this.isProgressing == false)
{
//褰撹繘搴﹀�煎湪鎵嬪姩鍙樻洿涓椂,涓嶆帴鏀舵帹閫�
- waveSeekBar.Progress = (int)(((ColorTemperatureLight)this.device).Level * 1.0 / MaxLevel * 100);
+ int progress = HdlDeviceCommonLogic.Current.CalculateLightLevelPersent(((ColorTemperatureLight)this.device).Level);
+ if (waveSeekBar.Progress != progress)
+ {
+ waveSeekBar.Progress = progress;
+ }
}
this.IsLightOpen = isOpen;
--
Gitblit v1.8.0