From 6fe1c5ebeb8312edc479a4576f05d80c5051a6c6 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 19 七月 2023 19:47:00 +0800
Subject: [PATCH] 炫彩功能优化

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs |   97 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 95 insertions(+), 2 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
index e828e1a..8b698be 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
@@ -56,6 +56,87 @@
             #region  缂栬緫璁惧鐘舵��
             switch (device.spk)
             {
+                //缇ゆ帶
+                case SPK.GroupControl:
+                    int bottom = 50;
+                    int attributesNameId=0;
+                    int count = 0;
+                    foreach (var attr in (device as GroupControl).attributes)
+                    {
+                        if (attr.key == FunctionAttributeKey.OnOff ||
+                            attr.key == FunctionAttributeKey.Brightness ||
+                            attr.key == FunctionAttributeKey.CCT ||
+                            attr.key == FunctionAttributeKey.RGB ||
+                            attr.key == FunctionAttributeKey.Colorful)
+                        {
+                            LogicView.FunTypeView view = new LogicView.FunTypeView();
+                            view.btnState.Name = "缇ゆ帶";
+                            view.frameLayout.Y = count * Application.GetRealHeight(50);
+                            fLayout.AddChidren(view.FLayoutView());
+                            count++;
+                            switch (attr.key)
+                            {
+                                case FunctionAttributeKey.OnOff:
+                                    attributesNameId = StringId.switchLogic;
+                                    ///寮�鍏崇偣鍑讳簨浠�
+                                    view.btnClick.MouseUpEventHandler += (sender, e) =>
+                                    {
+                                        SwitchViewMethod(device, view.btnState, 2);
+                                    };
+                                    break;
+                                case FunctionAttributeKey.Brightness:
+                                    attributesNameId = StringId.brightnesLogic;
+                                    view.btnState.Text = "5%";//浜у搧缁忕悊鏅撹緣瑕佹眰鏀圭殑 2021-11-06
+                                    ///浜害鐐瑰嚮浜嬩欢
+                                    view.btnClick.MouseUpEventHandler += (sender, e) =>
+                                    {
+                                        BrightnessMethod(device, view.btnState, view.btnText.Text);
+
+                                    };
+                                    break;
+                                case FunctionAttributeKey.CCT:
+                                    attributesNameId = StringId.ColorTemperature;
+                                    ///鑹叉俯鐐瑰嚮浜嬩欢
+                                    view.btnClick.MouseUpEventHandler += (sender, e) =>
+                                    {
+                                        ColorTemperatureMethod(device, view.btnState, view.btnText.Text);
+
+                                    };
+                                    break;
+                                case FunctionAttributeKey.RGB:
+                                    attributesNameId = StringId.rgbsepan;
+                                    view.btnState.Tag = "";
+                                    view.btnState.Width = Application.GetRealWidth(16);
+                                    view.btnState.Height = Application.GetRealWidth(16);
+                                    view.btnState.Radius = (uint)Application.GetRealWidth(8);
+                                    view.btnState.X = Application.GetRealWidth(375 - 48 - 16);
+                                    ///RGB鑹茬洏鐐瑰嚮浜嬩欢
+                                    view.btnClick.MouseUpEventHandler += (sender, e) =>
+                                    {
+                                        RgbColorDiskMethod(device, view.btnState, view.btnText.Text);
+                                    };
+                                    break;
+                                case FunctionAttributeKey.Colorful:
+                                    attributesNameId = StringId.ColorfulFunction;
+                                    ///寮�鍏崇偣鍑讳簨浠�
+                                    view.btnClick.MouseUpEventHandler += (sender, e) =>
+                                    {
+                                        SwitchViewMethod(device, view.btnState, 2);
+                                    };
+                                    break;
+                            }
+                            view.btnText.TextID = attributesNameId;
+                            if (edit)
+                            {
+                                //鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬�
+                                GetEditDeviceState(device, index, view.btnState, null, null, null);
+                            }
+                        }
+                    }
+
+                    //璁惧寤舵椂iewv
+                    DelayView(fLayout, Application.GetRealHeight(50)* count);
+                    break;
                 //鎻掑骇(鏈塙SB)
                 case SPK.PanelSocket:
                     {
@@ -168,8 +249,7 @@
                         ///RGB鑹茬洏
                         LogicView.FunTypeView rgbView = new LogicView.FunTypeView();
                         rgbView.frameLayout.Y = brightnessView.frameLayout.Bottom;
-                        //rgbView.btnText.TextID = StringId.brightnesLogic;
-                        rgbView.btnText.Text= "RGB鑹茬洏";
+                        rgbView.btnText.TextID = StringId.rgbsepan;
                         rgbView.btnState.Tag = "";
                         rgbView.btnState.Width = Application.GetRealWidth(16);
                         rgbView.btnState.Height = Application.GetRealWidth(16);
@@ -815,6 +895,11 @@
                                 }
                             }
                             break;
+                        case SPK.GroupControl:
+                            {
+                                outputDevice.target_type = "5";
+                            }
+                            break;
 
                     }
                     outputDevice.status.AddRange(dicSateteList);
@@ -929,6 +1014,11 @@
                             }
                         }
                         break;
+                    case SPK.GroupControl:
+                        {
+                            keyVlaue = "colorful";
+                        }
+                        break;
                 }
                 //鏁版嵁灏佽
                 AddDictionary(keyVlaue, strValue);
@@ -960,6 +1050,7 @@
                     case SPK.LightRGB:
                     case SPK.LightRGBW:
                     case SPK.LightCCT:
+                    case SPK.GroupControl:
                         {
                             keyVlaue = "brightness";
                         }
@@ -1004,6 +1095,7 @@
                 switch (device.spk)
                 {
                     case SPK.LightCCT:
+                    case SPK.GroupControl:
                         {
                             keyVlaue = "cct";
                         }
@@ -1037,6 +1129,7 @@
                 switch (device.spk)
                 {
                     case SPK.LightRGB:
+                    case SPK.GroupControl:
                         {
                             keyVlaue = "rgb";
                         }

--
Gitblit v1.8.0