| File was renamed from ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs |
| | |
| | | namespace Shared.Phone.MainPage.ControlForm
|
| | | {
|
| | | /// <summary>
|
| | | /// 彩灯(调光器)类型的深度卡片界面
|
| | | /// 色温灯类型的深度卡片界面
|
| | | /// </summary>
|
| | | public class DeviceMiniLightDetailCardForm : DeviceDetailCardCommonForm
|
| | | public class DeviceColorTemperatureLightDetailCardForm : DeviceDetailCardCommonForm
|
| | | {
|
| | | #region ■ 变量声明___________________________
|
| | |
|
| | |
| | | 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);
|
| | |
|
| | |
| | | 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));
|
| | | }
|
| | |
| | | }
|
| | | };
|
| | | //设置初始值
|
| | | 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(() =>
|
| | |
| | | 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);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | 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);
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | 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)
|