HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-06-10 dce6c3481a37216292724013ff9d2b75ceb82f86
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs
File was renamed from ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs
@@ -8,9 +8,9 @@
namespace Shared.Phone.MainPage.ControlForm
{
    /// <summary>
    /// 彩灯(调光器)类型的深度卡片界面
    /// 色温灯类型的深度卡片界面
    /// </summary>
    public class DeviceMiniLightDetailCardForm : DeviceDetailCardCommonForm
    public class DeviceColorTemperatureLightDetailCardForm : DeviceDetailCardCommonForm
    {
        #region ■ 变量声明___________________________
@@ -73,7 +73,7 @@
            waveSeekBar.Gravity = Gravity.CenterHorizontal;
            waveSeekBar.WavePadding = Application.GetRealWidth(8);
            waveSeekBar.MaxValue = 100;
            waveSeekBar.Progress = (int)(((DimmableLight)this.device).Level * 1.0 / MaxLevel * 100);
            waveSeekBar.Progress = (int)(((ColorTemperatureLight)this.device).Level * 1.0 / MaxLevel * 100);
            waveSeekBar.CornerRadius = Application.GetRealHeight(58);
            frameWhiteBack.AddChidren(waveSeekBar);
@@ -157,7 +157,7 @@
                else
                {
                    //如果住宅为虚拟住宅,直接改缓存
                    ((DimmableLight)this.device).Level = value * MaxLevel / 100;
                    ((ColorTemperatureLight)this.device).Level = value * MaxLevel / 100;
                    //亮度 XX
                    this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uBrightness) + "  " + HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
                }
@@ -200,8 +200,10 @@
                }
            };
            //设置初始值
            seekBar1.Progress = 34;
            btnColorView.Text = 34 * 100 + "K";
            int colorValue = ((ColorTemperatureLight)this.device).ColorTemperature;
            if (colorValue == 0) { colorValue = 3400; }
            seekBar1.Progress = colorValue / 100;
            btnColorView.Text = colorValue + "K";
            //开一个线程,监视是否滑动的滑动条,每秒检测一次
            HdlThreadLogic.Current.RunThread(() =>
@@ -216,12 +218,13 @@
                        if (nowProgressValue != oldProgressValue)
                        {
                            oldProgressValue = nowProgressValue;
                            ((DimmableLight)this.device).SetLevel((int)(oldProgressValue * MaxLevel / 100.0));
                            ((ColorTemperatureLight)this.device).SetLevel((int)(oldProgressValue * MaxLevel / 100.0));
                        }
                        //发送色温值
                        if (nowColorValue != oldColorValue)
                        {
                            oldColorValue = nowColorValue;
                            ((ColorTemperatureLight)this.device).SetColorTemperature(oldColorValue * 100);
                        }
                    }
                }
@@ -229,11 +232,12 @@
                if (nowProgressValue != oldProgressValue)
                {
                    //发送亮度值
                    ((DimmableLight)this.device).SetLevel((int)(nowProgressValue * MaxLevel / 100.0));
                    ((ColorTemperatureLight)this.device).SetLevel((int)(nowProgressValue * MaxLevel / 100.0));
                }
                if (nowColorValue != oldColorValue)
                {
                    //发送色温值
                    ((ColorTemperatureLight)this.device).SetColorTemperature(nowColorValue * 100);
                }
            });
        }
@@ -337,7 +341,7 @@
                if (this.isProgressing == false)
                {
                    //当进度值在手动变更中时,不接收推送
                    waveSeekBar.Progress = (int)(((DimmableLight)this.device).Level * 1.0 / MaxLevel * 100);
                    waveSeekBar.Progress = (int)(((ColorTemperatureLight)this.device).Level * 1.0 / MaxLevel * 100);
                }
            }
            if (isOpen == false && this.IsLightOpen == true)