HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-04-08 4dce704aaf8587cf3f91cf88f2208315a03c4cbb
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs
@@ -75,37 +75,41 @@
            {
                //添加节能模式控件
                this.AddEnergyConservationRow();
                //添加屏幕亮度级别控件
                this.AddScreenBrightnesLevelControl();
                //添加背光灯亮度控件
                this.AddBackLightControl();
            });
            //容器补充
            FinishInitControl(listview);
                this.FinishInitControl(listview, energyModeInfo.enable);
            //保存
            var btnSave = new BottomClickButton();
            btnSave.TextID = R.MyInternationalizationString.uSave;
            bodyFrameLayout.AddChidren(btnSave);
            btnSave.ButtonClickEvent += (sender, e) =>
            {
                //保存面板数据
                this.SavePanelData();
            };
                //保存
                var btnSave = new BottomClickButton();
                btnSave.TextID = R.MyInternationalizationString.uSave;
                bodyFrameLayout.AddChidren(btnSave);
                btnSave.ButtonClickEvent += (sender, e) =>
                {
                    //保存面板数据
                    this.SavePanelData();
                };
            });
        }
        #endregion
        #region ■ 屏幕亮度级别_______________________
        #region ■ 屏幕亮度级别_______________________
        /// <summary>
        /// 添加屏幕亮度级别控件
        /// </summary>
        private void AddScreenBrightnesLevelControl()
        {
            var btnEspace = new NormalViewControl(600, 58, true);
            btnEspace.X = ControlCommonResourse.XXLeft;
            listview.AddChidren(btnEspace);
            var frameBack = new FrameLayout();
            frameBack.Height = Application.GetRealHeight(429);
            frameBack.Y = Application.GetRealHeight(58);
            frameBack.BackgroundColor = UserCenterColor.Current.White;
            listview.AddChidren(frameBack);
@@ -172,7 +176,6 @@
            btnTemp2.Text = "5";
            frameBack.AddChidren(btnTemp2);
        }
        #endregion
        #region ■ 背光灯亮度_________________________
@@ -182,6 +185,10 @@
        /// </summary>
        private void AddBackLightControl()
        {
            var btnEspace = new NormalViewControl(600, 58, true);
            btnEspace.X = ControlCommonResourse.XXLeft;
            listview.AddChidren(btnEspace);
            //背景
            var frameBack = new FrameLayout();
            frameBack.Y = Application.GetRealHeight(490);
@@ -310,8 +317,7 @@
        #endregion
        #region ■ 节能模式行_________________________
        #region ■ 节能模式行_________________________
        /// <summary>
        ///  添加节能模式行
        /// </summary>
@@ -402,9 +408,9 @@
                //展开或者缩小的高度
                var value = Application.GetRealHeight(443);
                frameBack.Height += value;
                //添加接近感应
                this.AddProximitySensorsRow(frameBack);
            }
            }
            //添加接近感应
            this.AddProximitySensorsRow(frameBack);
        }
        #endregion
@@ -498,37 +504,39 @@
        private async void SavePanelData()
        {
            this.ShowProgressBar();
            //亮度调节更改(他们说随便一个回路就行)
            var result = await HdlDevicePanelLogic.Current.SetDeviceLightSettion(panelDevice, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel);
            if (result == false)
            {
                this.CloseProgressBar();
                return;
            }
            //节能模式修改(他们说随便一个回路就行)
            //设备同事说默认去秒时间,这样接近感应功能才合理
            energyModeInfo.time = 1;
            result = await HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level);
            var result = await HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level);
            if (result == false)
            {
                this.CloseProgressBar();
                return;
            }
            //接近修改(他们说随便一个回路就行)
            //接近感应(他们说随便一个回路就行)
            result = await HdlDevicePanelLogic.Current.SetProximitySensorStatus(panelDevice, proximitySensorsInfo.enable);
            if (result == false)
            {
                this.CloseProgressBar();
                return;
            }
            //亮度调节更改(他们说随便一个回路就行)
            //var result = await HdlDevicePanelLogic.Current.SetDeviceLightSettion(panelDevice, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel);
            //if (result == false)
            //{
            //    this.CloseProgressBar();
            //    return;
            //}
            //设置按键面板指定端点的【指示灯开关颜色】的信息
            result = await HdlDevicePanelLogic.Current.SetPanelEpointColorInfo(panelDevice, this.keyColorData);
            this.CloseProgressBar();
            if (result == false)
            {
                return;
            }
            //result = await HdlDevicePanelLogic.Current.SetPanelEpointColorInfo(panelDevice, this.keyColorData);
            //this.CloseProgressBar();
            //if (result == false)
            //{
            //    return;
            //}
            //关闭自身
            this.CloseForm();
        }