wei
2020-12-21 1887ea937010ff8caba39622e8246a2802ca02c5
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs
@@ -341,6 +341,13 @@
        {
            //整个灰色界面
            var frameBack = new Dialog();
            var dialogBody = new FrameLayout();
            frameBack.AddChidren(dialogBody);
            dialogBody.MouseUpEventHandler = (sender, e) => {
                frameBack.Close();
            };
            frameBack.Show();
            //白色的背景(用图片整的)
@@ -378,12 +385,17 @@
            btnCozyIcon.Width = Application.GetRealWidth(24);
            btnCozyIcon.Height = Application.GetRealWidth(24);
            btnCozyIcon.UnSelectedImagePath = "FunctionIcon/Light/CozyIcon.png";
            btnCozyIcon.SelectedImagePath = "FunctionIcon/Light/CozyIconOn.png";
            frameWhite.AddChidren(btnCozyIcon);
            btnCozyIcon.MouseUpEventHandler += (sender, e) =>
            {
            {
                barColorTemplatrue.Progress = 27;
                barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
                frameBack.Close();
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
            };
            //温馨 2700k
            var btnCozy = new Button();
@@ -394,11 +406,18 @@
            btnCozy.Text = Language.StringByID(StringId.Cozy) + " 2700K";
            btnCozy.TextSize = CSS_FontSize.TextFontSize;
            btnCozy.TextColor = CSS_Color.FirstLevelTitleColor;
            btnCozy.SelectedTextColor = CSS_Color.MainColor;
            btnCozy.TextAlignment = TextAlignment.CenterLeft;
            frameWhite.AddChidren(btnCozy);
            btnCozy.MouseUpEventHandler += (sender, e) =>
            {
                barColorTemplatrue.Progress = 27;
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d); barColorTemplatrue.Progress = 27;
                barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
                frameBack.Close();
            };
@@ -410,12 +429,17 @@
            btnMeetIcon.Width = Application.GetRealWidth(24);
            btnMeetIcon.Height = Application.GetRealWidth(24);
            btnMeetIcon.UnSelectedImagePath = "FunctionIcon/Light/MeetingGuestsIcon.png";
            btnMeetIcon.SelectedImagePath = "FunctionIcon/Light/MeetingGuestsIconOn.png";
            frameWhite.AddChidren(btnMeetIcon);
            btnMeetIcon.MouseUpEventHandler += (sender, e) =>
            {
            {
                barColorTemplatrue.Progress = 30;
                barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
                frameBack.Close();
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
            };
            //会客 3000k
@@ -427,13 +451,18 @@
            btnMeet.Text = Language.StringByID(StringId.MeetingGuests) + " 3000K";
            btnMeet.TextSize = CSS_FontSize.TextFontSize;
            btnMeet.TextColor = CSS_Color.FirstLevelTitleColor;
            btnMeet.SelectedTextColor = CSS_Color.MainColor;
            btnMeet.TextAlignment = TextAlignment.CenterLeft;
            frameWhite.AddChidren(btnMeet);
            btnMeet.MouseUpEventHandler += (sender, e) =>
            {
                barColorTemplatrue.Progress = 30;
                barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
                frameBack.Close();
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
            };
            //阅读图标
@@ -443,12 +472,17 @@
            btnReadIcon.Width = Application.GetRealWidth(24);
            btnReadIcon.Height = Application.GetRealWidth(24);
            btnReadIcon.UnSelectedImagePath = "FunctionIcon/Light/ReadIcon.png";
            btnReadIcon.SelectedImagePath = "FunctionIcon/Light/ReadIconOn.png";
            frameWhite.AddChidren(btnReadIcon);
            btnReadIcon.MouseUpEventHandler += (sender, e) =>
            {
            {
                barColorTemplatrue.Progress = 65;
                barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
                frameBack.Close();
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
            };
            //阅读 6500k
            var btnRead = new Button();
@@ -458,15 +492,41 @@
            btnRead.Height = Application.GetRealWidth(24);
            btnRead.Text = Language.StringByID(StringId.Reading) + " 6500K";
            btnRead.TextSize = CSS_FontSize.TextFontSize;
            btnRead.TextColor = CSS_Color.MainColor;
            btnRead.TextColor = CSS_Color.FirstLevelTitleColor;
            btnRead.SelectedTextColor = CSS_Color.MainColor;
            btnRead.TextAlignment = TextAlignment.CenterLeft;
            frameWhite.AddChidren(btnRead);
            btnRead.MouseUpEventHandler += (sender, e) =>
            {
            {
                barColorTemplatrue.Progress = 65;
                barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
                frameBack.Close();
            };
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
            };
            btnCozy.IsSelected = false;
            btnCozyIcon.IsSelected = false;
            btnMeet.IsSelected = false;
            btnMeetIcon.IsSelected = false;
            btnRead.IsSelected = false;
            btnReadIcon.IsSelected = false;
            if (light.Attr_CCT.curValue.ToString() == "2700")
            {
                btnCozy.IsSelected = true;
                btnCozyIcon.IsSelected = true;
            }
            if (light.Attr_CCT.curValue.ToString() == "3000")
            {
                btnMeet.IsSelected = true;
                btnMeetIcon.IsSelected = true;
            }
            if (light.Attr_CCT.curValue.ToString() == "6500")
            {
                btnRead.IsSelected = true;
                btnReadIcon.IsSelected = true;
            }
        }
        /// <summary>