陈嘉乐
2020-07-10 48ba446936b51fffafa7c3600c0dadc6ac0e8c20
ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs
@@ -20,6 +20,10 @@
        /// 动作信息  1 开关/ 3亮度调节
        /// </summary>
        private Dictionary<int, Safeguard.TaskListInfo> dicTaskinfo = new Dictionary<int, Safeguard.TaskListInfo>();
        /// <summary>
        /// 进度条最大值
        /// </summary>
        private int MaxValue = 254;
        #endregion
@@ -131,29 +135,24 @@
            detailBackFrame.AddChidren(btnPersent);
            if (dicTaskinfo.ContainsKey(3) == true)
            {
                btnPersent.Text = dicTaskinfo[3].Data1 + "%";
                btnPersent.Text = ((int)(dicTaskinfo[3].Data1 * 1.0 / MaxValue * 100)) + "%";
            }
            //进度条
            var seekBar = new HorizontalSeekBar();
            seekBar.Enable = false;
            var seekBar = new SeekBarControl(919);
            seekBar.Y = Application.GetRealHeight(268);
            seekBar.Gravity = Gravity.CenterHorizontal;
            seekBar.Width = Application.GetRealWidth(919);
            seekBar.Height = Application.GetRealHeight(89);
            seekBar.Max = 100;
            seekBar.BackgroundColor = 0xfff5f5f5;
            seekBar.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
            seekBar.ProgressColor = 0xfffdb500;
            seekBar.ProgressBarColor = 0xfffdb500;
            seekBar.MaxValue = this.MaxValue;
            seekBar.Enable = false;
            if (dicTaskinfo.ContainsKey(3) == true)
            {
                //3:亮度调节
                seekBar.Progress = dicTaskinfo[3].Data1;
            }
            detailBackFrame.AddChidren(seekBar);
            seekBar.ProgressChanged += (sender, value) =>
            seekBar.ProgressChangedEvent += (div, value) =>
            {
                btnPersent.Text = value + "%";
                btnPersent.Text = ((int)(value * 1.0 / MaxValue * 100)) + "%";
            };
            //线
@@ -196,7 +195,6 @@
                    btnOpenSelect.Visible = false;
                    btnOpen.TextColor = UserCenterColor.Current.TextGrayColor3;
                    seekBar.Enable = false;
                    seekBar.ProgressColor = 0xffe8e8e8;
                    dicTaskinfo.Remove(1);
                }
@@ -209,10 +207,9 @@
                    //开 可用
                    btnOpen.TextColor = UserCenterColor.Current.TextColor1;
                    seekBar.Enable = true;
                    seekBar.ProgressColor = 0xfffdb500;
                    if (seekBar.Progress == 0)
                    {
                        seekBar.Progress = 100;
                        seekBar.Progress = MaxValue;
                        btnPersent.Text = "100%";
                    }
@@ -247,7 +244,6 @@
                    //开 不可用
                    btnOpen.TextColor = UserCenterColor.Current.TextGrayColor3;
                    seekBar.Enable = false;
                    seekBar.ProgressColor = 0xffe8e8e8;
                    dicTaskinfo[1] = new Safeguard.TaskListInfo();
                    dicTaskinfo[1].TaskType = 1;
@@ -290,13 +286,11 @@
                dicTaskinfo = null;
                //获取状态的显示文本
                string statuText = HdlSafeguardLogic.Current.GetLightAlarmStatuText(listData);
                string statuText = HdlSafeguardLogic.Current.GetAdjustTargetStatuText(listData);
                this.FinishSelectEvent?.Invoke(statuText, listData);
                this.CloseForm();
            };
            //动画效果
            frameTransparent.Animate = Animate.DownToUp;
        }
        #endregion