From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码
---
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
index c30c0e5..4c219f0 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
@@ -31,10 +31,6 @@
/// </summary>
private SeekBarControl seekBarColor = null;
/// <summary>
- /// MaxLevel
- /// </summary>
- private const int MaxLevel = 254;
- /// <summary>
/// 浜害杩涘害鍊兼槸鍚﹀湪鏀瑰彉涓�
/// </summary>
private bool isLightProgressing = false;
@@ -98,7 +94,7 @@
seekBarLight.ProgressTextSize = 14;
seekBarLight.ProgressTextColor = UserCenterColor.Current.TextGrayColor2;
seekBarLight.Gravity = Gravity.Frame;
- seekBarLight.Progress = (int)(((ColorTemperatureLight)this.device).Level * 1.0 / MaxLevel * 100);
+ seekBarLight.Progress = HdlDeviceCommonLogic.Current.CalculateLightLevelPersent(((ColorTemperatureLight)this.device).Level);
frameWhiteBack.AddChidren(seekBarLight);
//鑹叉俯
@@ -226,7 +222,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));
}
@@ -281,7 +277,7 @@
if (nowLightValue != oldLightValue)
{
oldLightValue = nowLightValue;
- ((ColorTemperatureLight)this.device).SetLevel((int)(oldLightValue * MaxLevel / 100.0));
+ ((ColorTemperatureLight)this.device).SetLevel(HdlDeviceCommonLogic.Current.CalculateLightLevel(oldLightValue));
}
//鍙戦�佽壊娓╁��
if (nowColorValue != oldColorValue)
@@ -295,7 +291,7 @@
if (nowLightValue != oldLightValue)
{
//鍙戦�佷寒搴﹀��
- ((ColorTemperatureLight)this.device).SetLevel((int)(nowLightValue * MaxLevel / 100.0));
+ ((ColorTemperatureLight)this.device).SetLevel(HdlDeviceCommonLogic.Current.CalculateLightLevel(nowLightValue));
}
if (nowColorValue != oldColorValue)
{
@@ -354,7 +350,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
{
@@ -493,7 +489,11 @@
if (this.isLightProgressing == false)
{
//褰撹繘搴﹀�煎湪鎵嬪姩鍙樻洿涓椂,涓嶆帴鏀舵帹閫�
- seekBarLight.Progress = (int)(((ColorTemperatureLight)this.device).Level * 1.0 / MaxLevel * 100);
+ int progress = HdlDeviceCommonLogic.Current.CalculateLightLevelPersent(((ColorTemperatureLight)this.device).Level);
+ if (seekBarLight.Progress != progress)
+ {
+ seekBarLight.Progress = progress;
+ }
}
if (this.isColorProgressing == false)
{
--
Gitblit v1.8.0