陈嘉乐
2020-12-02 6b6a65cc86b668b57a84d6d8a7bec4c43ddcc0f5
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
File was renamed from HDL_ON/UI/UI2/3-Intelligence/Automation/Automation/InpOrOutLogicMethod.cs
@@ -10,14 +10,14 @@
        /// </summary>
        /// <param name="thisView">当前界面</param>
        /// <param name="viewLayout">上下滑动控件</param>
        public static void InputCondition(FrameLayout thisView,VerticalScrolViewLayout viewLayout)
        public static void InputCondition(FrameLayout thisView, VerticalScrolViewLayout viewLayout)
        {
            for (int i = 0; i < Logic.currlogic.input.Count; i++)
            {
                Input inputCondition = Logic.currlogic.input[i];
                ///各种条件的View
                LogicView.AddOutputInputView inputView = new LogicView.AddOutputInputView();
                viewLayout.AddChidren(inputView.FLayoutView());
                inputView.FLayoutView(viewLayout);
                ///记录条件类型
                inputView.btnClick.Name = inputCondition.condition_type;
                ///记录条件索引
@@ -36,7 +36,6 @@
                                inputView.btnText.Text = Language.StringByID(StringId.hour) + ": " + value;
                                inputView.btnClick.AddTag("timepoint", value);
                            }
                        }
                        break;
                    case "2":
@@ -68,7 +67,7 @@
                                    {//开关灯
                                        foreach (var dic in dicList)
                                        {
                                            string value = dic["value"];
                                            if (value == "on")
                                            {
@@ -128,13 +127,19 @@
                                var device = LogicMethod.GetDevice(inputCondition.sid);
                                DeviceFunList deviceFunList = new DeviceFunList();
                                MainPage.BasePageView.AddChidren(deviceFunList);
                                deviceFunList.Show(device, indexVulae,edit, if_type);
                                deviceFunList.Show(device, indexVulae, edit, if_type);
                                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                            }
                            break;
                    }
                };
                ///删除控件
                inputView.btnDel.MouseUpEventHandler += (sender, e) =>
                {
                    Logic.currlogic.input.Remove(inputCondition);
                    inputView.frameLayout.RemoveFromParent();
                };
            }
@@ -152,7 +157,7 @@
                Output outputTarget = Logic.currlogic.output[i];
                ///各种条件的View
                LogicView.AddOutputInputView targetView = new LogicView.AddOutputInputView();
                viewLayout.AddChidren(targetView.FLayoutView());
                targetView.FLayoutView(viewLayout);
                ///记录条件类型
                targetView.btnClick.Name = outputTarget.target_type;
                ///记录条件索引
@@ -255,6 +260,12 @@
                            break;
                    }
                };
                ///删除控件
                targetView.btnDel.MouseUpEventHandler += (sender, e) =>
                {
                    Logic.currlogic.output.Remove(outputTarget);
                    targetView.frameLayout.RemoveFromParent();
                };
            }
        }