xm
2021-12-01 6d73bf6e816570291865674bef8bce8972e4de3f
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs
@@ -37,7 +37,7 @@
        /// <summary>
        /// 渐变时间修改
        /// </summary>
        //DiyImageSeekBar barFadeTime;
        DiyImageSeekBar barFadeTime;
        /// <summary>
        /// 色温的滑动控件
        /// </summary>
@@ -170,13 +170,88 @@
                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                Text = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)) + "%",
            };
            controlView.AddChidren(btnBrightnessText);
            controlView.AddChidren(btnBrightnessText);
            #region 渐变时间调节
            if (function.GetAttribute(FunctionAttributeKey.FadeTime) != null)
            {
                var btnGradualChangeText = new Button()
                {
                    X = Application.GetRealWidth(35),
                    Y = Application.GetRealHeight(306 + 40),
                    Width = Application.GetRealWidth(224),
                    Height = Application.GetRealHeight(21),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                    TextID = StringId.SpeedOfChange,
                };
                controlView.AddChidren(btnGradualChangeText);
                var btnGradualChangeMinValuesText = new Button()
                {
                    X = Application.GetRealWidth(35),
                    Y = btnGradualChangeText.Bottom + Application.GetRealHeight(5),
                    Width = Application.GetRealWidth(22),
                    Height = Application.GetRealHeight(21),
                    Text = "0s",
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.PromptingColor1,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                };
                controlView.AddChidren(btnGradualChangeMinValuesText);
                barFadeTime = new DiyImageSeekBar()
                {
                    X = btnGradualChangeMinValuesText.Right,
                    Y = Application.GetRealHeight(360),
                    Width = Application.GetRealWidth(210),
                    Height = Application.GetRealHeight(54),
                    SeekBarViewHeight = Application.GetRealHeight(8),
                    ThumbImagePath = "Public/ThumbImage.png",
                    ThumbImageHeight = Application.GetRealHeight(54),
                    ProgressBarColor = CSS_Color.MainColor,
                    ProgressTextColor = CSS_Color.FirstLevelTitleColor,
                    ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                    ProgressBarUnitSring = "s",
                    MaxValue = 10,
                    Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.FadeTime)),
                    SeekBarPadding = Application.GetRealWidth(20),
                };
                controlView.AddChidren(barFadeTime);
                var btnGradualChangeMaxValuesText = new Button()
                {
                    X = barFadeTime.Right,
                    Y = btnGradualChangeText.Bottom + Application.GetRealHeight(5),
                    Width = Application.GetRealWidth(35),
                    Height = Application.GetRealHeight(21),
                    Text = "10s",
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.PromptingColor1,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                };
                controlView.AddChidren(btnGradualChangeMaxValuesText);
            }
            #endregion
            #region 色温
            var cctAttr = function.GetAttribute(FunctionAttributeKey.CCT);
            if(cctAttr.min == 0)
            {
                cctAttr.min = 2700;
            }
            if(cctAttr.max == 0)
            {
                cctAttr.max = 6500;
            }
            //色温
            var btnTempClolor = new Button();
            btnTempClolor.X = Application.GetRealWidth(35);
            btnTempClolor.Y = Application.GetRealHeight(306 + 60);
            btnTempClolor.Y = Application.GetRealHeight(395);
            btnTempClolor.Width = Application.GetRealWidth(224);
            btnTempClolor.Height = Application.GetRealHeight(21);
            btnTempClolor.TextAlignment = TextAlignment.CenterLeft;
@@ -185,12 +260,13 @@
            btnTempClolor.TextID = StringId.ColorTemperature;
            controlView.AddChidren(btnTempClolor);
            //2700K
            var btnTempClolorMin = new Button();
            btnTempClolorMin.Y = btnTempClolor.Bottom + Application.GetRealHeight(9);
            btnTempClolorMin.Width = Application.GetRealWidth(54);
            btnTempClolorMin.Height = Application.GetRealHeight(21);
            btnTempClolorMin.Text = "2700K";
            btnTempClolorMin.Text = cctAttr.min + "K";
            btnTempClolorMin.TextAlignment = TextAlignment.CenterRight;
            btnTempClolorMin.TextColor = CSS_Color.PromptingColor1;
            btnTempClolorMin.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
