From cbc156bc38d8b8eae7aef60cb186ab2b52fa701f Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期二, 16 七月 2024 13:59:56 +0800
Subject: [PATCH] 增加全部挂断

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs |   68 ++++++++++++++++++++-------------
 1 files changed, 41 insertions(+), 27 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
index ba94b4d..52ec4a5 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
@@ -1,5 +1,6 @@
 锘縰sing System;
 using System.Collections.Generic;
+using HDL_ON.Entity;
 using Shared;
 namespace HDL_ON.UI.UI2.Intelligence.Automation
 {
@@ -29,15 +30,8 @@
             };
             this.AddChidren(viewLayout);
             #region 鍔熻兘
-            //鍔熻兘
-            LogicView.SelectTypeView functionView = new LogicView.SelectTypeView();
-            functionView.btnText.TextID = StringId.funLogic;
-            functionView.btnIcon.UnSelectedImagePath = "LogicIcon/functionicon.png";
-            viewLayout.AddChidren(functionView.FLayoutView());
-
             //鍦烘櫙
             LogicView.SelectTypeView sceneView= new LogicView.SelectTypeView();
-            sceneView.frameLayout.Y = functionView.frameLayout.Bottom;
             sceneView.btnText.TextID = StringId.Scenes;
             sceneView.btnIcon.UnSelectedImagePath = "LogicIcon/scene.png";
             viewLayout.AddChidren(sceneView.FLayoutView());
@@ -55,18 +49,38 @@
             delayView.btnText.TextID = StringId.delayLogic;
             delayView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png";
             //viewLayout.AddChidren(delayView.FLayoutView());
+
+
+
+            var colorfulRgbList = FunctionList.List.GetLightList().FindAll((obj) => obj.spk == SPK.LightRGB
+            && obj.GetAttributes().Contains(FunctionAttributeKey.Colorful));
+            //var seriesList = FunctionList.List.GetSeries();
+            if (colorfulRgbList.Count > 0 || FunctionList.List.GetSeries().Count>0)
+            {
+                LogicView.SelectTypeView seriesView = new LogicView.SelectTypeView();
+                seriesView.frameLayout.Y = securityView.frameLayout.Bottom;
+                seriesView.btnText.TextID = StringId.HorseRaceLamp;
+                seriesView.btnIcon.UnSelectedImagePath = "FunctionIcon/Icon/HorseRaceLampIcon.png";
+                viewLayout.AddChidren(seriesView.FLayoutView());
+                seriesView.btnClick.MouseUpEventHandler = (sender, e) =>
+                {
+                    var settingPage = new LogicSeriesSettingPage();
+                    MainPage.BasePageView.AddChidren(settingPage);
+                    settingPage.LoadPage(colorfulRgbList);
+                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+
+                };
+                new FunTpye(LogicMethod.target_if).FunTypeView(viewLayout, seriesView.frameLayout.Bottom, 3);
+            }
+            else
+            {
+                ////鍔熻兘
+                ///浜у搧缁忕悊鍚涚剷瑕佹眰锛岃澶囧姛鑳界Щ鍒拌繖閲屻��<2022-3-7>
+                new FunTpye(LogicMethod.target_if).FunTypeView(viewLayout, securityView.frameLayout.Bottom, 2);
+            }
             #endregion
 
             #region  鎵�鏈夌偣鍑讳簨浠�
