From 5b40f1da1d28616de3880857b38357eef7859b64 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 26 十一月 2020 17:51:35 +0800
Subject: [PATCH] 2020-11-26-1

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs |   65 +++++++++++++++++++++-----------
 1 files changed, 43 insertions(+), 22 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs
index 3968f80..d9c4b1d 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs
@@ -1,5 +1,6 @@
 锘縰sing System;
 using Shared;
+using System.Collections.Generic;
 
 
 namespace HDL_ON.UI.UI2.Intelligence.Automation
@@ -8,25 +9,29 @@
     {
         public AddLogic()
         {
-
+            Tag = "Logic";
         }
-
+        /// <summary>
+        /// 琛ㄧず杩斿洖鏇存柊鐣岄潰
+        /// (瀹氫箟闈欐�佹槸鍥犱负璇ョ晫闈細琚叾瀹冪晫闈㈢Щ闄わ紝杩斿洖鏃朵細鍑虹幇action绌哄紓甯�)
+        /// </summary>
+        public static Action action;
         public void Show()
         {
             this.BackgroundColor = CSS.CSS_Color.viewMiddle;
             LogicView.TopView topView = new LogicView.TopView();
-            this.AddChidren(topView.TopFLayoutView());
+            this.AddChidren(topView.FLayoutView());
             topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
              {
                  RemoveFromParent();
              };
             topView.topNameBtn.TextID = StringId.newAutomation;
-
+            
             VerticalScrolViewLayout viewLayout = new VerticalScrolViewLayout
             {
                 Y = Application.GetRealHeight(64),
                 Width = Application.GetRealWidth(LogicView.TextSize.view375),
-                Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64-76),
+                Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64 - 76),
                 BackgroundColor = CSS.CSS_Color.viewMiddle,
             };
             this.AddChidren(viewLayout);
@@ -37,15 +42,14 @@
             viewLayout.AddChidren(addInputTextView.FLayoutView(46, 12));
             ///婊¤冻浠ヤ笅鏉′欢鐨刅iew
             LogicView.LogicTypeTitleView titleCondition = new LogicView.LogicTypeTitleView();
-            titleCondition.frameLayout.SetCornerWithSameRadius(12,HDLUtils.RectCornerTopLeft| HDLUtils.RectCornerTopRight);
+            titleCondition.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
             titleCondition.btnText.TextID = StringId.whenTheFollowingConditionsAreMet;
             viewLayout.AddChidren(titleCondition.FLayoutView());
-            ///杈撳叆鍚勭鏉′欢鐨刅iew
-            LogicView.AddOutputInputView InputView = new LogicView.AddOutputInputView();
-            viewLayout.AddChidren(InputView.FLayoutView());
+            // 鏉′欢澶勭悊鏂规硶
+            InpOrOutLogicMethod.InputCondition(this, viewLayout);
             ///娣诲姞鍥炬爣鐨刅iew
             LogicView.LogicAddView addInputIcon = new LogicView.LogicAddView();
-            addInputIcon.frameLayout.SetCornerWithSameRadius(12, HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight);
+            addInputIcon.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight);
             viewLayout.AddChidren(addInputIcon.FLayoutView());
 
             addInputIcon.btnClick.MouseUpEventHandler += (sen, e) =>
@@ -64,16 +68,22 @@
             viewLayout.AddChidren(addOutpuTextView.FLayoutView(54, 20));
             ///浠ヤ笅鍔ㄤ綔View        
             LogicView.LogicTypeTitleView titleOutpu = new LogicView.LogicTypeTitleView();
