From 6b6a65cc86b668b57a84d6d8a7bec4c43ddcc0f5 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 02 十二月 2020 20:35:02 +0800
Subject: [PATCH] 2020-12-02-4

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 52 insertions(+), 7 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
index d483d6b..086bd83 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/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];
                 ///鍚勭鏉′欢鐨刅iew
                 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];
                 ///鍚勭鏉′欢鐨刅iew
                 LogicView.AddOutputInputView targetView = new LogicView.AddOutputInputView();
-                viewLayout.AddChidren(targetView.FLayoutView());
+                targetView.FLayoutView(viewLayout);
                 ///璁板綍鏉′欢绫诲瀷
                 targetView.btnClick.Name = outputTarget.target_type;
                 ///璁板綍鏉′欢绱㈠紩
@@ -196,6 +201,26 @@
                             }
                         }
                         break;
+                    case "2":
+                        {
+                            //鐢╯id鎵惧埌鍦烘櫙锛�
+                            var scene = LogicMethod.GetSecne(outputTarget.sid);
+                            targetView.btnIcon.UnSelectedImagePath = "LogicIcon/scene.png";
+                            targetView.btnNextIcon.Visible = false;
+                            //鏄剧ず鍦烘櫙鍚嶇О
+                            targetView.btnText.Text = scene.name;
+                        }
+                        break;
+                    case "3":
+                        {
+                            targetView.btnIcon.UnSelectedImagePath = "LogicIcon/delayed.png";
+                            foreach (var dic in dicList)
+                            {
+                                string value = dic["value"];
+                                targetView.btnText.Text =value;
+                            }
+                        }
+                        break;
                 }
                 //鍐嶆缂栬緫鏉′欢鐘舵�佺偣鍑讳簨浠�
                 targetView.btnClick.MouseUpEventHandler += (sen, e) =>
@@ -219,8 +244,28 @@
                                 MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                             }
                             break;
+                        case "3":
+                            {
+
+                                FrameLayout fLayout = new FrameLayout
+                                {
+                                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+                                };
+                                thisView.AddChidren(fLayout);
+                                AddTarget addTarget = new AddTarget();
+                                addTarget.Delayed(fLayout, edit, indexVulae);
+
+                               
+                            }
+                            break;
                     }
                 };
+                ///鍒犻櫎鎺т欢
+                targetView.btnDel.MouseUpEventHandler += (sender, e) =>
+                {
+                    Logic.currlogic.output.Remove(outputTarget);
+                    targetView.frameLayout.RemoveFromParent();
+                };
             }
         }
 

--
Gitblit v1.8.0