@@ -208,8 +284,8 @@
            barColorTemplatrue = new CCTSeekBarControl();
            barColorTemplatrue.X = btnTempClolorMin.Right;
            barColorTemplatrue.Y = Application.GetRealHeight(340);
            barColorTemplatrue.MinValue = 27;
            barColorTemplatrue.MaxValue = 65;
            barColorTemplatrue.MinValue = cctAttr.min /100;
            barColorTemplatrue.MaxValue = cctAttr.max / 100;
            barColorTemplatrue.ProgressBarColor = 0x00000000;//全部透明
            barColorTemplatrue.ProgressBarUnEnableColor = 0x00000000;
            barColorTemplatrue.SeekBarBackgroundColor = 0x00000000;
@@ -232,72 +308,12 @@
            btnTempClolorMax.X = barColorTemplatrue.Right;
            btnTempClolorMax.Width = Application.GetRealWidth(54);
            btnTempClolorMax.Height = Application.GetRealHeight(21);
            btnTempClolorMax.Text = "6500K";
            btnTempClolorMax.Text = cctAttr.max + "K";
            btnTempClolorMax.TextAlignment = TextAlignment.CenterLeft;
            btnTempClolorMax.TextColor = CSS_Color.PromptingColor1;
            btnTempClolorMax.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
            controlView.AddChidren(btnTempClolorMax);
            #endregion
            #region 渐变时间调节
            //var btnGradualChangeText = new Button()
            //{
            //    X = Application.GetRealWidth(35),
            //    Y = Application.GetRealHeight(385),
            //    Width = Application.GetRealWidth(224),
            //    Height = Application.GetRealHeight(21),
            //    TextAlignment = TextAlignment.CenterLeft,
            //    TextColor = CSS_Color.FirstLevelTitleColor,
            //    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            //    TextID = StringId.SpeedOfChange,
            //};
            //controlView.AddChidren(btnGradualChangeText);
            //var btnGradualChangeMinValuesText = new Button()
            //{
            //    X = Application.GetRealWidth(35),
            //    Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
            //    Width = Application.GetRealWidth(22),
            //    Height = Application.GetRealHeight(21),
            //    Text = "0s",
            //    TextAlignment = TextAlignment.CenterLeft,
            //    TextColor = CSS_Color.PromptingColor1,
            //    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            //};
            //controlView.AddChidren(btnGradualChangeMinValuesText);
            //barFadeTime = new DiyImageSeekBar()
            //{
            //    X = btnGradualChangeMinValuesText.Right,
            //    Y = Application.GetRealHeight(412 - 21) + Application.GetRealHeight(8),
            //    Width = Application.GetRealWidth(210),
            //    Height = Application.GetRealHeight(54),
            //    SeekBarViewHeight = Application.GetRealHeight(8),
            //    ThumbImagePath = "Public/ThumbImage.png",
            //    ThumbImageHeight = Application.GetRealHeight(54),
            //    ProgressBarColor = CSS_Color.MainColor,
            //    ProgressTextColor = CSS_Color.FirstLevelTitleColor,
            //    ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            //    ProgressBarUnitSring = "s",
            //    MaxValue = 10,
            //    Progress = function.fadeTime,
            //    SeekBarPadding = Application.GetRealWidth(20),
            //};
            //controlView.AddChidren(barFadeTime);
            //var btnGradualChangeMaxValuesText = new Button()
            //{
            //    X = barFadeTime.Right,
            //    Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
            //    Width = Application.GetRealWidth(35),
            //    Height = Application.GetRealHeight(21),
            //    Text = "10s",
            //    TextAlignment = TextAlignment.CenterLeft,
            //    TextColor = CSS_Color.PromptingColor1,
            //    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            //};
            //controlView.AddChidren(btnGradualChangeMaxValuesText);
            #endregion
            btnSwitch = new Button()