wxr
2024-08-27 bfb3d0d4879dca8c59ff287c92f5113162f3a33a
OnPro/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
@@ -55,24 +55,24 @@
            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;
            //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
            //    };
            //    new FunTpye(LogicMethod.target_if).FunTypeView(viewLayout, seriesView.frameLayout.Bottom, 3);
            //}
            //else
            {
                ////功能
                ///产品经理君焕要求,设备功能移到这里。<2022-3-7>
@@ -144,35 +144,35 @@
        /// </summary>
        public void SecurityMethod(FrameLayout frameLayout, bool edit=false, int index1=-1)
        {
            List<string> stateList = new List<string>();
            if (edit&& index1 != -1) {
                Output output = Logic.currlogic.output[index1];
                var security = LogicMethod.Current.GetSecurity(output.sid);
                stateList.Add(security.name);
            }
            var securityList = LogicMethod.Current.GetSecurityList();
            List<string> nameList = new List<string>();
            for (int i = 0; i < securityList.Count; i++)
            {
                var security = securityList[i];
                nameList.Add(security.name);
            }
            PublicInterface publicInterface = new PublicInterface();
            publicInterface.FrameOrVv(frameLayout, nameList, stateList,Language.StringByID(StringId.addSecurityLogic),(index) =>
            {
                var securitySelecetd = securityList[index];
                Output outputDevice = new Output();
                outputDevice.target_type = "3";
                outputDevice.sid = securitySelecetd.sid;
                //没啥作用,为了发送数据格式统一;
                outputDevice.status = new List<Dictionary<string, string>> { new Dictionary<string, string> { { "key", "security" }, { "value", "0" } } };
                AddOutput(outputDevice,true);
                LogicMethod.Current.RemoveAllView();
                AddLogic addLogic = new AddLogic();
                MainPage.BasePageView.AddChidren(addLogic);
                addLogic.Show();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            });
            //List<string> stateList = new List<string>();
            //if (edit&& index1 != -1) {
            //    Output output = Logic.currlogic.output[index1];
            //    var security = LogicMethod.Current.GetSecurity(output.sid);
            //    stateList.Add(security.name);
            //}
            //var securityList = LogicMethod.Current.GetSecurityList();
            //List<string> nameList = new List<string>();
            //for (int i = 0; i < securityList.Count; i++)
            //{
            //    var security = securityList[i];
            //    nameList.Add(security.name);
            //}
            //PublicInterface publicInterface = new PublicInterface();
            //publicInterface.FrameOrVv(frameLayout, nameList, stateList,Language.StringByID(StringId.addSecurityLogic),(index) =>
            //{
            //    var securitySelecetd = securityList[index];
            //    Output outputDevice = new Output();
            //    outputDevice.target_type = "3";
            //    outputDevice.sid = securitySelecetd.sid;
            //    //没啥作用,为了发送数据格式统一;
            //    outputDevice.status = new List<Dictionary<string, string>> { new Dictionary<string, string> { { "key", "security" }, { "value", "0" } } };
            //    AddOutput(outputDevice,true);
            //    LogicMethod.Current.RemoveAllView();
            //    AddLogic addLogic = new AddLogic();
            //    MainPage.BasePageView.AddChidren(addLogic);
            //    addLogic.Show();
            //    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            //});
        }
        /// <summary>
        /// 延时时间方法