-            titleOutpu.frameLayout.SetCornerWithSameRadius(12, HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
+            titleOutpu.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
             titleOutpu.btnText.TextID = StringId.theFollowingActions;
             viewLayout.AddChidren(titleOutpu.FLayoutView());
-            ///杈撳嚭鍚勭鍔ㄤ綔鐨刅iew
-            LogicView.AddOutputInputView outputView = new LogicView.AddOutputInputView();
-            viewLayout.AddChidren(outputView.FLayoutView());
+            //鐩爣澶勭悊鏂规硶
+            InpOrOutLogicMethod.OutputTarget(this, viewLayout);
             ///娣诲姞鍥炬爣鐨刅iew
             LogicView.LogicAddView addOutputIcon = new LogicView.LogicAddView();
-            addOutputIcon.frameLayout.SetCornerWithSameRadius(12, HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight);
+            addOutputIcon.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight);
             viewLayout.AddChidren(addOutputIcon.FLayoutView());
+            addOutputIcon.btnClick.MouseUpEventHandler += (sen, e) =>
+            {
+                var addTarget = new AddTarget();
+                MainPage.BasePageView.AddChidren(addTarget);
+                addTarget.Show();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
             #endregion
 
             #region  寰幆鏂瑰紡
@@ -82,9 +92,9 @@
             cyclicTextView.btnIf.TextID = StringId.cyclic;
             viewLayout.AddChidren(cyclicTextView.FLayoutView(54, 20));
             ///閫夋嫨鍛ㄦ湡绫诲瀷View        
-            LogicView.LogicTypeTitleView cyclicTitle= new LogicView.LogicTypeTitleView();
+            LogicView.LogicTypeTitleView cyclicTitle = new LogicView.LogicTypeTitleView();
             cyclicTextView.frameLayout.Height = Application.GetRealHeight(50);
-            cyclicTitle.frameLayout.SetCornerWithSameRadius(12, HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight|HDLUtils.RectCornerBottomLeft|HDLUtils.RectCornerBottomRight);
+            cyclicTitle.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight | HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight);
             //cyclicTitle.frameLayout.Radius = (uint)Application.GetRealHeight(12);
             cyclicTitle.btnText.TextID = StringId.days;
             viewLayout.AddChidren(cyclicTitle.FLayoutView());
@@ -92,27 +102,38 @@
 
             #region  鎵ц鎺ㄩ�� 鍙戦�侀�氱煡
             ///涓婁笅闂撮殧12鍍忕礌
-            viewLayout.AddChidren(new FrameLayout { Height = Application.GetRealHeight(12)});
+            viewLayout.AddChidren(new FrameLayout { Height = Application.GetRealHeight(12) });
             ///鎵ц鎺ㄩ�乮ew
             LogicView.LogicTypeTitleView push = new LogicView.LogicTypeTitleView();
             push.frameLayout.Height = Application.GetRealHeight(50);
-            push.frameLayout.SetCornerWithSameRadius(12, HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
+            push.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
             push.btnText.TextID = StringId.push;
             viewLayout.AddChidren(push.FLayoutView());
             ///鍙戦�侀�氱煡View        
             LogicView.LogicTypeTitleView notification = new LogicView.LogicTypeTitleView();
-            notification.frameLayout.SetCornerWithSameRadius(12, HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight);
+            notification.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight);
             notification.btnText.TextID = StringId.notification;
             viewLayout.AddChidren(notification.FLayoutView());
             ///涓婁笅闂撮殧62鍍忕礌
-           viewLayout.AddChidren(new FrameLayout { Height = Application.GetRealHeight(62)});
+            viewLayout.AddChidren(new FrameLayout { Height = Application.GetRealHeight(62) });
             #endregion
 
             #region  淇濆瓨
             ///淇濆瓨View
             LogicView.SaveView saveView = new LogicView.SaveView();
-            saveView.frameLayout.SetCornerWithSameRadius(24,HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerTopRight);
+            saveView.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(24), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
             this.AddChidren(saveView.FLayoutView());
+            saveView.btnClick.MouseUpEventHandler += (sender, e) =>
+            {
+                Logic.LogicList.Add(Logic.currlogic);
+                action();
+                if (action != null)
+                {
+                    action = null;
+                }
+                LogicMethod.RemoveAllView();
+                
+            };
             //saveView.frameLayout.Y = this.Height - saveView.frameLayout.Height;
             #endregion
 

--
Gitblit v1.8.0