-            //鍔熻兘鐐瑰嚮浜嬩欢
-            functionView.btnClick.MouseUpEventHandler += (sen, e) =>
-            {
-                FunTpye funTpye = new FunTpye();
-                MainPage.BasePageView.AddChidren(funTpye);
-                funTpye.Show(LogicMethod.target_if);
-                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-
-            };
             //鍦烘櫙鐐瑰嚮浜嬩欢
             sceneView.btnClick.MouseUpEventHandler += (sen, e) =>
             {
@@ -102,14 +116,14 @@
         /// </summary>
         public void SceneMethod()
         {
-            var sceneList = LogicMethod.CurrLogicMethod.GetSceneList();
+            var sceneList = LogicMethod.Current.GetSceneList();
             List<string> nameList = new List<string>();
             for (int i = 0; i < sceneList.Count; i++) {
                 var scene = sceneList[i];
                 nameList.Add(scene.name);
             }
             PublicInterface publicInterface = new PublicInterface();
-            publicInterface.FrameOrVv(this, nameList,new List<string> { }, StringId.addSceneLogic, (index) =>
+            publicInterface.FrameOrVv(this, nameList,new List<string> { },Language.StringByID(StringId.addSceneLogic), (index) =>
             {
                 var sceneSelecetd = sceneList[index];
                 Output outputDevice = new Output();
@@ -118,7 +132,7 @@
                 //娌″暐浣滅敤锛屼负浜嗗彂閫佹暟鎹牸寮忕粺涓�;
                 outputDevice.status = new List<Dictionary<string, string>> { new Dictionary<string, string> { { "key", "scene" }, { "value", "0" } } };
                 AddOutput(outputDevice);
-                LogicMethod.CurrLogicMethod.RemoveAllView();
+                LogicMethod.Current.RemoveAllView();
                 AddLogic addLogic = new AddLogic();
                 MainPage.BasePageView.AddChidren(addLogic);
                 addLogic.Show();
@@ -133,10 +147,10 @@
             List<string> stateList = new List<string>();
             if (edit&& index1 != -1) {
                 Output output = Logic.currlogic.output[index1];
-                var security = LogicMethod.CurrLogicMethod.GetSecurity(output.sid);
+                var security = LogicMethod.Current.GetSecurity(output.sid);
                 stateList.Add(security.name);
             }
-            var securityList = LogicMethod.CurrLogicMethod.GetSecurityList(); 
+            var securityList = LogicMethod.Current.GetSecurityList(); 
             List<string> nameList = new List<string>();
             for (int i = 0; i < securityList.Count; i++)
             {
@@ -144,7 +158,7 @@
                 nameList.Add(security.name); 
             }
             PublicInterface publicInterface = new PublicInterface();
-            publicInterface.FrameOrVv(frameLayout, nameList, stateList, StringId.addSecurityLogic,(index) =>
+            publicInterface.FrameOrVv(frameLayout, nameList, stateList,Language.StringByID(StringId.addSecurityLogic),(index) =>
             {
                 var securitySelecetd = securityList[index];
                 Output outputDevice = new Output();
@@ -153,7 +167,7 @@
                 //娌″暐浣滅敤锛屼负浜嗗彂閫佹暟鎹牸寮忕粺涓�;
                 outputDevice.status = new List<Dictionary<string, string>> { new Dictionary<string, string> { { "key", "security" }, { "value", "0" } } };
                 AddOutput(outputDevice,true);
-                LogicMethod.CurrLogicMethod.RemoveAllView();
+                LogicMethod.Current.RemoveAllView();
                 AddLogic addLogic = new AddLogic();
                 MainPage.BasePageView.AddChidren(addLogic);
                 addLogic.Show();
@@ -219,11 +233,11 @@
                     return;
                 }
                 Output outputTime= new Output();
-                outputTime.sid = LogicMethod.CurrLogicMethod.NewSid();
+                outputTime.sid = LogicMethod.Current.NewSid();
                 outputTime.target_type = "4";
                 Dictionary<string, string> dic = new Dictionary<string, string>();
-                LogicMethod.CurrLogicMethod.dictionary(dic, "key", "delay");
-                LogicMethod.CurrLogicMethod.dictionary(dic, "value", timepoint);
+                LogicMethod.Current.dictionary(dic, "key", "delay");
+                LogicMethod.Current.dictionary(dic, "value", timepoint);
                 outputTime.status.Add(dic);
                 if (edit)
                 {
@@ -238,7 +252,7 @@
                     AddOutput(outputTime);
                 }
                 fLayout.RemoveFromParent();
-                LogicMethod.CurrLogicMethod.RemoveAllView();
+                LogicMethod.Current.RemoveAllView();
                 AddLogic addLogic = new AddLogic();
                 MainPage.BasePageView.AddChidren(addLogic);
                 addLogic.Show();

--
Gitblit v1.8.0