陈嘉乐
2020-05-19 0e0584b87851c56745bf73b1a961b80613dd0721
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs
@@ -70,6 +70,7 @@
            listview = new VerticalScrolViewLayout();
            listview.Height = Application.GetRealHeight(1981 - 184);
            bodyFrameLayout.AddChidren(listview);
            listview.ScrollEnabled = false;
            HdlThreadLogic.Current.RunMain(() =>
            {
@@ -79,10 +80,8 @@
                //添加屏幕亮度级别控件
                this.AddScreenBrightnesLevelControl();
                //添加背光灯亮度控件【暂时不需要,可能后期新风面板的这个颜色要补回来】
                this.AddBackLightControl();
                //【暂时不需要,可能后期新风面板的这个颜色要补回来】
                //this.FinishInitControl(listview, energyModeInfo.enable);
                //添加新风面板的颜色
                this.AddColorControl();
                //保存
                var btnSave = new BottomClickButton();
@@ -262,7 +261,7 @@
        /// <summary>
        /// 添加背光颜色控件
        /// </summary>
        private void AddBackLightControl()
        private void AddColorControl()
        {
            var btnEspace = new NormalViewControl(600, 58, true);
            btnEspace.X = ControlCommonResourse.XXLeft;
@@ -331,20 +330,44 @@
            frameColor.ButtonClickEvent += (sender, e) =>
            {
                var form = new PanelColorSelectForm();
                form.AddForm(R1, G1, B1);
                form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
                {
                    R1 = Rcolor;
                    G1 = Gcolor;
                    B1 = Bcolor;
                PanelColor(btnColor, R1, G1, B1);
            };
            btnColorView.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, R1, G1, B1);
            };
            btnColor.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, R1, G1, B1);
            };
            btnColorLine.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, R1, G1, B1);
            };
            btnRight.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, R1, G1, B1);
            };
        }
                    this.keyColorData.OpenColorR = Convert.ToString(Rcolor, 16);
                    this.keyColorData.OpenColorG = Convert.ToString(Gcolor, 16);
                    this.keyColorData.OpenColorB = Convert.ToString(Bcolor, 16);
        /// <summary>
        /// PanelColorSelectForm
        /// </summary>
        private void PanelColor(NormalViewControl btnColor, int R1, int G1, int B1)
        {
            var form = new PanelColorSelectForm();
            form.AddForm(R1, G1, B1);
            form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
            {
                R1 = Rcolor;
                G1 = Gcolor;
                B1 = Bcolor;
                    btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
                };
                this.keyColorData.OpenColorR = Convert.ToString(Rcolor, 16);
                this.keyColorData.OpenColorG = Convert.ToString(Gcolor, 16);
                this.keyColorData.OpenColorB = Convert.ToString(Bcolor, 16);
                btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
            };
        }
@@ -382,8 +405,6 @@
                {
                    frameBack.Height -= value;
                }
                //容器补充
                this.FinishInitControl(listview, energyModeInfo.enable);
            };
            if (energyModeInfo.enable == true)
            {
@@ -491,7 +512,7 @@
            //开启进度条
            this.ShowProgressBar();
            //亮度调节(他们说随便拿一路回路就行了)
            linghtLevelInfo = await HdlDevicePanelLogic.Current.GetDeviceLightSettion(panelDevice);
            linghtLevelInfo = HdlDevicePanelLogic.Current.GetDeviceLightSettion(panelDevice);
            if (linghtLevelInfo == null)
            {
                //关闭进度条
@@ -507,14 +528,14 @@
                return false;
            }
            //节能模式(他们说随便拿一路回路就行了)
            energyModeInfo = await HdlDevicePanelLogic.Current.GetDeviceEnergyConservationMode(panelDevice);
            energyModeInfo = HdlDevicePanelLogic.Current.GetDeviceEnergyConservationMode(panelDevice);
            if (energyModeInfo == null)
            {
                //关闭进度条
                this.CloseProgressBar(ShowReLoadMode.YES);
                return false;
            }
            keyColorData = await HdlDevicePanelLogic.Current.GetPanelEpointColorInfo(panelDevice);
            keyColorData = HdlDevicePanelLogic.Current.GetPanelColorInfo(panelDevice);
            if (this.keyColorData == null)
            {
                //关闭进度条
@@ -541,7 +562,7 @@
            //节能模式修改(他们说随便一个回路就行)
            //设备同事说新风面板默认60秒时间,这样接近感应功能才合理
            energyModeInfo.time = 60;
            var result = await HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level);
            var result = HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level);
            if (result == false)
            {
                this.CloseProgressBar();
@@ -556,7 +577,7 @@
            }
            //亮度调节更改(他们说随便一个回路就行)
            result = await HdlDevicePanelLogic.Current.SetDeviceLightSettion(panelDevice, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel);
            result = HdlDevicePanelLogic.Current.SetDeviceLightSettion(panelDevice, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel);
            if (result == false)
            {
                this.CloseProgressBar();
@@ -564,7 +585,7 @@
            }
            //设置按键面板颜色的信息
            result = await HdlDevicePanelLogic.Current.SetPanelColorInfo(panelDevice, this.keyColorData);
            result = HdlDevicePanelLogic.Current.SetPanelColorInfo(panelDevice, this.keyColorData);
            this.CloseProgressBar();
            if (result == false)
            {