JLChen
2021-04-20 23f3b7a482ef167b6192365e75749af1ca1a6c52
HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
@@ -46,11 +46,12 @@
                logicView.btnWeekText.Text = GetCyclicText(currLogic);
                logicView.btnclick.MouseUpEventHandler += (sen, e) =>
                {
                    Logic.currlogic = currLogic;
                    var addLogic = new AddLogic();
                    MainPage.BasePageView.AddChidren(addLogic);
                    addLogic.Show();
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    //Logic.currlogic = currLogic;
                    //var addLogic = new AddLogic();
                    //MainPage.BasePageView.AddChidren(addLogic);
                    //addLogic.Show();
                    //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    new MainView { }.SkipAddLogicPage(currLogic);
                };
                //开关图标的点击事件
                logicView.btnSwitchIcon.MouseUpEventHandler += (sender1, e1) =>
@@ -123,13 +124,29 @@
        /// <summary>
        ///  按+跳转到逻辑界面的方法
        /// </summary>
        public void SkipAddLogicPage()
        public void SkipAddLogicPage(Logic logic=null)
        {
            Logic.currlogic = new Logic();
            var addLogic = new AddLogic();
            MainPage.BasePageView.AddChidren(addLogic);
            addLogic.Show();
            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            if (logic == null)
            {
                Logic.currlogic = new Logic();
            }
            else {
                Logic.currlogic = logic;
            }
            if (IsGatewayType)
            {
                var addLogic = new AddLogic();
                MainPage.BasePageView.AddChidren(addLogic);
                addLogic.Show();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            }
            else
            {
                var onePortAutomation = new OnePortAutomation();
                MainPage.BasePageView.AddChidren(onePortAutomation);
                onePortAutomation.Show();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            }
        }
        /// <summary>
        ///返回循环描述文本
@@ -209,7 +226,6 @@
            }
            return weekTextName.TrimEnd(',');
        }
        /// <summary>
        /// 获取每月的字符串
        /// </summary>
@@ -262,6 +278,7 @@
                    var jay = jArray[a];
                    //数据返序列化为Logic对象
                    var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay);
                    Console.WriteLine("获取逻辑==="+str);
                    var logic = Newtonsoft.Json.JsonConvert.DeserializeObject<Logic>(str);
                    if (logic != null)
                    {
@@ -323,7 +340,6 @@
            }
            return false;
        }
        /// <summary>
        /// 显示条件或者目标类型图标
        /// </summary>
@@ -477,6 +493,26 @@
                btnIcon.UnSelectedImagePath = strIcon;
            }
        }
        /// <summary>
        /// 判断网关类型
        /// </summary>
        /// <returns></returns>
        public static bool IsGatewayType
        {
            get
            {
                if (Entity.DB_ResidenceData.Instance.GatewayType == 1)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }
    }
    class LogicData
    {