From a46cd0adb5af29e8a9cf47c219475acaedfcf839 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 01 十二月 2020 17:09:00 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/WJC'

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/EditPopView.cs            |   10 
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AreaView.cs               |   57 
 HDL-ON_Android/Assets/Phone/LogicIcon/off.png                               |    0 
 HDL-ON_Android/Assets/Language.ini                                          |   57 
 HDL-ON_Android/Assets/Phone/LogicIcon/airconditionerlogic.png               |    0 
 HDL-ON_Android/Assets/Phone/LogicIcon/timecondition.png                     |    0 
 HDL-ON_Android/Assets/Phone/LogicIcon/addconditiontarget.png                |    0 
 HDL-ON_Android/Assets/Phone/LogicIcon/delayed.png                           |    0 
 HDL_ON/HDL_ON.projitems                                                     |   31 
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/ConfirmPopView.cs         |   10 
 HDL-ON_Android/Assets/Phone/LogicIcon/editname.png                          |    0 
 HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs                        |  284 +++
 HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs                     |   66 
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs                      |  344 +++
 HDL-ON_Android/Resources/Resource.designer.cs                               |    3 
 HDL-ON_Android/Assets/Phone/LogicIcon/outletlogic.png                       |    0 
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs             |  569 ++++++
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/MonView.cs                |   71 
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TextSize.cs               |   21 
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunAllAreaView.cs         |   84 
 HDL-ON_Android/Assets/Phone/LogicIcon/next.png                              |    0 
 HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs                            |   55 
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SelectTypeView.cs         |  135 +
 HDL-ON_Android/Assets/Phone/LogicIcon/curtainlogic.png                      |    0 
 HDL-ON_Android/Assets/Phone/LogicIcon/timeicon.png                          |    0 
 HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs                          |  256 ++
 HDL-ON_Android/Assets/Phone/LogicIcon/back.png                              |    0 
 HDL_ON/DAL/Server/HttpUtil.cs                                               |    1 
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SaveView.cs               |   51 
 HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs                            |  105 +
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicAddView.cs           |   45 
 HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs                             |  263 ++
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SingleLogicView.cs        |  107 +
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs                |   87 
 HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs              |  262 ++
 HDL-ON_Android/Assets/Phone/LogicIcon/set.png                               |    0 
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs               |  269 ++
 HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs                         |  193 ++
 HDL-ON_Android/Assets/Phone/LogicIcon/lightloguc.png                        |    0 
 HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs                              |  114 +
 HDL_ON/UI/UI2/3-Intelligence/Automation/Automation/.DS_Store                |    0 
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeHorizonView.cs        |   98 +
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs             |   55 
 HDL_ON/UI/CSS/CSS.cs                                                        |   19 
 HDL-ON_Android/Assets/Phone/LogicIcon/heatlogic.png                         |    0 
 .vs/HDL_APP_Project/xs/sqlite3/storage.ide                                  |    0 
 HDL-ON_Android/Assets/Phone/LogicIcon/down.png                              |    0 
 HDL-ON_Android/Assets/Phone/LogicIcon/weekon.png                            |    0 
 HDL-ON_Android/Assets/Phone/LogicIcon/bjicon.png                            |    0 
 HDL-ON_Android/Assets/Phone/LogicIcon/functionicon.png                      |    0 
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputTextView.cs |   42 
 HDL_ON/UI/UI2/3-Intelligence/Automation/DeviceFunList.cs                    |  386 ++++
 HDL-ON_Android/Assets/Phone/LogicIcon/scene.png                             |    0 
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/DateView.cs               |   82 
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicTypeTitleView.cs     |   79 
 HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs                         |  674 +++++++
 HDL_ON/UI/UI2/3-Intelligence/Automation/.DS_Store                           |    0 
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs     |  106 +
 HDL_ON/Common/R.cs                                                          |   54 
 HDL_ON/UI/UI2/3-Intelligence/.DS_Store                                      |    0 
 HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs                         |  386 ++++
 HDL-ON_Android/Assets/Phone/LogicIcon/weekoff.png                           |    0 
 HDL-ON_Android/Assets/Phone/LogicIcon/on.png                                |    0 
 63 files changed, 5,499 insertions(+), 32 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide
index f8a5a70..93a5304 100644
--- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide
+++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide
Binary files differ
diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index ae55f72..ad318ec 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -432,6 +432,63 @@
 5046=璋冭妭闊抽噺
 5047=浣犳墜鏈烘殏鏈畨瑁�"QQ闊充箰"{\r\n}璇峰墠寰�鎵嬫満鍟嗗満瀹夎
 
+
+
+7000=鏂板缓鑷姩鍖�
+7001=缂栬緫鑷姩鍖�
+7002=濡傛灉
+7003=鍚屾椂婊¤冻浠ヤ笅鏉′欢鏃�
+7004=浠讳竴婊¤冻浠ヤ笅鏉′欢鏃�
+7005=灏辨墽琛�
+7006=浠ヤ笅鍔ㄤ綔
+7007=寰幆鏂瑰紡
+7008=鎵ц涓�娆�
+7009=姣忓ぉ
+7010=姣忓懆
+7011=姣忔湀
+7012=淇濆瓨
+7013=鎵ц鎺ㄩ��
+7014=鍙戦�侀�氱煡
+7015=閫夋嫨鏉′欢
+7016=鏃堕棿
+7017=閫夋嫨鏃堕棿鏉′欢
+7018=鏃跺埢
+7019=鏃堕棿鑼冨洿
+7020=鏃�
+7021=鍒�
+7022=绉�
+7023=鍙栨秷
+7024=纭畾
+7025=*鍦ㄦ偍鎵�璁剧疆鐨勬椂闂存鍐呭繀瀹氫細鎵ц涓�娆℃偍鎵�璁剧疆鐨勮嚜鍔ㄥ寲
+7026=寮�濮嬫椂闂�
+7027=缁撴潫鏃堕棿
+7028=鍔熻兘
+7029=閫変腑鍔熻兘鏉′欢
+7030=鍏ㄩ儴鍖哄煙
+7031=鍏ㄩ儴鍔熻兘
+7032=寮�
+7033=鍏�
+7034=寮�鍏�
+7035=瀹屾垚
+7036=娣诲姞鎵ц鍔ㄤ綔
+7037=鍛ㄤ竴
+7038=鍛ㄤ簩
+7039=鍛ㄤ笁
+7040=鍛ㄥ洓
+7041=鍛ㄤ簲
+7042=鍛ㄥ叚
+7043=鍛ㄦ棩
+7044=婊¤冻鏉′欢
+7045=璁剧疆
+7046=鍚嶇О
+7047=淇敼鍚嶇О
+7048=鑷姩鍖栧悕绉板凡瀛樺湪
+7049=鏄惁瑕佸垹闄よ嚜鍔ㄥ寲锛�
+7050=娣诲姞鍦烘櫙
+7051=寤舵椂
+
+
+
 9000=璇蜂娇鐢ㄦ柊鐨勬墜鏈鸿处鍙风櫥褰旳PP
 9001=璇蜂娇鐢ㄦ柊鐨勯偖绠辫处鍙风櫥褰旳PP
 9002=鐧诲綍鎵嬫満淇敼瀹屾垚
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/addconditiontarget.png b/HDL-ON_Android/Assets/Phone/LogicIcon/addconditiontarget.png
new file mode 100755
index 0000000..ac6e7ec
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/addconditiontarget.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/airconditionerlogic.png b/HDL-ON_Android/Assets/Phone/LogicIcon/airconditionerlogic.png
new file mode 100755
index 0000000..6123b42
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/airconditionerlogic.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/back.png b/HDL-ON_Android/Assets/Phone/LogicIcon/back.png
new file mode 100755
index 0000000..d10ae27
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/back.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/bjicon.png b/HDL-ON_Android/Assets/Phone/LogicIcon/bjicon.png
new file mode 100755
index 0000000..b3a3423
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/bjicon.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/curtainlogic.png b/HDL-ON_Android/Assets/Phone/LogicIcon/curtainlogic.png
new file mode 100755
index 0000000..0dc4af4
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/curtainlogic.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/delayed.png b/HDL-ON_Android/Assets/Phone/LogicIcon/delayed.png
new file mode 100755
index 0000000..df66c33
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/delayed.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/down.png b/HDL-ON_Android/Assets/Phone/LogicIcon/down.png
new file mode 100755
index 0000000..ad0f3b1
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/down.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/editname.png b/HDL-ON_Android/Assets/Phone/LogicIcon/editname.png
new file mode 100755
index 0000000..52727a2
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/editname.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/functionicon.png b/HDL-ON_Android/Assets/Phone/LogicIcon/functionicon.png
new file mode 100755
index 0000000..e1ea93a
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/functionicon.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/heatlogic.png b/HDL-ON_Android/Assets/Phone/LogicIcon/heatlogic.png
new file mode 100755
index 0000000..eecd1a2
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/heatlogic.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/lightloguc.png b/HDL-ON_Android/Assets/Phone/LogicIcon/lightloguc.png
new file mode 100755
index 0000000..722c37e
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/lightloguc.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/next.png b/HDL-ON_Android/Assets/Phone/LogicIcon/next.png
new file mode 100755
index 0000000..293a8c5
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/next.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/off.png b/HDL-ON_Android/Assets/Phone/LogicIcon/off.png
new file mode 100755
index 0000000..bc2f19c
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/off.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/on.png b/HDL-ON_Android/Assets/Phone/LogicIcon/on.png
new file mode 100755
index 0000000..c6318d6
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/on.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/outletlogic.png b/HDL-ON_Android/Assets/Phone/LogicIcon/outletlogic.png
new file mode 100755
index 0000000..798bcbf
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/outletlogic.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/scene.png b/HDL-ON_Android/Assets/Phone/LogicIcon/scene.png
new file mode 100755
index 0000000..0585769
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/scene.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/set.png b/HDL-ON_Android/Assets/Phone/LogicIcon/set.png
new file mode 100755
index 0000000..32b42f6
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/set.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/timecondition.png b/HDL-ON_Android/Assets/Phone/LogicIcon/timecondition.png
new file mode 100755
index 0000000..5b638b7
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/timecondition.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/timeicon.png b/HDL-ON_Android/Assets/Phone/LogicIcon/timeicon.png
new file mode 100755
index 0000000..df66c33
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/timeicon.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/weekoff.png b/HDL-ON_Android/Assets/Phone/LogicIcon/weekoff.png
new file mode 100755
index 0000000..3f2fe5b
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/weekoff.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/LogicIcon/weekon.png b/HDL-ON_Android/Assets/Phone/LogicIcon/weekon.png
new file mode 100755
index 0000000..9b0a3d2
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/LogicIcon/weekon.png
Binary files differ
diff --git a/HDL-ON_Android/Resources/Resource.designer.cs b/HDL-ON_Android/Resources/Resource.designer.cs
index f65757c..8ecaf81 100644
--- a/HDL-ON_Android/Resources/Resource.designer.cs
+++ b/HDL-ON_Android/Resources/Resource.designer.cs
@@ -2,6 +2,7 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.
@@ -14,7 +15,7 @@
 {
 	
 	
-	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
+	[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
 	public partial class Resource
 	{
 		
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index 20455f3..aa54a49 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -427,6 +427,60 @@
         public const int qqMsuicTip = 5047;
 
 
+        public const int newAutomation = 7000;
+        public const int editAutomation = 7001;
+        public const int ifCondition = 7002;
+        public const int andCondition = 7003;
+        public const int orCondition = 7004;
+        public const int isExecuted = 7005;
+        public const int theFollowingActions = 7006;
+        public const int cyclic = 7007;
+        public const int performA = 7008;
+        public const int days = 7009;
+        public const int weekly = 7010;
+        public const int monthly = 7011;
+        public const int save = 7012;
+        public const int push = 7013;
+        public const int notification = 7014;
+        public const int selectionCondition = 7015;
+        public const int time = 7016;
+        public const int selectionTimeCondition = 7017;
+        public const int hour = 7018;
+        public const int timeHorizon = 7019;
+        public const int h = 7020;
+        public const int m = 7021;
+        public const int s = 7022;
+        public const int cancelSelected = 7023;
+        public const int confirmSelected = 7024;
+        public const int timeTipText = 7025;
+        public const int startTime = 7026;
+        public const int endTime = 7027;
+        public const int funLogic = 7028;
+        public const int selectedFunCondition = 7029;
+        public const int allAreas = 7030;
+        public const int allFun = 7031;
+        public const int onLogic = 7032;
+        public const int offLogic = 7033;
+        public const int switchLogic = 7034;
+        public const int completeLogic = 7035;
+        public const int addtarget = 7036;
+        public const int monday = 7037;
+        public const int tuesday = 7038;
+        public const int wednesday = 7039;
+        public const int thursday = 7040;
+        public const int friday = 7041;
+        public const int saturday = 7042;
+        public const int sunday = 7043;
+        public const int meetTheCondition = 7044;
+        public const int setlogic = 7045;
+        public const int namelogic = 7046;
+        public const int editName = 7047;
+        public const int NameAlreadyExists = 7048;
+        public const int delAutomation = 7049;
+        public const int addSceneLogic = 7050;
+        public const int delayLogic = 7051;
+
+
         #region LE鏂板
         /// <summary>
         /// 璇蜂娇鐢ㄦ柊鐨勬墜鏈鸿处鍙风櫥褰旳PP
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index 0fa2299..5e52242 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -208,6 +208,7 @@
                 {
                     try
                     {
+
                         ResponsePackNew revertObj = new ResponsePackNew() { };
                         revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePackNew>(response.Content);
                         //*****涓�浜涘垽绌哄鐞�*****************
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index 61d911d..593e764 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -218,6 +218,37 @@
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\1-HomePage\MessageCenterPage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\Widget\MenuButton.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\RoomGalleryPage.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AddInputType.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AddLogic.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AddTarget.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\DeviceFunList.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\FunTpye.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\InpOrOutLogicMethod.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Logic.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicMethod.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\MainView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Set.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\TimeTpye.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\FunAllAreaView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\EditPopView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\DateView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\AreaView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\MonView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\LogicAddView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TopView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\ConfirmPopView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\SelectTypeView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\SwitchView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\LogicTypeTitleView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TimeView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TimeHorizonView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TextSize.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\AddOutputInputView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TipPopView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\AddOutputInputTextView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\SaveView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\SingleLogicView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Send.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="$(MSBuildThisFileDirectory)UI\" />
diff --git a/HDL_ON/UI/CSS/CSS.cs b/HDL_ON/UI/CSS/CSS.cs
index 3eb67cd..ff5eff9 100644
--- a/HDL_ON/UI/CSS/CSS.cs
+++ b/HDL_ON/UI/CSS/CSS.cs
@@ -94,6 +94,25 @@
         /// </summary>
         public const uint LinkTipFail = 0xFFFF4747;
 
+        #region 鑷姩鍖�
+        /// <summary>
+        /// 鏍囧噯瀛椾綋棰滆壊
+        /// </summary>
+        public const uint textColor = 0XFF1B2D4D;
+        public const uint textCancelColor = 0XFFC0C7D4;
+        public const uint textConfirmColor = 0XFF4484F4;
+        public const uint textRedColor = 0XFFFF4747;
+        public const uint textWhiteColor = 0XFFFFFFFF;
+        public const uint viewTop = 0XFFF7F7F7;
+        public const uint viewMiddle = 0XFFF2F3F7;
+        public const uint viewLine = 0XFFECEDEE;
+        public const uint view = 0XFFFFFFFF;
+        public const uint btnSaveBackgroundColor = 0XFF4484F4;
+        public const uint viewTrans60lucence = 0x60000000;
+        public const uint viewTranslucence = 0x00000000;
+        public const uint textTipColor = 0XFF798394;
+        #endregion
+
         #endregion
     }
 
diff --git a/HDL_ON/UI/UI2/3-Intelligence/.DS_Store b/HDL_ON/UI/UI2/3-Intelligence/.DS_Store
new file mode 100644
index 0000000..ca6baf5
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/.DS_Store
Binary files differ
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/.DS_Store b/HDL_ON/UI/UI2/3-Intelligence/Automation/.DS_Store
new file mode 100644
index 0000000..ca6baf5
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/.DS_Store
Binary files differ
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs
new file mode 100644
index 0000000..353be15
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs
@@ -0,0 +1,66 @@
+锘縰sing System;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation
+{
+    public class AddInputType : FrameLayout
+    {
+        public AddInputType()
+        {
+            Tag = "Logic";
+        }
+        public void Show()
+        {
+
+            LogicView.TopView topView = new LogicView.TopView();
+            this.AddChidren(topView.FLayoutView());
+            topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
+            {
+                RemoveFromParent();
+            };
+            topView.topNameBtn.TextID = StringId.selectionCondition;
+
+            FrameLayout viewLayout = new FrameLayout
+            {
+                Y = Application.GetRealHeight(64),
+                Width = Application.GetRealWidth(LogicView.TextSize.view375),
+                Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64),
+                BackgroundColor = CSS.CSS_Color.viewMiddle,
+            };
+            this.AddChidren(viewLayout);
+            #region 鏃堕棿  鍔熻兘
+            //鏃堕棿
+            LogicView.SelectTypeView timeView = new LogicView.SelectTypeView();
+            timeView.btnText.TextID = StringId.time;
+            timeView.btnIcon.UnSelectedImagePath = "LogicIcon/timeicon.png";
+            viewLayout.AddChidren(timeView.FLayoutView());
+
+            //鍔熻兘
+            LogicView.SelectTypeView functionView = new LogicView.SelectTypeView();
+            functionView.frameLayout.Y = timeView.frameLayout.Bottom;
+            functionView.btnText.TextID = StringId.funLogic;
+            functionView.btnIcon.UnSelectedImagePath = "LogicIcon/functionicon.png";
+            viewLayout.AddChidren(functionView.FLayoutView());
+            #endregion
+
+
+            #region  鎵�鏈夌偣鍑讳簨浠�
+            timeView.btnClick.MouseUpEventHandler += (sen, e) => {
+                TimeTpye timeTpye = new TimeTpye();
+                MainPage.BasePageView.AddChidren(timeTpye);
+                timeTpye.Show();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+
+            };
+
+            functionView.btnClick.MouseUpEventHandler += (sen, e) => {
+                FunTpye funTpye = new FunTpye();
+                MainPage.BasePageView.AddChidren(funTpye);
+                funTpye.Show(LogicMethod.condition_if);
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+
+            };
+            #endregion
+
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs
new file mode 100644
index 0000000..c877f26
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs
@@ -0,0 +1,674 @@
+锘縰sing System;
+using Shared;
+using System.Collections.Generic;
+
+
+namespace HDL_ON.UI.UI2.Intelligence.Automation
+{
+    public class AddLogic : FrameLayout
+    {
+        public AddLogic()
+        {
+            Tag = "Logic";
+        }
+
+        public void Show()
+        {
+
+            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
+            LogicView.TopView topView = new LogicView.TopView();
+            topView.setBtn.Visible = true;
+            this.AddChidren(topView.FLayoutView());
+            topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
+             {
+                 RemoveFromParent();
+             };
+            if (string.IsNullOrEmpty(Logic.currlogic.sid))
+            {
+                topView.topNameBtn.TextID = StringId.newAutomation;
+                topView.setBtn.Visible = false;
+                topView.clickSetBtn.Visible = false;
+            }
+            else
+            {
+                topView.topNameBtn.TextID = StringId.editAutomation;
+                topView.setBtn.Visible = true;
+                topView.clickSetBtn.Visible = true;
+            }
+            topView.clickSetBtn.MouseUpEventHandler += (sender,e) => {
+                Set set = new Set();
+                MainPage.BasePageView.AddChidren(set);
+                set.Show();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+
+            };
+
+           VerticalScrolViewLayout viewLayout = new VerticalScrolViewLayout
+            {
+                Y = Application.GetRealHeight(64),
+                Width = Application.GetRealWidth(LogicView.TextSize.view375),
+                Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64 - 76),
+                BackgroundColor = CSS.CSS_Color.viewMiddle,
+            };
+            this.AddChidren(viewLayout);
+            #region  鏉′欢
+            ///濡傛灉鐨刅iew
+            LogicView.AddOutputInputTextView addInputTextView = new LogicView.AddOutputInputTextView();
+            addInputTextView.btnIf.TextID = StringId.ifCondition;
+            viewLayout.AddChidren(addInputTextView.FLayoutView(46, 12));
+            ///婊¤冻浠ヤ笅鏉′欢鐨刅iew
+            LogicView.LogicTypeTitleView titleCondition = new LogicView.LogicTypeTitleView();
+            titleCondition.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
+            titleCondition.btnText.TextID = StringId.andCondition;
+            viewLayout.AddChidren(titleCondition.FLayoutView());
+            titleCondition.btnClick.MouseUpEventHandler += (sender, e) =>
+            {
+                FrameLayout fLayout = new FrameLayout
+                {
+                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+                };
+                this.AddChidren(fLayout);
+                AndOrMethod(fLayout, titleCondition.btnText);
+            };
+
+
+            // 鏉′欢澶勭悊鏂规硶
+            InpOrOutLogicMethod.InputCondition(this, viewLayout);
+            ///娣诲姞鍥炬爣鐨刅iew
+            LogicView.LogicAddView addInputIcon = new LogicView.LogicAddView();
+            addInputIcon.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight);
+            viewLayout.AddChidren(addInputIcon.FLayoutView());
+
+            addInputIcon.btnClick.MouseUpEventHandler += (sen, e) =>
+            {
+                var addInputType = new AddInputType();
+                MainPage.BasePageView.AddChidren(addInputType);
+                addInputType.Show();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
+            #endregion
+
+            #region  鐩爣
+            ///灏辨墽琛孷iew
+            LogicView.AddOutputInputTextView addOutpuTextView = new LogicView.AddOutputInputTextView();
+            addOutpuTextView.btnIf.TextID = StringId.isExecuted;
+            viewLayout.AddChidren(addOutpuTextView.FLayoutView(54, 20));
+            ///浠ヤ笅鍔ㄤ綔View        
+            LogicView.LogicTypeTitleView titleOutpu = new LogicView.LogicTypeTitleView();
+            titleOutpu.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
+            titleOutpu.btnText.TextID = StringId.theFollowingActions;
+            viewLayout.AddChidren(titleOutpu.FLayoutView());
+            //鐩爣澶勭悊鏂规硶
+            InpOrOutLogicMethod.OutputTarget(this, viewLayout);
+            ///娣诲姞鍥炬爣鐨刅iew
+            LogicView.LogicAddView addOutputIcon = new LogicView.LogicAddView();
+            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  寰幆鏂瑰紡
+            ///寰幆鏂瑰紡iew
+            LogicView.AddOutputInputTextView cyclicTextView = new LogicView.AddOutputInputTextView();
+            cyclicTextView.btnIf.TextID = StringId.cyclic;
+            viewLayout.AddChidren(cyclicTextView.FLayoutView(54, 20));
+            ///閫夋嫨鍛ㄦ湡绫诲瀷View        
+            LogicView.LogicTypeTitleView cyclicTitle = new LogicView.LogicTypeTitleView();
+            cyclicTitle.frameLayout.Height = Application.GetRealHeight(50);
+            cyclicTitle.frameLayout.Radius = (uint)Application.GetRealHeight(12);
+            cyclicTitle.btnText.TextID = StringId.days;
+            viewLayout.AddChidren(cyclicTitle.FLayoutView());
+            cyclicTitle.btnClick.MouseUpEventHandler += (sender, e) =>
+            {
+                FrameLayout fLayout = new FrameLayout
+                {
+                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+                };
+                this.AddChidren(fLayout);
+                DateMethod(fLayout, cyclicTitle.btnText);
+
+
+            };
+            #endregion
+
+            #region  鎵ц鎺ㄩ�� 鍙戦�侀�氱煡
+            ///涓婁笅闂撮殧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(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(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) });
+            #endregion
+
+            #region  淇濆瓨
+            ///淇濆瓨View
+            LogicView.SaveView saveView = new LogicView.SaveView();
+            saveView.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(24), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
+            this.AddChidren(saveView.FLayoutView());
+            saveView.btnClick.MouseUpEventHandler += (sender, e) =>
+            {
+
+                Logic.currlogic.sid = "000101000000000A0A0100CC1100";
+                //Logic.currlogic.sid = LogicMethod.NewSid();
+                //var f = Send.AddLogic(Logic.currlogic);
+
+                //var a = Send.getLogicIdList();
+
+                //var d = Send.getLogic(Logic.currlogic);
+
+               // var c = Send.delLogic(Logic.currlogic);
+
+                var e1= Send.switchLogic(Logic.currlogic);
+
+
+
+                //if (string.IsNullOrEmpty(Logic.currlogic.sid))
+                //{
+                //    List<string> list = new List<string>();
+                //    foreach (var logic in Logic.LogicList)
+                //    {
+                //        list.Add(logic.name);
+                //    }
+                //    new LogicView.TipPopView().InputBox(StringId.editName, Logic.currlogic.name, StringId.nameNull, StringId.NameAlreadyExists, list, (logicName) =>
+                //    {
+                //        Logic.currlogic.name = logicName;
+                //        Logic.currlogic.sid = LogicMethod.NewSid();
+                //        var responsePackNew = Send.AddLogic(Logic.currlogic);
+                //        if (responsePackNew.Code == "0")
+                //        {
+                //            Logic.LogicList.Add(Logic.currlogic);
+                //            LogicMethod.RemoveAllView();
+                //            MainView.MainShow();
+                //        }
+                //        //鍙戦�佹柊鍔犱慨鏀归�昏緫鍛戒护锛�
+
+                //    });
+               
+                //}
+                //else
+                //{
+                //    LogicMethod.RemoveAllView();
+                //    MainView.MainShow();
+                //    //鍙戦�佹柊鍔犱慨鏀归�昏緫鍛戒护锛�
+                //}
+
+            };
+            #endregion
+
+        }
+        /// <summary>
+        /// 寰幆鏂瑰紡(姣忓ぉ锛屾瘡鏈堛�傘��)
+        /// </summary>
+        /// <param name="fLayout">寮规涓绘帶浠�</param>
+        /// <param name="button">鏄剧ず鏂囨湰</param>
+        public void DateMethod(FrameLayout fLayout, Button button)
+        {
+
+            LogicView.DateView dateView = new LogicView.DateView();
+            dateView.btnTitle.TextID = StringId.cyclic;
+            dateView.FLayoutView(fLayout, 4);
+            dateView.btnCancel.MouseUpEventHandler += (sender2, e2) =>
+            {
+                //绉婚櫎fLayout鐣岄潰
+                fLayout.RemoveFromParent();
+            };
+            //瀹氫箟涓�涓眬閮ㄥ彉閲忚褰曢�変腑鏂囨湰鐘舵��
+            string weekName = "";
+            //瀹氫箟涓�涓眬閮˙tn鐢ㄦ潵璁板綍閫変腑Btn;
+            var selecetdBtn = new Button();
+            for (int i = 0; i < 4; i++)
+            {
+                LogicView.SelectTypeView dateTypeView = new LogicView.SelectTypeView();
+                dateTypeView.frameLayout.BackgroundColor = CSS.CSS_Color.viewTranslucence;
+                dateTypeView.frameLayout.Y = Application.GetRealHeight(56 + 50 * i);
+                dateTypeView.btnIcon.Visible = false;
+                dateTypeView.btnText.X = Application.GetRealWidth(20);
+                dateTypeView.btnNextIcon.X = Application.GetRealWidth(307);
+                dateTypeView.btnLine.X = Application.GetRealWidth(20);
+                dateTypeView.btnLine.Width = Application.GetRealWidth(303);
+                dateView.frameLayout.AddChidren(dateTypeView.FLayoutView());
+                dateTypeView.btnClick.Tag = i;//鏍囪绫诲瀷
+                switch (i)
+                {
+                    case 0:
+                        {
+                            weekName = Language.StringByID(StringId.performA);
+                            dateTypeView.btnNextIcon.Visible = false;
+                        }
+                        break;
+                    case 1:
+                        {
+                            weekName = Language.StringByID(StringId.days);
+                            dateTypeView.btnNextIcon.Visible = false;
+                        }
+                        break;
+                    case 2:
+                        {
+                            weekName = Language.StringByID(StringId.weekly);
+                        }
+                        break;
+                    case 3:
+                        {
+                            weekName = Language.StringByID(StringId.monthly);
+                        }
+                        break;
+
+
+                }
+                dateTypeView.btnText.Text = weekName;
+                //寰幆绫诲瀷(渚嬪锛氭瘡鏈堬紝姣忓ぉ)鐐瑰嚮浜嬩欢
+                dateTypeView.btnClick.MouseUpEventHandler += (sender, e) =>
+                {
+                    int clickIndex = int.Parse(dateTypeView.btnClick.Tag.ToString());
+                    switch (clickIndex)
+                    {
+                        case 0:
+                            {
+                                weekName = Language.StringByID(StringId.performA);
+                                selecetdBtn.TextColor = CSS.CSS_Color.textColor;
+                                dateTypeView.btnText.TextColor = CSS.CSS_Color.textConfirmColor;
+                                selecetdBtn = dateTypeView.btnText;
+                            }
+                            break;
+                        case 1:
+                            {
+                                weekName = Language.StringByID(StringId.days);
+                                selecetdBtn.TextColor = CSS.CSS_Color.textColor;
+                                dateTypeView.btnText.TextColor = CSS.CSS_Color.textConfirmColor;
+                                selecetdBtn = dateTypeView.btnText;
+
+                            }
+                            break;
+                        case 2:
+                            {
+                                // weekName = Language.StringByID(StringId.weekly);
+                                WeekMethod(fLayout, button);
+                            }
+                            break;
+                        case 3:
+                            {
+                                //weekName = Language.StringByID(StringId.monthly);
+                                MonMethod(fLayout, button);
+                            }
+                            break;
+
+
+                    }
+                };
+
+
+                //鏄剧ず涔嬪墠鐨勭姸鎬�
+                if (button.Text == weekName)
+                {
+                    dateTypeView.btnText.TextColor = CSS.CSS_Color.textConfirmColor;
+                    selecetdBtn = dateTypeView.btnText;
+                }
+                else if (button.Text == weekName)
+                {
+                    dateTypeView.btnText.TextColor = CSS.CSS_Color.textConfirmColor;
+                    selecetdBtn = dateTypeView.btnText;
+                }
+            }
+            //纭畾淇濆瓨
+            dateView.btnConfirm.MouseUpEventHandler += (sender3, e3) =>
+            {
+                if (weekName == Language.StringByID(StringId.monthly)|| weekName== Language.StringByID(StringId.weekly)) {
+                    //鎻愮ず锛氳繕鏈��
+                    return;
+
+                }
+
+                if (weekName == Language.StringByID(StringId.performA))
+                {
+                    //鎵ц涓�娆�
+                    Logic.currlogic.cycle.type = "once";
+                }
+                else if (weekName == Language.StringByID(StringId.days))
+                {
+                    //姣忓ぉ
+                    Logic.currlogic.cycle.type = "day";
+
+                }
+                //閫変腑淇濆瓨涔嬪悗鏄剧ず鏂囨湰
+                button.Text = weekName;
+                //绉婚櫎fLayout鐣岄潰
+                fLayout.RemoveFromParent();
+            };
+        }
+        /// <summary>
+        /// 閫変腑鏄熸湡鍑�(鍛ㄤ竴锛屽懆浜� 銆傘�傘��)
+        /// </summary>
+        /// <param name="fLayout">寮规涓绘帶浠�</param>
+        /// <param name="button">鏄剧ず鏂囨湰</param>
+        public void WeekMethod(FrameLayout fLayout, Button button)
+        {
+
+            LogicView.DateView weekView = new LogicView.DateView();
+            weekView.btnTitle.TextID = StringId.cyclic;
+            weekView.FLayoutView(fLayout, 7);
+            weekView.btnCancel.MouseUpEventHandler += (sender2, e2) =>
+            {
+                weekView.frameLayout.RemoveFromParent();
+            };
+            //瀹氫箟涓�涓眬閮╳eekList鍒楄〃鐢ㄦ潵璁板綍閫変腑鏁版嵁;
+            List<string> weekList = new List<string>();
+            if (Logic.currlogic.cycle.type == "week")
+            {
+                //鍔犺浇涔嬪墠淇濆瓨鐨勬暟鎹�
+                weekList.AddRange(Logic.currlogic.cycle.value);
+            }
+            //瀹氫箟涓�涓眬閮ㄥ彉閲忚褰曢�変腑鏂囨湰鐘舵��
+            string weekName = "";
+            for (int i = 0; i < 7; i++)
+            {
+                LogicView.SelectTypeView weekTypeView = new LogicView.SelectTypeView();
+                weekTypeView.frameLayout.BackgroundColor = CSS.CSS_Color.viewTranslucence;
+                weekTypeView.frameLayout.Y = Application.GetRealHeight(56 + 50 * i);
+                weekTypeView.btnIcon.Visible = false;
+                weekTypeView.btnText.X = Application.GetRealWidth(20);
+                weekTypeView.btnLine.X = Application.GetRealWidth(20);
+                weekTypeView.btnLine.Width = Application.GetRealWidth(303);
+                weekTypeView.btnNextIcon.X = Application.GetRealWidth(303);
+                weekTypeView.btnNextIcon.Width = Application.GetMinRealAverage(28);
+                weekTypeView.btnNextIcon.Height = Application.GetMinRealAverage(28);
+                weekTypeView.btnNextIcon.UnSelectedImagePath = "LogicIcon/weekoff.png";
+                weekTypeView.btnNextIcon.SelectedImagePath = "LogicIcon/weekon.png";
+                weekView.frameLayout.AddChidren(weekTypeView.FLayoutView());
+                weekTypeView.btnClick.Tag = i;//鏍囪绱㈠紩
+                switch (i)
+                {
+                    case 0:
+                        {
+                            weekName = Language.StringByID(StringId.monday);
+                        }
+                        break;
+                    case 1:
+                        {
+                            weekName = Language.StringByID(StringId.tuesday);
+                        }
+                        break;
+                    case 2:
+                        {
+                            weekName = Language.StringByID(StringId.wednesday);
+                        }
+                        break;
+                    case 3:
+                        {
+                            weekName = Language.StringByID(StringId.thursday);
+                        }
+                        break;
+                    case 4:
+                        {
+                            weekName = Language.StringByID(StringId.friday);
+                        }
+                        break;
+                    case 5:
+                        {
+                            weekName = Language.StringByID(StringId.saturday);
+                        }
+                        break;
+                    case 6:
+                        {
+                            weekName = Language.StringByID(StringId.sunday);
+                        }
+                        break;
+
+                }
+                weekTypeView.btnText.Text = weekName;
+                if (weekList.Contains(i.ToString()))
+                {
+                    //鏄剧ず涔嬪墠鐨勯�変腑鐘舵��
+                    weekTypeView.btnNextIcon.IsSelected = true;
+                }
+                //鏄熸湡鐨勭偣鍑讳簨浠�
+                weekTypeView.btnClick.MouseUpEventHandler += (sender, e) =>
+                {
+                    string clickIndex = weekTypeView.btnClick.Tag.ToString();
+                    weekTypeView.btnClick.IsSelected = !weekTypeView.btnClick.IsSelected;
+                    if (weekTypeView.btnClick.IsSelected)
+                    {
+                        weekTypeView.btnNextIcon.IsSelected = true;
+                        if (!weekList.Contains(clickIndex))
+                        {
+                            //娣诲姞閫変腑鏁版嵁
+                            weekList.Add(clickIndex);
+                        }
+                    }
+                    else
+                    {
+                        weekTypeView.btnNextIcon.IsSelected = false;
+                        if (weekList.Contains(clickIndex))
+                        {
+                            //绉婚櫎閫変腑鏁版嵁
+                            weekList.Remove(clickIndex);
+                        }
+                    }
+
+                };
+
+            }
+            //纭畾鐐瑰嚮浜嬩欢
+            weekView.btnConfirm.MouseUpEventHandler += (sender1, e1) =>
+            {
+                if (weekList.Count == 0)
+                {
+                    //鎻愮ず锛氳繕娌¢�変腑鎵ц鍛ㄦ湡
+                    return;
+                }
+                Logic.currlogic.cycle.type = "week";
+                Logic.currlogic.cycle.value = weekList;
+                button.Text = MainView.GetWeekString(weekList);
+                fLayout.RemoveFromParent();
+            };
+
+        }
+        /// <summary>
+        /// 姣忔湀
+        /// </summary>
+        /// <param name="fLayout">寮规涓绘帶浠�</param>
+        /// <param name="button">鏄剧ず鏂囨湰</param>
+        public void MonMethod(FrameLayout fLayout, Button button)
+        {
+            LogicView.MonView monView = new LogicView.MonView();
+            monView.btnTitle.TextID = StringId.monthly;
+            monView.FLayoutView(fLayout);
+            monView.btnCancel.MouseUpEventHandler += (sender2, e2) =>
+            {
+                monView.frameLayout.RemoveFromParent();
+            };
+            //瀹氫箟涓�涓眬閮╩onList鍒楄〃鐢ㄦ潵璁板綍閫変腑鏁版嵁;
+            List<string> monList = new List<string>();
+            if (Logic.currlogic.cycle.type == "mon")
+            {
+                //鍔犺浇涔嬪墠淇濆瓨鐨勬暟鎹�
+                monList.AddRange(Logic.currlogic.cycle.value);
+            }
+            //瀹氫箟涓�涓彉閲忚褰曡鏁�
+            int lineSun = 0;
+            for (int i = 1; i < 32; i++)
+            {
+                Button monTextBtn = new Button
+                {
+                    Width = Application.GetMinRealAverage(30),
+                    Height = Application.GetMinRealAverage(30),
+                    Radius = (uint)Application.GetRealHeight(15),
+                    Text = i.ToString(),
+                    TextSize = LogicView.TextSize.text14,
+                    TextColor = CSS.CSS_Color.textColor,
+                    SelectedTextColor = CSS.CSS_Color.view,
+                    SelectedBackgroundColor = CSS.CSS_Color.textConfirmColor,
+                    BackgroundColor = CSS.CSS_Color.viewTranslucence,
+                    Tag = i,
+                };
+                monView.frameLayout.AddChidren(monTextBtn);
+                if (lineSun > 0)
+                {
+                    monTextBtn.X = Application.GetRealWidth(16 + ((i - 1) - lineSun * 7) * 46);
+                }
+                else
+                {
+
+                    monTextBtn.X = Application.GetRealWidth(16 + (i - 1) * 46);
+                }
+                monTextBtn.Y = Application.GetRealWidth(58 + 10 + lineSun * (30 + 10));
+
+                if (i % 7 == 0)
+                {
+                    //涓�瀹氭墽琛屽畬鍐嶅垽鏂槸鍚﹁鎹㈣.
+                    lineSun = lineSun + 1;
+
+                }
+                monTextBtn.MouseUpEventHandler += (sender, e) =>
+                {
+                    string clickIndex = monTextBtn.Tag.ToString();
+                    monTextBtn.IsSelected = !monTextBtn.IsSelected;
+                    if (monTextBtn.IsSelected)
+                    {
+                        monTextBtn.IsSelected = true;
+                        if (!monList.Contains(clickIndex))
+                        {
+                            //娣诲姞閫変腑鏁版嵁
+                            monList.Add(clickIndex);
+                        }
+                    }
+                    else
+                    {
+                        monTextBtn.IsSelected = false;
+                        if (monList.Contains(clickIndex))
+                        {
+                            //绉婚櫎閫変腑鏁版嵁
+                            monList.Remove(clickIndex);
+                        }
+                    }
+                };
+
+                if (monList.Contains(i.ToString())) {
+                    monTextBtn.IsSelected = true;
+                }
+            }
+            //纭畾鐐瑰嚮浜嬩欢
+            monView.btnConfirm.MouseUpEventHandler += (sender1, e1) =>
+            {
+                if (monList.Count == 0)
+                {
+                    //鎻愮ず锛氳繕娌¢�変腑鎵ц鍛ㄦ湡
+                    return;
+                }
+                Logic.currlogic.cycle.type = "mon";
+                Logic.currlogic.cycle.value = monList;
+                button.Text = MainView.GetMonString(monList);
+                fLayout.RemoveFromParent();
+            };
+        }
+
+        /// <summary>
+        /// 婊¤冻鏉′欢
+        /// </summary>
+        /// <param name="fLayout">寮规涓绘帶浠�</param>
+        /// <param name="button">鏄剧ず鏂囨湰</param>
+        public void AndOrMethod(FrameLayout fLayout, Button button)
+        {
+            LogicView.DateView meetTheConditionView = new LogicView.DateView();
+            meetTheConditionView.btnTitle.TextID = StringId.meetTheCondition;
+            meetTheConditionView.FLayoutView(fLayout, 2);
+            meetTheConditionView.btnCancel.MouseUpEventHandler += (sender2, e2) =>
+            {
+                fLayout.RemoveFromParent();
+            };
+
+            //瀹氫箟涓�涓眬閮ㄥ彉閲忚褰曢�変腑鏂囨湰鐘舵��
+            string condition = "";
+            LogicView.SelectTypeView andConditionViews = new LogicView.SelectTypeView();
+            andConditionViews.frameLayout.BackgroundColor = CSS.CSS_Color.viewTranslucence;
+            andConditionViews.frameLayout.Y = Application.GetRealHeight(56);
+            andConditionViews.btnIcon.Visible = false;
+            andConditionViews.btnText.X = Application.GetRealWidth(20);
+            andConditionViews.btnText.TextID = StringId.andCondition;
+            andConditionViews.btnLine.X = Application.GetRealWidth(20);
+            andConditionViews.btnLine.Width = Application.GetRealWidth(303);
+            andConditionViews.btnNextIcon.X = Application.GetRealWidth(303);
+            andConditionViews.btnNextIcon.Width = Application.GetMinRealAverage(28);
+            andConditionViews.btnNextIcon.Height = Application.GetMinRealAverage(28);
+            andConditionViews.btnNextIcon.UnSelectedImagePath = "LogicIcon/weekoff.png";
+            andConditionViews.btnNextIcon.SelectedImagePath = "LogicIcon/weekon.png";
+            meetTheConditionView.frameLayout.AddChidren(andConditionViews.FLayoutView());
+
+
+            LogicView.SelectTypeView orConditionView = new LogicView.SelectTypeView();
+            orConditionView.frameLayout.BackgroundColor = CSS.CSS_Color.viewTranslucence;
+            orConditionView.frameLayout.Y = Application.GetRealHeight(56 + 50);
+            orConditionView.btnIcon.Visible = false;
+            orConditionView.btnText.X = Application.GetRealWidth(20);
+            orConditionView.btnText.TextID = StringId.orCondition;
+            orConditionView.btnLine.X = Application.GetRealWidth(20);
+            orConditionView.btnLine.Width = Application.GetRealWidth(303);
+            orConditionView.btnNextIcon.X = Application.GetRealWidth(303);
+            orConditionView.btnNextIcon.Width = Application.GetMinRealAverage(28);
+            orConditionView.btnNextIcon.Height = Application.GetMinRealAverage(28);
+            orConditionView.btnNextIcon.UnSelectedImagePath = "LogicIcon/weekoff.png";
+            orConditionView.btnNextIcon.SelectedImagePath = "LogicIcon/weekon.png";
+            meetTheConditionView.frameLayout.AddChidren(orConditionView.FLayoutView());
+
+
+            if (Logic.currlogic.relation == "and")
+            {
+                andConditionViews.btnNextIcon.IsSelected = true;
+                condition = "and";
+            }
+            else
+            {
+                orConditionView.btnNextIcon.IsSelected = true;
+                condition = "or";
+            }
+            andConditionViews.btnClick.MouseUpEventHandler += (sen1, e) =>
+            {
+                condition = "and";
+                andConditionViews.btnNextIcon.IsSelected = true;
+                orConditionView.btnNextIcon.IsSelected = false;
+            };
+            orConditionView.btnClick.MouseUpEventHandler += (sen1, e) =>
+            {
+                condition = "or";
+                andConditionViews.btnNextIcon.IsSelected = false;
+                orConditionView.btnNextIcon.IsSelected = true;
+            };
+            //纭畾鐐瑰嚮浜嬩欢
+            meetTheConditionView.btnConfirm.MouseUpEventHandler += (sender1, e1) =>
+            {
+                if (string.IsNullOrEmpty(condition))
+                {
+                    //鎻愮ず锛氳繕娌¢�変腑鎵ц鍛ㄦ湡
+                    return;
+                }
+                Logic.currlogic.relation = condition;
+                if (condition == "or")
+                {
+                    button.Text = Language.StringByID(StringId.orCondition);
+                }
+                else
+                {
+                    button.Text = Language.StringByID(StringId.andCondition);
+                }
+                fLayout.RemoveFromParent();
+            };
+
+        }
+
+
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
new file mode 100644
index 0000000..f839d4c
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
@@ -0,0 +1,284 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation
+{
+    public class AddTarget : FrameLayout
+    {
+        public AddTarget()
+        {
+            Tag = "Logic";
+        }
+        public void Show()
+        {
+
+            LogicView.TopView topView = new LogicView.TopView();
+            this.AddChidren(topView.FLayoutView());
+            topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
+            {
+                RemoveFromParent();
+            };
+            topView.topNameBtn.TextID = StringId.addtarget;
+
+            FrameLayout viewLayout = new FrameLayout
+            {
+                Y = Application.GetRealHeight(64),
+                Width = Application.GetRealWidth(LogicView.TextSize.view375),
+                Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64),
+                BackgroundColor = CSS.CSS_Color.viewMiddle,
+            };
+            this.AddChidren(viewLayout);
+            #region 鍔熻兘
+            //鍔熻兘
+            LogicView.SelectTypeView functionView = new LogicView.SelectTypeView();
+            functionView.btnText.TextID = StringId.funLogic;
+            functionView.btnIcon.UnSelectedImagePath = "LogicIcon/functionicon.png";
+            viewLayout.AddChidren(functionView.FLayoutView());
+
+            //鍦烘櫙
+            LogicView.SelectTypeView sceneView = new LogicView.SelectTypeView();
+            sceneView.frameLayout.Y = functionView.frameLayout.Bottom;
+            sceneView.btnText.TextID = StringId.Scenes;
+            sceneView.btnIcon.UnSelectedImagePath = "LogicIcon/scene.png";
+            viewLayout.AddChidren(sceneView.FLayoutView());
+
+            //寤舵椂
+            LogicView.SelectTypeView delayView = new LogicView.SelectTypeView();
+            delayView.frameLayout.Y = sceneView.frameLayout.Bottom;
+            delayView.btnText.TextID = StringId.delayLogic;
+            delayView.btnIcon.UnSelectedImagePath = "LogicIcon/delayed.png";
+            viewLayout.AddChidren(delayView.FLayoutView());
+            #endregion
+
+            #region  鎵�鏈夌偣鍑讳簨浠�
+            functionView.btnClick.MouseUpEventHandler += (sen, e) =>
+            {
+                FunTpye funTpye = new FunTpye();
+                MainPage.BasePageView.AddChidren(funTpye);
+                funTpye.Show(LogicMethod.target_if);
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+
+            };
+
+            sceneView.btnClick.MouseUpEventHandler += (sen, e) =>
+            {
+
+                FrameLayout fLayout = new FrameLayout
+                {
+                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+                };
+                this.AddChidren(fLayout);
+                SceneMethod(fLayout);
+            };
+
+            delayView.btnClick.MouseUpEventHandler += (sen, e) =>
+            {
+
+                FrameLayout fLayout = new FrameLayout
+                {
+                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+                };
+                this.AddChidren(fLayout);
+                Delayed(fLayout,false,1000);
+            };
+            #endregion
+
+        }
+
+        /// <summary>
+        /// 娣诲姞鍦烘櫙
+        /// </summary>
+        /// <param name="fLayout">寮规涓绘帶浠�</param>
+        public void SceneMethod(FrameLayout fLayout)
+        {
+            LogicView.DateView dateView = new LogicView.DateView();
+            dateView.btnTitle.TextID = StringId.addSceneLogic;
+            dateView.FLayoutView(fLayout, 5);
+            dateView.btnCancel.MouseUpEventHandler += (sender2, e2) =>
+            {
+                fLayout.RemoveFromParent();
+            };
+            VerticalRefreshLayout verticalRefresh = new VerticalRefreshLayout
+            {
+                Y = Application.GetRealHeight(56),
+                Height = Application.GetRealHeight(50 * 5),
+
+            };
+            dateView.frameLayout.AddChidren(verticalRefresh);
+            //瀹氫箟涓�涓眬閮ㄥ彉閲忚褰曢�変腑鐘舵��
+            Button buttonClick = new Button();
+            HDL_ON.Entity.Scene sceneSelecetd = null;
+            var sceneList = LogicMethod.GetSceneList();
+            verticalRefresh.BeginHeaderRefreshingAction += () =>
+            {
+                //鍏抽棴鍒锋柊View锛�
+                verticalRefresh.EndHeaderRefreshing();
+            };
+            for (int i = 0; i < sceneList.Count; i++)
+            {
+                var scene = sceneList[i];
+                LogicView.SelectTypeView sceneView = new LogicView.SelectTypeView();
+                sceneView.frameLayout.BackgroundColor = CSS.CSS_Color.viewTranslucence;
+                sceneView.btnIcon.Visible = false;
+                sceneView.btnText.X = Application.GetRealWidth(20);
+                sceneView.btnText.Text = scene.name;
+                sceneView.btnLine.X = Application.GetRealWidth(20);
+                sceneView.btnLine.Width = Application.GetRealWidth(303);
+                sceneView.btnNextIcon.X = Application.GetRealWidth(303);
+                sceneView.btnNextIcon.Width = Application.GetMinRealAverage(28);
+                sceneView.btnNextIcon.Height = Application.GetMinRealAverage(28);
+                sceneView.btnNextIcon.UnSelectedImagePath = "LogicIcon/weekoff.png";
+                sceneView.btnNextIcon.SelectedImagePath = "LogicIcon/weekon.png";
+                verticalRefresh.AddChidren(sceneView.FLayoutView());
+                sceneView.btnClick.Tag = scene;//鏍囪绱㈠紩
+
+                //鍦烘櫙鐨勭偣鍑讳簨浠�
+                sceneView.btnClick.MouseUpEventHandler += (sender, e) =>
+                {
+                    buttonClick.IsSelected = false;
+                    sceneView.btnNextIcon.IsSelected = true;
+                    buttonClick = sceneView.btnNextIcon;
+                    sceneSelecetd =sceneView.btnClick.Tag as HDL_ON.Entity.Scene;
+                };
+
+            }
+            //纭鐐瑰嚮浜嬩欢
+            dateView.btnConfirm.MouseUpEventHandler += (sender1, e1) =>
+            {
+                if (sceneSelecetd == null)
+                {
+                    //鎻愮ず锛氳繕娌¢�変腑鎵ц鍛ㄦ湡
+                    return;
+                }
+                Output outputDevice = new Output();
+                outputDevice.target_type = "2";
+                outputDevice.sid = sceneSelecetd.sid;
+                //娌″暐浣滅敤锛屼负浜嗘暟鎹牸寮忕粺涓�,鍙戦�佹椂涓嶅啀鍒ゆ柇
+                outputDevice.status = new List<Dictionary<string, string>> { new Dictionary<string, string> { { "key", "scene"},{ "value", "0" } } };
+                AddOutput(outputDevice);
+                fLayout.RemoveFromParent();
+                LogicMethod.RemoveAllView();
+                AddLogic addLogic = new AddLogic();
+                MainPage.BasePageView.AddChidren(addLogic);
+                addLogic.Show();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
+
+        }
+
+        /// <summary>
+        /// 寤舵椂鏃堕棿鏂规硶
+        /// </summary>
+        /// <param name="fLayout">鍦ㄥ摢涓晫闈㈡樉绀�</param>
+        /// <param name="edit">锛坱rue=缂栬緫锛沠alse=鏂板缓锛�</param>
+        /// <param name="index">缂栬緫鏉′欢鐨勭储寮�</param>
+        public void Delayed(FrameLayout fLayout, bool edit, int index)
+        {
+            LogicView.TimeView timePointView = new LogicView.TimeView();
+            timePointView.FLayoutView(fLayout);
+            EventHandler<MouseEventArgs> RemovefLayout = (sender, e1) =>
+            {
+                //绉婚櫎fLayout鐣岄潰
+                fLayout.RemoveFromParent();
+            };
+            //鍙栨秷鐐瑰嚮浜嬩欢
+            timePointView.btnCancel.MouseUpEventHandler += RemovefLayout;
+
+            //鍔犺浇鏁版嵁鐣岄潰鐨勮缃柟娉�(鍒楄〃浜掍笉鑱斿姩)
+            timePointView.mUIPickerView.setNPicker(timePointView.GethStringList0(), timePointView.GetmStringList(), null);
+            //榛樿鍒濆閫変腑鐘舵��
+            timePointView.mUIPickerView.setCurrentItems(0, 5, 0);
+            //瀹氫箟涓�涓眬閮ㄥ彉閲忚褰曢�変腑鏃堕棿
+            string timepoint = "00:05";
+
+            if (edit)
+            {
+                Output output = Logic.currlogic.output[index];
+                if (output.target_type == "3")
+                {
+                    List<Dictionary<string, string>> dicList = output.status as List<Dictionary<string, string>>;
+                    foreach (var dic in dicList)
+                    {
+                        string timeValue = dic["value"];
+                        int hIndex = timePointView.GetValueIndex(timeValue, 0, 1, timePointView.GethIntList0());
+                        int mIndex = timePointView.GetValueIndex(timeValue, 1, 0, timePointView.GetmIntList());
+                        //鏇存柊鍒濆鐘舵��
+                        timePointView.mUIPickerView.setCurrentItems(hIndex, mIndex, 0);
+                        timepoint = timeValue;
+                    }
+                }
+            }
+
+
+            //閫変腑鏃堕棿鍥炶皟鏂规硶,鏃堕棿鍙樺寲涓�娆″洖璋冧竴娆�
+            timePointView.mUIPickerView.OnSelectChangeEvent += (index1, index2, index3) =>
+            {
+                string hour = timePointView.GethStringList0()[index1].Split(' ')[0];
+                string minuet = timePointView.GetmStringList()[index2].Split(' ')[0];
+                timepoint = hour + ":" + minuet;
+            };
+            //纭畾鐐瑰嚮浜嬩欢
+            timePointView.btnConfirm.MouseUpEventHandler += (sender, e3) =>
+            {
+                if (timepoint=="00:00") {
+                    //鎻愮ず
+                    return;
+                }
+                Output outputTime= new Output();
+                outputTime.sid = LogicMethod.NewSid();
+                outputTime.target_type = "3";
+                Dictionary<string, string> dic = new Dictionary<string, string>();
+                LogicMethod.dictionary(dic, "key", "delay");
+                LogicMethod.dictionary(dic, "value", timepoint);
+                outputTime.status.Add(dic);
+                if (edit)
+                {
+                    //绉婚櫎鏃ф暟鎹�
+                    Logic.currlogic.output.RemoveAt(index);
+                    //鏂版暟鎹彃鍏ユ棫鏁版嵁鐨勪綅缃�;
+                    Logic.currlogic.output.Insert(index, outputTime);
+                }
+                else
+                {
+                    //娣诲姞涓�涓柊鐨勬椂闂寸偣鏉′欢
+                    AddOutput(outputTime);
+                }
+                fLayout.RemoveFromParent();
+                LogicMethod.RemoveAllView();
+                AddLogic addLogic = new AddLogic();
+                MainPage.BasePageView.AddChidren(addLogic);
+                addLogic.Show();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+
+            };
+        }
+
+        /// <summary>
+        /// 娣诲姞鐩爣
+        /// </summary>
+        /// <param name="target"></param>
+        private void AddOutput(Output target)
+        {
+            int indexValue = -1;
+            for (int i = 0; i < Logic.currlogic.output.Count; i++)
+            {
+                if (Logic.currlogic.output[i].sid == target.sid)
+                {
+                    indexValue = i;
+                    break;
+                }
+            }
+
+            if (indexValue != -1)
+            {
+                Logic.currlogic.output.RemoveAt(indexValue);
+                Logic.currlogic.output.Insert(indexValue, target);
+            }
+            else
+            {
+                Logic.currlogic.output.Add(target);
+            }
+
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Automation/.DS_Store b/HDL_ON/UI/UI2/3-Intelligence/Automation/Automation/.DS_Store
new file mode 100644
index 0000000..f14f384
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Automation/.DS_Store
Binary files differ
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/DeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/DeviceFunList.cs
new file mode 100644
index 0000000..e6e5698
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/DeviceFunList.cs
@@ -0,0 +1,386 @@
+锘縰sing System;
+using Shared;
+using System.Collections.Generic;
+namespace HDL_ON.UI.UI2.Intelligence.Automation
+{
+    public class DeviceFunList : FrameLayout
+    {
+        public DeviceFunList()
+        {
+            Tag = "Logic";
+        }
+        /// <summary>
+        /// 琛ㄧず鏄�(鏉′欢/鐩爣)
+        /// </summary>
+        private string if_type;
+        public void Show(Entity.Function device, int index, bool edit, string str)
+        {
+            if_type = str;
+            #region 鐣岄潰甯冨眬
+            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
+            LogicView.TopView topView = new LogicView.TopView();
+            this.AddChidren(topView.FLayoutView());
+            topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
+            {
+                RemoveFromParent();
+            };
+            topView.topNameBtn.Text = device.name;
+
+            FrameLayout fLayout = new FrameLayout
+            {
+                Y = Application.GetRealHeight(64),
+                Height = Application.GetRealHeight(667 - 64),
+            };
+            this.AddChidren(fLayout);
+            #endregion
+            //瀹氫箟涓�涓褰曢�変腑璁惧鐘舵�佸垪琛紱
+            List<Dictionary<string, string>> dicSateteList = new List<Dictionary<string, string>>();
+            //瀹氫箟涓�涓彉閲忥紝璁板綍閫変腑鐘舵��
+            string selectedState = "unknown";
+            //瀹氫箟涓�涓彉閲忥紝璁板綍閫変腑鐘舵�佽褰曞睘鎬�
+            string keyVlaue = "";
+            switch (device.functionType)
+            {
+                //寮�鍏崇伅鍏�
+                case FunctionType.Relay:
+                    {
+                        //for (int i = 0; i < device.function.Count; i++)
+                        //{
+                        //}
+                        LogicView.SelectTypeView relayView = new LogicView.SelectTypeView();
+                        relayView.btnIcon.Visible = false;
+                        relayView.btnState.Visible = true;
+                        relayView.btnText.TextSize = LogicView.TextSize.text16;
+                        relayView.btnText.Height = Application.GetRealHeight(22);
+                        relayView.btnText.TextID = StringId.switchLogic;
+                        relayView.btnText.X = Application.GetRealWidth(16);
+                        relayView.btnText.Width = Application.GetRealWidth(130);
+                        relayView.btnLine.X = Application.GetRealWidth(16);
+                        relayView.btnLine.Width = Application.GetRealWidth(343);
+                        relayView.btnState.Text = "";
+                        fLayout.AddChidren(relayView.FLayoutView());
+                        relayView.btnClick.MouseUpEventHandler += (sender, e) =>
+                        {
+                            FrameLayout relayFunView = new FrameLayout
+                            {
+                                BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+                            };
+                            this.AddChidren(relayFunView);
+                            LogicView.SwitchView switchView = new LogicView.SwitchView();
+                            switchView.FLayoutView(relayFunView, 2);
+
+                            Button btnOn = new Button
+                            {
+                                TextAlignment = TextAlignment.Center,
+                                TextSize = LogicView.TextSize.text16,
+                                TextColor = CSS.CSS_Color.textCancelColor,
+                                TextID = StringId.onLogic,
+                                Height = Application.GetRealHeight(44),
+                                Width = Application.GetRealWidth(343),
+
+                            };
+                            switchView.frameLayout.AddChidren(btnOn);
+                            Button btnLine = new Button
+                            {
+                                Height = 1,
+                                BackgroundColor = CSS.CSS_Color.viewLine,
+                                Y = btnOn.Bottom,
+                            };
+                            switchView.frameLayout.AddChidren(btnLine);
+                            Button btnOff = new Button
+                            {
+                                Y = btnLine.Bottom,
+                                TextAlignment = TextAlignment.Center,
+                                TextSize = LogicView.TextSize.text16,
+                                TextColor = CSS.CSS_Color.textCancelColor,
+                                TextID = StringId.offLogic,
+                                Height = Application.GetRealHeight(44),
+                                Width = Application.GetRealWidth(343),
+                            };
+                            switchView.frameLayout.AddChidren(btnOff);
+
+                            Dictionary<string, string> dic = new Dictionary<string, string>();
+                            switch (if_type)
+                            {
+                                case LogicMethod.condition_if:
+                                    {
+                                        LogicMethod.dictionary(dic, "key", "on_off");
+                                        LogicMethod.dictionary(dic, "comparator", "=");
+                                        LogicMethod.dictionary(dic, "data_type", "string");
+                                        keyVlaue = "on_off";
+                                    }
+                                    break;
+                                case LogicMethod.target_if:
+                                    {
+                                        LogicMethod.dictionary(dic, "key", "on_off");
+                                        keyVlaue = "on_off";
+                                    }
+                                    break;
+                            }
+
+                            btnOn.MouseUpEventHandler += (sender2, e2) =>
+                            {
+                                LogicMethod.dictionary(dic, "value", "on");
+                                RemView(relayFunView);
+                                relayView.btnState.TextID = StringId.onLogic;
+                                selectedState = device.functionType + "_on";
+                                AddDictionaryData(dicSateteList, keyVlaue, dic);
+                            };
+                            btnOff.MouseUpEventHandler += (sender3, e3) =>
+                            {
+                                LogicMethod.dictionary(dic, "value", "off");
+                                RemView(relayFunView);
+                                relayView.btnState.TextID = StringId.offLogic;
+                                selectedState = device.functionType + "_off";
+                                AddDictionaryData(dicSateteList, keyVlaue, dic);
+                            };
+
+                            if (relayView.btnState.Text != "")
+                            {
+                                if (relayView.btnState.Text == btnOn.Text)
+                                {
+                                    btnOn.TextColor = CSS.CSS_Color.textConfirmColor;
+                                }
+                                else
+                                {
+                                    btnOff.TextColor = CSS.CSS_Color.textConfirmColor;
+                                }
+                            }
+
+                        };
+                        if (edit)
+                        {
+                            GetEditState(device, edit, index, relayView.btnState, null, null, null);
+                        }
+
+                    }
+                    break;
+
+            }
+
+
+
+            #region  淇濆瓨
+            ///淇濆瓨View
+            LogicView.SaveView saveView = new LogicView.SaveView();
+            saveView.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(24), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
+            saveView.btnSave.TextID = StringId.completeLogic;
+            this.AddChidren(saveView.FLayoutView());
+            saveView.btnClick.MouseUpEventHandler += (sen, e) =>
+            {
+
+
+                if (selectedState != "unknown")
+                {
+                    if (if_type == LogicMethod.condition_if)
+                    {
+
+                        Input inputDevice = new Input(); 
+                        inputDevice.condition_type = "3";
+                        inputDevice.sid = device.sid;
+                        inputDevice.condition = dicSateteList;
+
+
+                        if (edit)
+                        {
+                            //绉婚櫎鏃ф暟鎹�
+                            Logic.currlogic.input.RemoveAt(index);
+                            //鏂版暟鎹彃鍏ユ棫鏁版嵁鐨勪綅缃�;
+                            Logic.currlogic.input.Insert(index, inputDevice);
+                        }
+                        else
+                        {
+                            //娣诲姞涓�涓潯浠�
+                            AddCondition(inputDevice);
+                        }
+                    }
+                    else
+                    {
+                        Output outputDevice = new Output();
+                        outputDevice.target_type = "1";
+                        outputDevice.sid = device.sid;
+                        outputDevice.status = dicSateteList;
+                        if (edit)
+                        {
+                            //绉婚櫎鏃ф暟鎹�
+                            Logic.currlogic.output.RemoveAt(index);
+                            //鏂版暟鎹彃鍏ユ棫鏁版嵁鐨勪綅缃�;
+                            Logic.currlogic.output.Insert(index, outputDevice);
+                        }
+                        else
+                        {
+                            //娣诲姞涓�涓潯浠�
+                            AddTarget(outputDevice);
+                        }
+                    }
+                }
+                else
+                {
+                    if (!edit)
+                    {
+                        //鎻愮ず鐢ㄦ埛
+                        return;
+                    }
+                    this.RemoveFromParent();
+                    return;
+                }
+                LogicMethod.RemoveAllView();
+                AddLogic addLogic = new AddLogic();
+                MainPage.BasePageView.AddChidren(addLogic);
+                addLogic.Show();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
+
+            #endregion
+
+        }
+        /// <summary>
+        /// 绉婚櫎鎺т欢
+        /// </summary>
+        /// <param name="frame"></param>
+        private void RemView(FrameLayout frame)
+        {
+            frame.RemoveFromParent();
+        }
+        /// <summary>
+        /// 鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬�
+        /// </summary>
+        /// <param name="device">缂栬緫璁惧</param>
+        /// <param name="edit">缂栬緫鐘舵��</param>
+        /// <param name="index">缂栬緫鏁版嵁鐨勭储寮�</param>
+        /// <param name="button1">鏄剧ずBtn</param>
+        /// <param name="button2">鏄剧ずBtn</param>
+        /// <param name="button3">鏄剧ずBtn</param>
+        /// <param name="button4">鏄剧ずBtn</param>
+        private void GetEditState(Entity.Function device, bool edit, int index, Button button1, Button button2, Button button3, Button button4)
+        {
+            var dicList = new List<Dictionary<string, string>>();
+            switch (if_type)
+            {
+                case LogicMethod.condition_if:
+                    {
+                        Input inputs = Logic.currlogic.input[index];
+                        dicList = inputs.condition as List<Dictionary<string, string>>;
+                    }
+                    break;
+                case LogicMethod.target_if:
+                    {
+                        Output outputs = Logic.currlogic.output[index];
+                        dicList = outputs.status as List<Dictionary<string, string>>;
+                    }
+                    break;
+            }
+            switch (device.functionType)
+            {
+                //寮�鍏崇伅鍏�
+                case FunctionType.Relay:
+                    {
+                        foreach (var dic in dicList)
+                        {
+                            string value = dic["value"];
+                            if (value == "on")
+                            {
+                                button1.Text = Language.StringByID(StringId.onLogic);
+                            }
+                            else
+                            {
+                                button1.Text = Language.StringByID(StringId.offLogic);
+                            }
+                        }
+                    }
+                    break;
+
+            }
+
+        }
+        /// <summary>
+        /// 娣诲姞閫変腑鏁版嵁
+        /// </summary>
+        /// <param name="dicList">鏁版嵁鍒楄〃</param>
+        /// <param name="keyValue">璇嗗埆璁惧</param>
+        /// <param name="dictionary">閫変腑鏁版嵁</param>
+        /// <returns></returns>
+        private void AddDictionaryData(List<Dictionary<string, string>> dicList, string keyValue, Dictionary<string, string> dictionary)
+        {
+            int indexValue = -1;
+            for (int i = 0; i < dicList.Count; i++)
+            {
+                var dic = dicList[i];
+                if (dic.ContainsValue(keyValue))
+                {
+                    //鍒ゆ柇鏄惁瀛樺湪
+                    indexValue = i;
+                    break;
+                }
+            }
+
+            if (indexValue != -1)
+            {
+                //瀛樺湪绉婚櫎
+                dicList.RemoveAt(indexValue);
+                //閲嶆柊娣诲姞
+                dicList.Insert(indexValue, dictionary);
+            }
+            else
+            {
+                //鏂版坊鍔�
+                dicList.Add(dictionary);
+            }
+
+        }
+        /// <summary>
+        /// 娣诲姞鏉′欢
+        /// </summary>
+        /// <param name="input"></param>
+        private void AddCondition(Input input)
+        {
+            int indexValue = -1;
+            for (int i = 0; i < Logic.currlogic.input.Count; i++)
+            {
+                if (Logic.currlogic.input[i].sid == input.sid)
+                {
+                    indexValue = i;
+                    break;
+                }
+            }
+
+            if (indexValue != -1)
+            {
+                Logic.currlogic.input.RemoveAt(indexValue);
+                Logic.currlogic.input.Insert(indexValue, input);
+            }
+            else
+            {
+                Logic.currlogic.input.Add(input);
+            }
+
+        }
+        /// <summary>
+        /// 娣诲姞鐩爣
+        /// </summary>
+        /// <param name="target"></param>
+        private void AddTarget(Output target)
+        {
+            int indexValue = -1;
+            for (int i = 0; i < Logic.currlogic.output.Count; i++)
+            {
+                if (Logic.currlogic.output[i].sid == target.sid)
+                {
+                    indexValue = i;
+                    break;
+                }
+            }
+
+            if (indexValue != -1)
+            {
+                Logic.currlogic.output.RemoveAt(indexValue);
+                Logic.currlogic.output.Insert(indexValue, target);
+            }
+            else
+            {
+                Logic.currlogic.output.Add(target);
+            }
+
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs
new file mode 100644
index 0000000..f09d0b0
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs
@@ -0,0 +1,256 @@
+锘縰sing System;
+using HDL_ON.UI.UI2.Intelligence.Automation.LogicView;
+using Shared;
+using System.Collections.Generic;
+
+namespace HDL_ON.UI.UI2.Intelligence.Automation
+{
+    public class FunTpye : FrameLayout
+    {
+        public FunTpye()
+        {
+            Tag = "Logic";
+        }
+        /// <summary>
+        /// 榛樿閫変腑鏄埧闂存椂锛氬叏閮ㄥ尯鍩�
+        /// </summary>
+        private Entity.Room selectedRoom = new Entity.Room { sid = Language.StringByID(StringId.allAreas) };
+        /// <summary>
+        /// 琛ㄧず鏄�(鏉′欢/鐩爣)
+        /// </summary>
+        private string if_type;
+        public void Show(string str)
+        {
+            
+            if_type = str;
+            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
+            LogicView.TopView topView = new LogicView.TopView();
+            this.AddChidren(topView.FLayoutView());
+            topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
+            {
+                RemoveFromParent();
+            };
+            topView.topNameBtn.TextID = StringId.selectedFunCondition;
+
+            LogicView.FunAllAreaView funAllAreaView = new LogicView.FunAllAreaView();
+            funAllAreaView.frameLayout.Y = topView.frameLayout.Bottom;
+            this.AddChidren(funAllAreaView.FLayoutView());
+
+            VerticalScrolViewLayout vv = new VerticalScrolViewLayout
+            {
+                Y = Application.GetRealHeight(117),
+                Height = Application.GetRealHeight(667 - 117),
+            };
+            this.AddChidren(vv);
+
+            //鎴块棿鐐瑰嚮浜嬩欢
+            EventHandler<MouseEventArgs> roomClick = (sender, e) =>
+            {
+                #region 鍖哄煙寮规鐣岄潰
+                FrameLayout fLayout = new FrameLayout
+                {
+                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+                };
+                this.AddChidren(fLayout);
+                fLayout.MouseUpEventHandler += (sender1, e1) =>
+                {
+                    fLayout.RemoveFromParent();
+                };
+
+                FrameLayout bghFrameLyout = new FrameLayout
+                {
+                    X = Application.GetRealWidth(10),
+                    Y = Application.GetRealHeight(103),
+                    Width = Application.GetRealWidth(160),
+                    Height = Application.GetRealHeight(21 + 44),
+                    BackgroundImagePath = "LogicIcon/bjicon.png",
+                };
+                fLayout.AddChidren(bghFrameLyout);
+
+                FrameLayout areaBgh = new FrameLayout
+                {
+                    X = Application.GetRealWidth(8),
+                    Y = Application.GetRealHeight(14),
+                    Width = Application.GetRealWidth(144),
+                    Height = Application.GetRealHeight(44),
+                };
+                VerticalScrolViewLayout vvBgh = new VerticalScrolViewLayout
+                {
+                    X = Application.GetRealWidth(8),
+                    Y = Application.GetRealHeight(14),
+                    Width = Application.GetRealWidth(144),
+                    Height = Application.GetRealHeight(44 * 5),
+                };
+                var roomList = LogicMethod.GetGatewayRoomList(Language.StringByID(StringId.allAreas));
+                if (roomList.Count > 5)
+                {
+                    bghFrameLyout.Height = Application.GetRealHeight(21 + 44 * 5);
+                    bghFrameLyout.AddChidren(vvBgh);
+
+                }
+                else
+                {
+
+                    bghFrameLyout.AddChidren(areaBgh);
+                    bghFrameLyout.Height = Application.GetRealHeight(21 + 44 * roomList.Count);
+                    areaBgh.Height = Application.GetRealHeight(44 * roomList.Count);
+                }
+                #endregion
+
+                for (int i = 0; i < roomList.Count; i++)
+                {
+                    var room = roomList[i];
+                    LogicView.AreaView areaView = new LogicView.AreaView();
+                    if (roomList.Count > 5)
+                    {
+                        vvBgh.AddChidren(areaView.FLayoutView());
+                    }
+                    else
+                    {
+                        areaView.frameLayout.Y = Application.GetRealHeight(i * 44);
+                        areaBgh.AddChidren(areaView.FLayoutView());
+                    }
+                    areaView.btnRoomName.Text = room.name;
+                    areaView.btnClick.Tag = room;
+                    areaView.btnClick.MouseUpEventHandler += (sender2, e2) =>
+                    {
+                        fLayout.RemoveFromParent();
+                        funAllAreaView.btnText1.Text = (areaView.btnClick.Tag as Entity.Room).name;
+                        ///鍒囨崲鎴块棿榛樿鍔熻兘绫诲瀷鍏ㄩ儴;
+                        funAllAreaView.btnText2.Text = Language.StringByID(StringId.allFun);
+                        selectedRoom = (areaView.btnClick.Tag as Entity.Room);
+                        ///鑾峰彇鏄剧ず璁惧鍒楄〃
+                        var list = LogicMethod.GetFunctionDeviceList(areaView.btnClick.Tag as Entity.Room,if_type);
+
+                        DeviceListView(vv, list);
+                    };
+
+                }
+            };
+            funAllAreaView.btnText1.MouseUpEventHandler += roomClick;
+            funAllAreaView.btnIcon1.MouseUpEventHandler += roomClick;
+            //鍔熻兘鐐瑰嚮浜嬩欢
+            EventHandler<MouseEventArgs> funClick = (sender3, e3) =>{
+                #region 鍖哄煙寮规鐣岄潰
+                FrameLayout fLayout = new FrameLayout
+                {
+                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+                };
+                this.AddChidren(fLayout);
+                fLayout.MouseUpEventHandler += (sender1, e1) =>
+                {
+                    fLayout.RemoveFromParent();
+                };
+
+                FrameLayout bghFrameLyout = new FrameLayout
+                {
+                    X = Application.GetRealWidth(10),
+                    Y = Application.GetRealHeight(103),
+                    Width = Application.GetRealWidth(160),
+                    Height = Application.GetRealHeight(21 + 44),
+                    BackgroundImagePath = "LogicIcon/bjicon.png",
+                };
+                fLayout.AddChidren(bghFrameLyout);
+
+                FrameLayout areaBgh = new FrameLayout
+                {
+                    X = Application.GetRealWidth(8),
+                    Y = Application.GetRealHeight(14),
+                    Width = Application.GetRealWidth(144),
+                    Height = Application.GetRealHeight(44),
+                };
+                VerticalScrolViewLayout vvBgh = new VerticalScrolViewLayout
+                {
+                    X = Application.GetRealWidth(8),
+                    Y = Application.GetRealHeight(14),
+                    Width = Application.GetRealWidth(144),
+                    Height = Application.GetRealHeight(44 * 5),
+                };
+
+                //鑾峰彇鏈�缁堟樉绀哄垪琛�
+                var functionList = LogicMethod.GetFunctionDeviceList(selectedRoom, if_type);
+                //鑾峰彇璁惧鍒楄〃鐨勭被鍨嬶紙渚嬪锛氱伅鍏夌被锛岀獥甯樼被銆傘�傘�傦級
+                var deviceTypeList = LogicMethod.GetDeviceTypeList(functionList);
+
+
+                if (deviceTypeList.Count > 5)
+                {
+                    bghFrameLyout.Height = Application.GetRealHeight(21 + 44 * 5);
+                    bghFrameLyout.AddChidren(vvBgh);
+
+                }
+                else
+                {
+                    bghFrameLyout.AddChidren(areaBgh);
+                    bghFrameLyout.Height = Application.GetRealHeight(21 + 44 * deviceTypeList.Count);
+                    areaBgh.Height = Application.GetRealHeight(44 * deviceTypeList.Count);
+                }
+                #endregion
+
+                for (int i = 0; i < deviceTypeList.Count; i++)
+                {
+                    var deviceTypeName = deviceTypeList[i];
+                    LogicView.AreaView areaView = new LogicView.AreaView();
+                    if (deviceTypeList.Count > 5)
+                    {
+                        vvBgh.AddChidren(areaView.FLayoutView());
+                    }
+                    else
+                    {
+                        areaView.frameLayout.Y = Application.GetRealHeight(i * 44);
+                        areaBgh.AddChidren(areaView.FLayoutView());
+                    }
+                    areaView.btnRoomName.Text = deviceTypeName;
+                    areaView.btnClick.Tag = deviceTypeName;
+                    areaView.btnClick.MouseUpEventHandler += (sender, e2) =>
+                    {
+                        fLayout.RemoveFromParent();
+                        funAllAreaView.btnText2.Text = areaView.btnClick.Tag.ToString();
+                        ///鑾峰彇鍗曚釜绫诲瀷锛堜緥濡傦細鐏厜绫汇�傘�傦級璁惧FunctionType鍒楄〃
+                        var typeFunctionList = LogicMethod.GetDeviceTypeFunctionList(areaView.btnClick.Tag.ToString());
+                        ///鑾峰彇鍗曚釜绫诲瀷锛堜緥濡傦細鐏厜绫汇�傘�傦級鏄剧ず璁惧鍒楄〃
+                        var lists = LogicMethod.GetShowDeviceList(typeFunctionList, functionList);
+                        DeviceListView(vv, lists);
+                    };
+
+                }
+            };
+            funAllAreaView.btnText2.MouseUpEventHandler += funClick;
+            funAllAreaView.btnIcon2.MouseUpEventHandler += funClick;
+            ///鑾峰彇鏄剧ず璁惧鍒楄〃
+            var deviceList = LogicMethod.GetFunctionDeviceList(selectedRoom, if_type);
+            DeviceListView(vv, deviceList);
+
+        }
+        /// <summary>
+        /// 鏄剧ず璁惧鐨刅iew
+        /// </summary>
+        /// <param name="verticalScrolView">涓婁笅婊戝姩</param>
+        /// <param name="deviceList"></param>
+        public void DeviceListView(VerticalScrolViewLayout verticalScrolView, List<HDL_ON.Entity.Function>  deviceList)
+        {
+            verticalScrolView.RemoveAll();
+            foreach (var dev in deviceList)
+            {
+                LogicView.SelectTypeView funView = new LogicView.SelectTypeView();
+                funView.btnText.Visible = false;
+                funView.btnDeviceName.Visible = true;
+                funView.btnRoomName.Visible = true;
+                funView.btnLine.X = Application.GetRealWidth(16);
+                funView.btnLine.Width = Application.GetRealWidth(343);
+                verticalScrolView.AddChidren(funView.FLayoutView());
+                funView.btnIcon.UnSelectedImagePath = LogicMethod.GetIconPath(dev.functionType);
+                funView.btnDeviceName.Text = dev.name;
+                funView.btnRoomName.Text = dev.GetRoomListName();
+                funView.btnClick.MouseUpEventHandler += (sen,e) => {
+                    DeviceFunList deviceFunList = new DeviceFunList();
+                    MainPage.BasePageView.AddChidren(deviceFunList);
+                    deviceFunList.Show(dev,0,false,if_type);
+                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                };
+            }
+        }
+    }
+
+
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
new file mode 100644
index 0000000..5f3a71b
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -0,0 +1,262 @@
+锘縰sing System;
+using Shared;
+using System.Collections.Generic;
+namespace HDL_ON.UI.UI2.Intelligence.Automation
+{
+    public class InpOrOutLogicMethod
+    {
+        /// <summary>
+        /// 杈撳叆鏉′欢澶勭悊鏂规硶
+        /// </summary>
+        /// <param name="thisView">褰撳墠鐣岄潰</param>
+        /// <param name="viewLayout">涓婁笅婊戝姩鎺т欢</param>
+        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.btnClick.Name = inputCondition.condition_type;
+                ///璁板綍鏉′欢绱㈠紩
+                inputView.btnClick.Tag = i;
+                ///鏉′欢鐘舵�佹暟缁�
+                List<Dictionary<string, string>> dicList = inputCondition.condition as List<Dictionary<string, string>>;
+                //鏄剧ず鏉′欢鍚勭绫诲瀷鐘舵��
+                switch (inputCondition.condition_type)
+                {
+                    case "1":
+                        {
+                            inputView.btnIcon.UnSelectedImagePath = "LogicIcon/timecondition.png";
+                            foreach (var dic in dicList)
+                            {
+                                string value = dic["value"];
+                                inputView.btnText.Text = Language.StringByID(StringId.hour) + ": " + value;
+                                inputView.btnClick.AddTag("timepoint", value);
+                            }
+
+                        }
+                        break;
+                    case "2":
+                        {
+                            inputView.btnIcon.UnSelectedImagePath = "LogicIcon/timecondition.png";
+                            foreach (var dic in dicList)
+                            {
+                                string value = dic["value"];
+                                inputView.btnText.Text = Language.StringByID(StringId.timeHorizon) + ": " + value;
+                                inputView.btnClick.AddTag("timeHorizon", value);
+                            }
+
+                        }
+                        break;
+                    case "3":
+                        {
+                            //鐢╯id鎵惧埌璁惧锛�
+                            var device = LogicMethod.GetDevice(inputCondition.sid);
+                            //鐢ㄨ澶囩殑functionType绫诲瀷鎵惧埌瀵瑰簲鍥炬爣锛�
+                            inputView.btnIcon.UnSelectedImagePath = LogicMethod.GetIconPath(device.functionType);
+                            //鏄剧ず璁惧鍚嶇О
+                            inputView.btnText.Text = device.name;
+                            //鏀瑰彉璁惧鍚嶇О鏄剧ず鎺т欢瀹藉害
+                            inputView.btnText.Width = Application.GetRealWidth(80);
+                            //鍖哄埆涓嶅悓璁惧锛屾樉绀轰笉鍚岃澶囩姸鎬�
+                            switch (device.functionType)
+                            {
+                                case FunctionType.Relay:
+                                    {//寮�鍏崇伅
+                                        foreach (var dic in dicList)
+                                        {
+                                            
+                                            string value = dic["value"];
+                                            if (value == "on")
+                                            {
+                                                inputView.btnState.Text = Language.StringByID(StringId.onLogic);
+
+                                            }
+                                            else
+                                            {
+                                                inputView.btnState.Text = Language.StringByID(StringId.offLogic);
+                                            }
+                                        }
+                                    }
+                                    break;
+                            }
+                        }
+                        break;
+
+                }
+                //鍐嶆缂栬緫鏉′欢鐘舵�佺偣鍑讳簨浠�
+                inputView.btnClick.MouseUpEventHandler += (sen, e) =>
+                {
+                    Button button = (Button)sen;
+                    //鎵惧埌褰撳墠缂栬緫鐨勭储寮�
+                    int indexVulae = int.Parse(inputView.btnClick.Tag.ToString());
+                    //鏍囪缂栬緫鐘舵��
+                    bool edit = true;
+                    //琛ㄧず鏄潯浠�
+                    string if_type = LogicMethod.condition_if;
+                    switch (button.Name)
+                    {
+                        case "1":
+                            {
+                                FrameLayout fLayout = new FrameLayout
+                                {
+                                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+                                };
+                                thisView.AddChidren(fLayout);
+                                TimeTpye timeTpye = new TimeTpye();
+                                timeTpye.TimePoint(fLayout, edit, indexVulae);
+                            }
+                            break;
+                        case "2":
+                            {
+                                FrameLayout fLayout = new FrameLayout
+                                {
+                                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+                                };
+                                thisView.AddChidren(fLayout);
+                                TimeTpye timeTpye = new TimeTpye();
+                                timeTpye.TimeHorizon(fLayout, edit, indexVulae);
+                            }
+                            break;
+
+                        case "3":
+                            {
+                                //鐢╯id鎵惧埌璁惧锛�
+                                var device = LogicMethod.GetDevice(inputCondition.sid);
+                                DeviceFunList deviceFunList = new DeviceFunList();
+                                MainPage.BasePageView.AddChidren(deviceFunList);
+                                deviceFunList.Show(device, indexVulae,edit, if_type);
+                                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                            }
+                            break;
+
+                        
+                    }
+                };
+            }
+
+        }
+        /// <summary>
+        /// 杈撳嚭鏉′欢澶勭悊鏂规硶
+        /// </summary>
+        /// <param name="thisView">褰撳墠鐣岄潰</param>
+        /// <param name="viewLayout">涓婁笅婊戝姩鎺т欢</param>
+        public static void OutputTarget(FrameLayout thisView, VerticalScrolViewLayout viewLayout)
+        {
+
+            for (int i = 0; i < Logic.currlogic.output.Count; i++)  
+            {
+                Output outputTarget = Logic.currlogic.output[i];
+                ///鍚勭鏉′欢鐨刅iew
+                LogicView.AddOutputInputView targetView = new LogicView.AddOutputInputView();
+                viewLayout.AddChidren(targetView.FLayoutView());
+                ///璁板綍鏉′欢绫诲瀷
+                targetView.btnClick.Name = outputTarget.target_type;
+                ///璁板綍鏉′欢绱㈠紩
+                targetView.btnClick.Tag = i;
+                ///鏉′欢鐘舵�佹暟缁�
+                List<Dictionary<string, string>> dicList = outputTarget.status as List<Dictionary<string, string>>;
+                //鏄剧ず鏉′欢鍚勭绫诲瀷鐘舵��
+                switch (outputTarget.target_type)
+                {
+                    case "1":
+                        {
+                            //鐢╯id鎵惧埌璁惧锛�
+                            var device = LogicMethod.GetDevice(outputTarget.sid);
+                            //鐢ㄨ澶囩殑functionType绫诲瀷鎵惧埌瀵瑰簲鍥炬爣锛�
+                            targetView.btnIcon.UnSelectedImagePath = LogicMethod.GetIconPath(device.functionType);
+                            //鏄剧ず璁惧鍚嶇О
+                            targetView.btnText.Text = device.name;
+                            //鏀瑰彉璁惧鍚嶇О鏄剧ず鎺т欢瀹藉害
+                            targetView.btnText.Width = Application.GetRealWidth(80);
+                            //鍖哄埆涓嶅悓璁惧锛屾樉绀轰笉鍚岃澶囩姸鎬�
+                            switch (device.functionType)
+                            {
+                                case FunctionType.Relay:
+                                    {//寮�鍏崇伅
+                                        foreach (var dic in dicList)
+                                        {
+
+                                            string value = dic["value"];
+                                            if (value == "on")
+                                            {
+                                                targetView.btnState.Text = Language.StringByID(StringId.onLogic);
+
+                                            }
+                                            else
+                                            {
+                                                targetView.btnState.Text = Language.StringByID(StringId.offLogic);
+                                            }
+                                        }
+                                    }
+                                    break;
+                            }
+                        }
+                        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) =>
+                {
+                    Button button = (Button)sen;
+                    //鎵惧埌褰撳墠缂栬緫鐨勭储寮�
+                    int indexVulae = int.Parse(targetView.btnClick.Tag.ToString());
+                    //鏍囪缂栬緫鐘舵��
+                    bool edit = true;
+                    //琛ㄧず鏄洰鏍�
+                    string if_type = LogicMethod.target_if;
+                    switch (button.Name)
+                    {
+                        case "1":
+                            {
+                                //鐢╯id鎵惧埌璁惧锛�
+                                var device = LogicMethod.GetDevice(outputTarget.sid);
+                                DeviceFunList deviceFunList = new DeviceFunList();
+                                MainPage.BasePageView.AddChidren(deviceFunList);
+                                deviceFunList.Show(device, indexVulae, edit, if_type);
+                                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;
+                    }
+                };
+            }
+        }
+
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs
new file mode 100644
index 0000000..95f9f48
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs
@@ -0,0 +1,105 @@
+锘縰sing System;
+using System.Collections.Generic;
+namespace HDL_ON.UI.UI2.Intelligence.Automation
+{
+    /// <summary>
+    /// 閫昏緫瀛樺偍鏁版嵁瀵硅薄
+    /// </summary>
+    public class Logic
+    {
+        /// <summary>
+        /// 閫昏緫鍒楄〃
+        /// </summary>
+        public static List<Logic> LogicList = new List<Logic>();
+        /// <summary>
+        /// 褰撳墠閫昏緫
+        /// </summary>
+        public static Logic currlogic;
+        /// <summary>
+        /// 閫昏緫鍞竴鏍囪瘑
+        /// </summary>
+        public string sid = "";
+        /// <summary>
+        /// 閫昏緫鍚嶇О
+        /// </summary>
+        public string name = "閫昏緫涓�";
+        /// <summary>
+        /// 閫昏緫鏉′欢鍏崇郴锛堜笌and:锛屾垨:or锛�
+        /// </summary>
+        public string relation = "or";
+        /// <summary>
+        /// 閫昏緫鐘舵�侊紙true锛宖alse锛�
+        /// </summary>
+        public string enable = "true";
+        /// <summary>
+        /// 閫昏緫鎵ц寰幆鍛ㄦ湡锛堟墽琛屼竴娆★紝姣忓ぉ锛屾瘡鏈堬紝鏄熸湡锛�
+        /// </summary>
+        public Cycle cycle = new Cycle();
+        /// <summary>
+        /// 閫昏緫杈撳叆鏉′欢鏁扮粍
+        /// </summary>
+        public List<Input> input = new List<Input>();
+        /// <summary>
+        /// 閫昏緫杈撳嚭鐩爣鏁扮粍
+        /// </summary>
+        public List<Output> output = new List<Output>();
+       
+
+    }
+    /// <summary>
+    /// 鎵ц鍛ㄦ湡瀵硅薄
+    /// </summary>
+    public class Cycle
+    {
+        /// <summary>
+        /// 鏃堕棿绫诲瀷
+        /// (鎵ц涓�娆�:once锛屾瘡澶�:day锛屾瘡鏈�:mon锛屾槦鏈�:week锛屾棩鏈熸:date_to_date)
+        /// </summary>
+        public string type = "day";
+        public List<string> value = new List<string>();
+    }
+    /// <summary>
+    /// 杈撳叆鏉′欢瀵硅薄
+    /// </summary>
+    public class Input
+    {
+        /// <summary>
+        /// 閫昏緫杈撳叆鏉′欢鍞竴鏍囪瘑
+        /// </summary>
+        public string sid = "";
+        /// <summary>
+        /// 閫昏緫杈撳叆鏉′欢绫诲瀷
+        /// 鏃堕棿鐐规潯浠�=1;
+        /// 鏃堕棿娈垫潯浠�=2;
+        /// 璁惧鐘舵�佸彉鍖栨潯浠�=3;
+        /// 鐜淇℃伅鏉′欢=4;
+        /// 瀹夐槻鏉′欢=5;
+        /// 浜戠澶╂皵鏉′欢=6;
+        /// 鏌愪釜閫昏緫/鍦烘櫙鐨勮緭鍑烘潯浠�=7;
+        /// 鍦扮悊鍥存爮=8;
+        /// </summary>
+        public string condition_type = "";
+        public List<Dictionary<string, string>> condition = new List<Dictionary<string, string>>();
+    }
+    /// <summary>
+    /// 杈撳嚭鐩爣瀵硅薄
+    /// </summary>
+    public class Output
+    {
+        /// <summary>
+        /// 閫昏緫杈撳嚭鐩爣鍞竴鏍囪瘑
+        /// </summary>
+        public string sid = "";
+        /// <summary>
+        /// 閫昏緫杈撳嚭鐩爣绫诲瀷
+        /// 璁惧=1;
+        /// 鍦烘櫙=2;
+        /// 寤舵椂=3;
+        /// </summary>
+        public string target_type = "";
+        public List<Dictionary<string, string>> status = new List<Dictionary<string, string>>();
+    }
+
+
+}
+
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
new file mode 100644
index 0000000..17ebb5e
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -0,0 +1,344 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared;
+
+namespace HDL_ON.UI.UI2.Intelligence.Automation
+{
+    
+    public class LogicMethod
+    {
+        /// <summary>
+        /// 琛ㄧず鏄潯浠�
+        /// </summary>
+        public const string condition_if = "鏉′欢";
+        /// <summary>
+        /// 琛ㄧず鏄洰鏍�
+        /// </summary>
+        public const string target_if = "鐩爣";
+        /// <summary>
+        /// 绉婚櫎鎵�鏈�"Logic"鐣岄潰
+        /// </summary>
+        public static void RemoveAllView()
+        {
+            MainPage.BasePageView.RemoveViewByTag("Logic");
+        }
+        /// <summary>
+        /// 鐢熸垚閫昏緫sid鏂规硶
+        /// </summary>
+        public static string NewSid()
+        {
+            string logicId = "";
+            try
+            {
+                string sOidBeginsWith = "000101";//鍘傚晢 + 閫氳鏂瑰紡
+                DateTime dt = DateTime.Now;
+                DateTime startTime = TimeZoneInfo.ConvertTimeToUtc(new DateTime(2020, 1, 1));
+                long m = (long)((dt - startTime).TotalMilliseconds / 10);
+                string sTimeSpan = "00000000";
+
+                byte[] arry = new byte[4];
+                arry[0] = (byte)(m & 0xFF);
+                arry[1] = (byte)((m & 0xFF00) >> 8);
+                arry[2] = (byte)((m & 0xFF0000) >> 16);
+                arry[3] = (byte)((m >> 24) & 0xFF);
+                sTimeSpan = arry[0].ToString("X2") + arry[1].ToString("X2") + arry[2].ToString("X2") + arry[3].ToString("X2");
+
+
+                if (sTimeSpan.Length > 8)
+                {
+                    sTimeSpan = sTimeSpan.Substring(0, 8);
+                }
+                else
+                {
+                    sTimeSpan = "00000000";
+                }
+
+                logicId = sOidBeginsWith + sTimeSpan;
+
+                logicId += "0A";
+                logicId += "0A01";
+                //0A01 鐗╂ā鍨嬩负閫昏緫锛� 0001 琛ㄧず 1 鍙烽�昏緫鍔熻兘
+                int iTopLogicId = 1;
+
+                Random random = new Random();
+                iTopLogicId = random.Next(0, 255);
+                iTopLogicId += random.Next(0, 255);
+
+                logicId += iTopLogicId.ToString("X4");//閫昏緫鍙� 涓や釜byte 
+                logicId += "1100";
+            }
+            catch
+            {
+                return logicId;
+            }
+            return logicId;
+        }
+        /// <summary>
+        /// 灏佽Dictionary瀵硅薄
+        /// </summary>
+        /// <param name="dic">Dictionary绫�</param>
+        /// <param name="key">鍋�</param>
+        /// <param name="value">鍊�</param>
+        public static void dictionary(Dictionary<string, string> dic, string key, string value)
+        {
+            if (dic.ContainsKey(key)) //鍒ゆ柇鏄惁瀛樺湪閿��
+            {
+                //閿瓨鍦ㄧЩ闄�
+                dic.Remove(key);
+            }
+            //娣诲姞閿��
+            dic.Add(key, value);
+        }
+        /// <summary>
+        /// 鑾峰彇缃戝叧鎴块棿鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<HDL_ON.Entity.Room> GetGatewayRoomList() 
+        {
+            return HDL_ON.Entity.DB_ResidenceData.rooms;
+        }
+        /// <summary>
+        /// 鑾峰彇缃戝叧鎴块棿鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<HDL_ON.Entity.Room> GetGatewayRoomList(string name) 
+        {
+
+            List<Entity.Room> roomList = new List<Entity.Room>();
+            Entity.Room room1 = new Entity.Room();
+            room1.name = name;//榛樿涓�涓埧闂村悕涓�:鍏ㄩ儴鍖哄煙
+            room1.sid = "鍏ㄩ儴鍖哄煙";//榛樿sid鐢ㄨ瘑鍒鎴块棿
+            roomList.Add(room1);//榛樿娣诲姞鍒版埧闂村垪琛ㄩ噷
+            var roomLists = GetGatewayRoomList();
+            foreach (var room in roomLists)
+            {
+                roomList.Add(room);
+            }
+
+            return roomList;
+        }
+        /// <summary>
+        /// 鑾峰彇缃戝叧璁惧鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<HDL_ON.Entity.Function> GetGatewayDeviceList()
+        {
+
+            return HDL_ON.Entity.DB_ResidenceData.functionList.GetAllFunction();
+        }
+        /// <summary>
+        /// 鑾峰彇缃戝叧鍦烘櫙鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<HDL_ON.Entity.Scene> GetSceneList()
+        {
+           return  HDL_ON.Entity.DB_ResidenceData.functionList.scenes;
+        }
+        /// <summary>
+        /// 鑾峰彇鎴块棿鐨勮澶囧垪琛�
+        /// </summary>
+        /// <param name="room">褰撳墠鎴块棿</param>
+        /// <returns></returns>
+        public static List<HDL_ON.Entity.Function> GetRoomDevice(HDL_ON.Entity.Room room)
+        {
+            List<HDL_ON.Entity.Function> deviceLists = new List<Entity.Function>();
+            List<HDL_ON.Entity.Function> lists = GetGatewayDeviceList();
+            foreach (var dev in lists)
+            {
+                if (dev.roomIdList.Find((id) => id == room.sid) != null)
+                {
+                    deviceLists.Add(dev);
+                }
+                if (room.sid == "鍏ㄩ儴鍖哄煙")
+                {
+                    //鎴块棿鍚嶄负鍏ㄩ儴鍖哄煙鏃讹紝鏄剧ず缃戝叧鍏ㄩ儴璁惧
+                    deviceLists = lists;
+                }
+
+            }
+            return deviceLists;
+        }
+        /// <summary>
+        /// 鑾峰彇褰撲釜璁惧
+        /// </summary>
+        /// <param name="sid">璁惧鍞竴鏍囪瘑</param>
+        /// <returns></returns>
+        public static HDL_ON.Entity.Function GetDevice(string sid)
+        {
+            HDL_ON.Entity.Function device = new Entity.Function() { name= "Unknown",sid="璁惧涓嶅瓨鍦�"};
+            List<HDL_ON.Entity.Function> deviceLists = GetGatewayDeviceList();
+            foreach (var dev in deviceLists)
+            {
+                if (dev.sid == sid)
+                {
+                    device = dev;
+                    break;
+                }
+            }
+            return device;
+        }
+
+        /// <summary>
+        /// 鑾峰彇褰撲釜鍦烘櫙
+        /// </summary>
+        /// <param name="sid">鍦烘櫙鍞竴鏍囪瘑</param>
+        /// <returns></returns>
+        public static HDL_ON.Entity.Scene GetSecne(string sid)
+        {
+            HDL_ON.Entity.Scene scene = new Entity.Scene() { name = "Unknown", sid = "鍦烘櫙涓嶅瓨鍦�" };
+            List<HDL_ON.Entity.Scene> sceneLists = GetSceneList();
+            foreach (var sce in sceneLists)
+            {
+                if (sce.sid == sid)
+                {
+                    scene = sce;
+                    break;
+                }
+            }
+            return scene;
+        }
+        /// <summary>
+        /// 鑾峰彇鎴块棿鍚�(鍗虫槸=鍖哄煙鍚嶇О)
+        /// </summary>
+        /// <param name="device">璁惧</param>
+        /// <returns></returns>
+        public static string GetGetRoomName(HDL_ON.Entity.Function device)
+        {
+            string roomName = "";
+            List<HDL_ON.Entity.Room> roomLists = GetGatewayRoomList();
+
+            foreach (var dev in device.roomIdList)
+            {
+                var room = roomLists.Find((c) => c.sid == dev);
+                if (room != null)
+                {
+                    roomName += room.floorName + "." + room.name + ",";
+                }
+            }
+
+            return roomName.TrimEnd(',');
+        }
+        /// <summary>
+        /// 鑾峰彇璁惧绫诲瀷鍥炬爣
+        /// </summary>
+        /// <param name="functionType">璁惧绫诲瀷</param>
+        /// <returns></returns>
+        public static string GetIconPath(FunctionType functionType)
+        {
+            string strPath = "";
+            switch (functionType)
+            {
+                case FunctionType.Relay:
+                    {
+                        strPath = "LogicIcon/lightloguc.png";
+                    }
+                    break;
+
+            }
+            return strPath;
+        }
+        /// <summary>
+        /// 璁惧绫诲瀷鐨勫垪琛�(鐏厜绫伙紝绐楀笜绫汇�傘�傘��)
+        /// </summary>
+        /// <param name="deviceList">璁惧鍒楄〃</param>
+        /// <returns></returns>
+        public static List<string> GetDeviceTypeList(List<HDL_ON.Entity.Function> deviceList) 
+        {
+            List<string> deviceStrTypeList = new List<string>(); 
+            deviceStrTypeList.Clear();
+            var lightjosn = deviceList.Find((device) => device.functionType == FunctionType.Relay || device.functionType == FunctionType.Dimmer);
+            if (lightjosn != null)
+            {
+                deviceStrTypeList.Add(Language.StringByID(StringId.Lights));
+            }
+
+            var curtainjosn = deviceList.Find((device) => device.functionType ==FunctionType.Curtain);
+            if (curtainjosn != null)
+            {
+                deviceStrTypeList.Add(Language.StringByID(StringId.Curtain));
+            }
+
+            var ac = deviceList.Find((device) => device.functionType == FunctionType.AC);
+            if (ac != null)
+            {
+                deviceStrTypeList.Add(Language.StringByID(StringId.AC));
+            }
+            return deviceStrTypeList;
+
+        }
+        /// <summary>
+        /// 璁惧绫诲瀷FunctionType鍒楄〃
+        /// </summary>
+        /// <param name="deviceType">璁惧绫诲瀷(鐏厜绫伙紝绐楀笜绫汇��)</param>
+        /// <returns></returns>
+        public static List<FunctionType> GetDeviceTypeFunctionList(string deviceType)
+        {
+            List<FunctionType> functionTypeList = new List<FunctionType>();
+            if (deviceType == Language.StringByID(StringId.Lights))
+            {
+                functionTypeList.Add(FunctionType.Relay);
+                functionTypeList.Add(FunctionType.Dimmer);
+            }
+            else if (deviceType == Language.StringByID(StringId.Curtain))
+            {
+                functionTypeList.Add(FunctionType.Curtain);
+            }
+            return functionTypeList;
+
+        }
+        /// <summary>
+        /// 鏉′欢/鐩爣鏀寔璁惧
+        /// </summary>
+        /// <returns></returns>
+        public static List<FunctionType> GetSupportEquipment(string if_type)  
+        {
+            List<FunctionType> deviceTypeList = new List<FunctionType>();
+            switch (if_type) {
+                case condition_if: {
+                        deviceTypeList.Add(FunctionType.Relay);
+                    }
+                    break;
+                case target_if:
+                    {
+                        deviceTypeList.Add(FunctionType.Relay);
+                    }
+                    break;
+            }
+            return deviceTypeList;
+        }
+        /// <summary>
+        /// 鏄剧ず鐨勮澶囧垪琛�
+        /// </summary>
+        /// <param name="functionType">婧愭暟鎹垪琛�1</param>
+        /// <param name="deviceList">婧愭暟鎹垪琛�2</param>
+        /// <returns></returns>
+        public static List<Entity.Function> GetShowDeviceList(List<FunctionType> functionType, List<HDL_ON.Entity.Function> deviceList)
+        {
+            List<HDL_ON.Entity.Function> devList = new List<Entity.Function>();
+            foreach (var dev in deviceList)
+            {
+                if (functionType.Contains(dev.functionType))
+                {
+                    ///杩囨护鎺変笉闇�瑕佹樉绀虹殑璁惧
+                    devList.Add(dev);
+                }
+            }
+            return devList;
+        }
+        /// <summary>
+        /// 杩斿洖鏈�缁堟敮鎸佹樉绀哄嚭鏉ョ殑璁惧鍒楄〃
+        /// </summary>
+        /// <param name="room">褰撳墠鎴块棿</param>
+        /// <param name="str">鍒ゆ柇绗︼紙琛ㄧず=杈撳叆璁惧鍜岃緭鍑鸿澶囷級</param>
+        /// <returns></returns>
+        public static List<Entity.Function> GetFunctionDeviceList(Entity.Room room, string str)
+        {
+            List<FunctionType> functionTypeList = GetSupportEquipment(str);
+            //杩斿洖鎴块棿璁惧鍒楄〃
+            var roomDeviceList = GetRoomDevice(room);
+            //杩斿洖鏈�缁堟敮鎸佹樉绀哄嚭鏉ョ殑璁惧鍒楄〃
+            var list = GetShowDeviceList(functionTypeList, roomDeviceList);
+            return list;
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputTextView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputTextView.cs
new file mode 100644
index 0000000..007edf4
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputTextView.cs
@@ -0,0 +1,42 @@
+锘縰sing System;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class AddOutputInputTextView
+    {
+        /// <summary>
+        /// 涓绘帶浠�
+        /// </summary>
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Height = Application.GetRealHeight(46),
+        };
+        /// <summary>
+        /// 鏄剧ず锛堝鏋�/灏辨墽琛岋級
+        /// </summary>
+        public Button btnIf = new Button
+        {
+            TextSize = TextSize.text16,
+            TextColor = CSS.CSS_Color.textColor,
+            Width = Application.GetRealWidth(32 + 32),
+            Height = Application.GetRealHeight(22),
+            Y = Application.GetRealHeight(12),
+            X = Application.GetRealWidth(TextSize.left16),
+            TextAlignment = TextAlignment.CenterLeft,
+            TextID = StringId.ifCondition,
+            IsBold = true,
+        };
+        /// <summary>
+        /// 锛堝鏋�/灏辨墽琛岋級鐨勬柟娉�
+        /// </summary>
+        /// <returns></returns>
+        public FrameLayout FLayoutView(int flHeight,int btnY)
+        {
+            frameLayout.Height = Application.GetRealHeight(flHeight);
+            btnIf.Y= Application.GetRealHeight(btnY);
+            frameLayout.AddChidren(btnIf);
+
+            return frameLayout;
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs
new file mode 100644
index 0000000..8fae4eb
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs
@@ -0,0 +1,106 @@
+锘縰sing System;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class AddOutputInputView
+    {
+        /// <summary>
+        /// 涓绘帶浠禫iew
+        /// </summary>
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Height = Application.GetRealHeight(44),
+            Width = Application.GetRealWidth(343),
+           BackgroundColor= CSS.CSS_Color.view,
+            X = Application.GetRealWidth(LogicView.TextSize.left16),
+        };
+        /// <summary>
+        /// 锛堟潯浠舵垨鑰呯洰鏍囷級鍥炬爣
+        /// </summary>
+        public Button btnIcon= new Button
+        {
+            Width= Application.GetMinRealAverage(28),
+            Height =Application.GetMinRealAverage(28),
+            //Y = Application.GetRealHeight(8),
+            X = Application.GetRealWidth(TextSize.left12),
+            
+        };
+        /// <summary>
+        /// 锛堟潯浠舵垨鑰呯洰鏍囷級鏂囨湰鎻忚堪
+        /// </summary>
+        public Button btnText= new Button
+        {
+            TextSize = TextSize.text14,
+            Width = Application.GetRealWidth(250),
+            Height = Application.GetRealHeight(20),
+            TextColor= CSS.CSS_Color.textColor,
+            //Y=Application.GetRealHeight(12),
+            X = Application.GetRealWidth(52),
+        };
+
+        /// <summary>
+        /// 锛堟潯浠舵垨鑰呯洰鏍囷級璁惧鐘舵�佹枃鏈弿杩�
+        /// </summary>
+        public Button btnState = new Button
+        {
+            TextSize = TextSize.text12,
+            Width = Application.GetRealWidth(130),
+            Height = Application.GetRealHeight(17),
+            TextColor = CSS.CSS_Color.textCancelColor,
+            Y=Application.GetRealHeight(14),
+            X = Application.GetRealWidth(165),
+            TextAlignment=TextAlignment.CenterRight,
+        };
+
+        /// <summary>
+        /// 锛堟潯浠舵垨鑰呯洰鏍囷級鍥炬爣
+        /// </summary>
+        public Button btnNextIcon = new Button
+        {
+            Width = Application.GetMinRealAverage(16),
+            Height = Application.GetMinRealAverage(16),
+            UnSelectedImagePath = "LogicIcon/next.png",
+            //Y = Application.GetRealHeight(14),
+            X = Application.GetRealWidth(315),
+
+        };
+
+        /// <summary>
+        /// 绾�
+        /// </summary>
+        public Button btnLine = new Button
+        {
+            Width=Application.GetRealWidth(279),
+            Y = Application.GetRealHeight(44-1),
+            X = Application.GetRealWidth(52),
+            Height = 1,
+            BackgroundColor = CSS.CSS_Color.viewLine,
+
+        };
+
+        public Button btnClick = new Button
+        {
+            Height = Application.GetRealHeight(44),
+            Width = Application.GetRealWidth(343),
+        };
+        /// <summary>
+        /// View鐨勬柟娉�
+        /// </summary>
+        /// <returns></returns>
+        public FrameLayout FLayoutView()
+        {
+            btnIcon.Gravity = Gravity.CenterVertical;
+            btnText.Gravity = Gravity.CenterVertical;
+            btnText.TextAlignment = TextAlignment.CenterLeft;
+            btnNextIcon.Gravity = Gravity.CenterVertical;
+            frameLayout.AddChidren(btnIcon);
+            frameLayout.AddChidren(btnText);
+            frameLayout.AddChidren(btnState);
+            frameLayout.AddChidren(btnNextIcon);
+            btnLine.Y = frameLayout.Height - 1;
+            frameLayout.AddChidren(btnLine);
+            frameLayout.AddChidren(btnClick);
+            return frameLayout;
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AreaView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AreaView.cs
new file mode 100644
index 0000000..9f41dc9
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AreaView.cs
@@ -0,0 +1,57 @@
+锘縰sing System;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class AreaView
+    {
+        /// <summary>
+        /// 涓绘帶浠�
+        /// </summary>
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Width = Application.GetRealWidth(144),
+            Height = Application.GetRealHeight(44),
+        };
+        /// <summary>
+        /// 鎴块棿鍚�
+        /// </summary>
+        public Button btnRoomName = new Button
+        {
+            Width = Application.GetRealWidth(100),
+            Height = Application.GetRealHeight(20),
+            X = Application.GetRealWidth(16),
+            TextAlignment = TextAlignment.CenterLeft,
+            Gravity = Gravity.CenterVertical,
+            TextSize = TextSize.text14,
+            TextColor = CSS.CSS_Color.textColor,
+
+        };
+        /// <summary>
+        /// 绾�
+        /// </summary>
+        public Button btnLine = new Button
+        {
+            Width = Application.GetRealWidth(112),
+            X = Application.GetRealWidth(16),
+            Height = 1,
+            BackgroundColor = CSS.CSS_Color.viewLine,
+        };
+        public Button btnClick = new Button
+        {
+            Width = Application.GetRealWidth(144),
+            Height = Application.GetRealHeight(44),
+        };
+        /// <summary>
+        /// View鐨勬柟娉�
+        /// </summary>
+        /// <returns></returns>
+        public FrameLayout FLayoutView()
+        {
+            frameLayout.AddChidren(btnRoomName);
+            btnLine.Y = frameLayout.Height - 1;
+            frameLayout.AddChidren(btnLine);
+            frameLayout.AddChidren(btnClick);
+            return frameLayout;
+        }
+    }
+}
\ No newline at end of file
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/ConfirmPopView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/ConfirmPopView.cs
new file mode 100644
index 0000000..b27bab0
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/ConfirmPopView.cs
@@ -0,0 +1,10 @@
+锘縰sing System;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class ConfirmPopView
+    {
+        public ConfirmPopView()
+        {
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/DateView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/DateView.cs
new file mode 100644
index 0000000..69dbc71
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/DateView.cs
@@ -0,0 +1,82 @@
+锘縰sing System;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class DateView 
+    {
+        /// <summary>
+        /// 涓绘帶浠�
+        /// </summary>
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Y = Application.GetRealHeight(460),
+            Height = Application.GetRealHeight(56 + 150),
+            Width = Application.GetRealWidth(343),
+            X = Application.GetRealWidth(16),
+            BackgroundColor = CSS.CSS_Color.view,
+            Radius = (uint)Application.GetRealHeight(12),
+        };
+        /// <summary>
+        /// 鏍囬Btn
+        /// </summary>
+        public Button btnTitle = new Button
+        {
+            TextID = StringId.timeHorizon,
+            TextSize = TextSize.text16,
+            TextColor = CSS.CSS_Color.textColor,
+            IsBold = true,
+            Width = Application.GetRealWidth(343 - (52 + 4 + 10) * 2),
+            Height = Application.GetRealHeight(22),
+            Y = Application.GetRealHeight(17),
+            X = Application.GetRealWidth(52 + 4 + 10)
+        };
+        /// <summary>
+        /// 鍙栨秷Btn
+        /// </summary>
+        public Button btnCancel = new Button
+        {
+            TextID = StringId.cancelSelected,
+            TextSize = TextSize.text14,
+            TextColor = CSS.CSS_Color.textCancelColor,
+            Width = Application.GetRealWidth(52),
+            Height = Application.GetRealHeight(32),
+            Y = Application.GetRealHeight(10),
+            X = Application.GetRealWidth(4)
+        };
+        /// <summary>
+        /// 纭畾Btn
+        /// </summary>
+        public Button btnConfirm = new Button
+        {
+            TextID = StringId.confirmSelected,
+            TextSize = TextSize.text14,
+            TextColor = CSS.CSS_Color.textConfirmColor,
+            Width = Application.GetRealWidth(52),
+            Height = Application.GetRealHeight(32),
+            X = Application.GetRealWidth(343 - 4 - 52),
+            Y = Application.GetRealHeight(10),
+        };
+        /// <summary>
+        /// View鐨勬柟娉�
+        /// </summary>
+        /// <param name="fLayout"></param>
+        /// <param name="i"></param>
+        public void FLayoutView(FrameLayout fLayout, int i)
+        {
+            frameLayout.Y = Application.GetRealHeight(667 - 20 - 56 - 50 * i);
+            frameLayout.Height = Application.GetRealHeight(56 + 50 * i);
+            frameLayout.AddChidren(btnTitle);
+            frameLayout.AddChidren(btnCancel);
+            frameLayout.AddChidren(btnConfirm);
+            fLayout.AddChidren(frameLayout);
+            ////鐣岄潰鐐瑰嚮浜嬩欢
+            //fLayout.MouseUpEventHandler += (sender, e1) =>
+            //{
+            //    //绉婚櫎fLayout鐣岄潰
+            //    fLayout.RemoveFromParent();
+            //};
+            //鍙栨秷鐐瑰嚮浜嬩欢
+           
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/EditPopView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/EditPopView.cs
new file mode 100644
index 0000000..febed1c
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/EditPopView.cs
@@ -0,0 +1,10 @@
+锘縰sing System;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class EditPopView
+    {
+        public EditPopView()
+        {
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunAllAreaView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunAllAreaView.cs
new file mode 100644
index 0000000..4381fa0
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/FunAllAreaView.cs
@@ -0,0 +1,84 @@
+锘縰sing System;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class FunAllAreaView
+    {
+        /// <summary>
+        /// 涓绘帶浠禫iew
+        /// </summary>
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Height = Application.GetRealHeight(53),
+            BackgroundColor = CSS.CSS_Color.view,
+        };
+        /// <summary>
+        /// 绗竴涓笅鎷夊浘鏍�
+        /// </summary>
+        public Button btnIcon1 = new Button
+        {
+            Width = Application.GetMinRealAverage(16),
+            Height = Application.GetMinRealAverage(16),
+            Y = Application.GetRealHeight(19),
+            X = Application.GetRealWidth(TextSize.left16),
+            UnSelectedImagePath = "LogicIcon/down.png",
+
+        };
+        /// <summary>
+        /// 绗竴涓枃鏈弿杩�
+        /// </summary>
+        public Button btnText1 = new Button
+        {
+            TextSize = TextSize.text12,
+            Width = Application.GetRealWidth(70),
+            Height = Application.GetRealHeight(17),
+            TextColor = CSS.CSS_Color.textColor,
+            Y=Application.GetRealHeight(18),
+            X = Application.GetRealWidth(34),
+            TextAlignment = TextAlignment.CenterLeft,
+            TextID=StringId.allAreas,
+            
+        };
+
+        /// <summary>
+        /// 绗簩涓笅鎷夊浘鏍�
+        /// </summary>
+        public Button btnIcon2 = new Button
+        {
+            Width = Application.GetMinRealAverage(16),
+            Height = Application.GetMinRealAverage(16),
+            Y = Application.GetRealHeight(19),
+            X = Application.GetRealWidth(122),
+            UnSelectedImagePath = "LogicIcon/down.png",
+
+        };
+        /// <summary>
+        /// 绗簩涓枃鏈弿杩�
+        /// </summary>
+        public Button btnText2 = new Button
+        {
+            TextSize = TextSize.text12,
+            Width = Application.GetRealWidth(70),
+            Height = Application.GetRealHeight(17),
+            TextColor = CSS.CSS_Color.textColor,
+            Y=Application.GetRealHeight(18),
+            X = Application.GetRealWidth(140),
+            TextAlignment = TextAlignment.CenterLeft,
+            TextID = StringId.allFun,
+        };
+
+        /// <summary>
+        ///View鐨勬柟娉�
+        /// </summary>
+        /// <returns></returns>
+        public FrameLayout FLayoutView()
+        {
+            frameLayout.AddChidren(btnIcon1);
+            frameLayout.AddChidren(btnText1);
+            frameLayout.AddChidren(btnIcon2);
+            frameLayout.AddChidren(btnText2);
+            return frameLayout;
+        }
+       
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicAddView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicAddView.cs
new file mode 100644
index 0000000..27619e5
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicAddView.cs
@@ -0,0 +1,45 @@
+锘縰sing System;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class LogicAddView
+    {
+        /// <summary>
+        /// 涓绘帶浠�
+        /// </summary>
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Height = Application.GetRealHeight(80),
+            Width = Application.GetRealWidth(343),
+            BackgroundColor = CSS.CSS_Color.view,
+            X = Application.GetRealWidth(LogicView.TextSize.left16),
+        };
+        /// <summary>
+        /// 娣诲姞璁惧绫诲瀷鐨勫浘鏍囨帶浠�
+        /// </summary>
+        public Button btnAddIcon= new Button
+        {
+            Width = Application.GetMinRealAverage(20),
+            Height = Application.GetMinRealAverage(20),
+            UnSelectedImagePath = "LogicIcon/addconditiontarget.png",
+            Y = Application.GetRealHeight(22),
+            X = Application.GetRealWidth(162),
+        };
+        public Button btnClick = new Button
+        {
+            Height = Application.GetRealHeight(80),
+            Width = Application.GetRealWidth(343),
+        };
+
+        /// <summary>
+        /// 杩斿洖鐖舵帶浠剁殑鏂规硶
+        /// </summary>
+        /// <returns></returns>
+        public FrameLayout FLayoutView()
+        {
+            frameLayout.AddChidren(btnAddIcon);
+            frameLayout.AddChidren(btnClick);
+            return frameLayout;
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicTypeTitleView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicTypeTitleView.cs
new file mode 100644
index 0000000..6870204
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/LogicTypeTitleView.cs
@@ -0,0 +1,79 @@
+锘縰sing System;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class LogicTypeTitleView
+    {
+        /// <summary>
+        /// 涓绘帶浠禫iew
+        /// </summary>
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Height = Application.GetRealHeight(44),
+            Width = Application.GetRealWidth(343),
+            BackgroundColor= CSS.CSS_Color.view,
+            X=Application.GetRealWidth(LogicView.TextSize.left16),
+           // Radius=(uint)Application.GetRealHeight(12),
+        };
+        /// <summary>
+        /// 鏂囨湰鎻忚堪
+        /// </summary>
+        public Button btnText = new Button
+        {
+            TextSize = LogicView.TextSize.text14,
+            Width = Application.GetRealWidth(250),
+            Height = Application.GetRealHeight(20),
+            TextColor = CSS.CSS_Color.textColor,
+            //TextAlignment = TextAlignment.CenterLeft,
+            //Y = Application.GetRealHeight(12),
+            X = Application.GetRealWidth(12),
+           Gravity=Gravity.CenterVertical,
+        };
+        /// <summary>
+        /// 鍥炬爣
+        /// </summary>
+        public Button btnNextIcon = new Button
+        {
+            Width = Application.GetMinRealAverage(16),
+            Height = Application.GetMinRealAverage(16),
+            UnSelectedImagePath = "LogicIcon/next.png",
+            //Y = Application.GetRealHeight(14),
+            X = Application.GetRealWidth(315),
+            //Gravity = Gravity.CenterVertical,
+
+        };
+
+        /// <summary>
+        /// 绾�
+        /// </summary>
+        public Button btnLine = new Button
+        {
+            Height = 1,
+            Width = Application.GetRealWidth(343 - 12 - 12),
+            X = Application.GetRealWidth(12),
+            BackgroundColor = CSS.CSS_Color.viewLine,
+
+        };
+
+        public Button btnClick = new Button
+        {
+            Height = Application.GetRealHeight(44),
+            Width = Application.GetRealWidth(343),
+        };
+        /// <summary>
+        /// View鐨勬柟娉�
+        /// </summary>
+        /// <returns></returns>
+        public FrameLayout FLayoutView()
+        {
+            btnText.TextAlignment = TextAlignment.BottomLeft;
+            btnNextIcon.Gravity = Gravity.CenterVertical;
+            frameLayout.AddChidren(btnText);
+            frameLayout.AddChidren(btnNextIcon);
+            btnLine.Y = frameLayout.Height - 1;
+            frameLayout.AddChidren(btnLine);
+            frameLayout.AddChidren(btnClick);
+            return frameLayout;
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/MonView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/MonView.cs
new file mode 100644
index 0000000..f73e4d8
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/MonView.cs
@@ -0,0 +1,71 @@
+锘縰sing System;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class MonView
+    {
+        /// <summary>
+        /// 涓绘帶浠�
+        /// </summary>
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Y = Application.GetRealHeight(379),
+            Height = Application.GetRealHeight(268),
+            Width = Application.GetRealWidth(343),
+            X = Application.GetRealWidth(16),
+            BackgroundColor = CSS.CSS_Color.view,
+            Radius = (uint)Application.GetRealHeight(12),
+        };
+        /// <summary>
+        /// 鏍囬Btn
+        /// </summary>
+        public Button btnTitle = new Button
+        {
+            TextID = StringId.timeHorizon,
+            TextSize = TextSize.text16,
+            TextColor = CSS.CSS_Color.textColor,
+            IsBold = true,
+            Width = Application.GetRealWidth(343 - (52 + 4 + 10) * 2),
+            Height = Application.GetRealHeight(22),
+            Y = Application.GetRealHeight(17),
+            X = Application.GetRealWidth(52 + 4 + 10)
+        };
+        /// <summary>
+        /// 鍙栨秷Btn
+        /// </summary>
+        public Button btnCancel = new Button
+        {
+            TextID = StringId.cancelSelected,
+            TextSize = TextSize.text14,
+            TextColor = CSS.CSS_Color.textCancelColor,
+            Width = Application.GetRealWidth(52),
+            Height = Application.GetRealHeight(32),
+            Y = Application.GetRealHeight(10),
+            X = Application.GetRealWidth(4)
+        };
+        /// <summary>
+        /// 纭畾Btn
+        /// </summary>
+        public Button btnConfirm = new Button
+        {
+            TextID = StringId.confirmSelected,
+            TextSize = TextSize.text14,
+            TextColor = CSS.CSS_Color.textConfirmColor,
+            Width = Application.GetRealWidth(52),
+            Height = Application.GetRealHeight(32),
+            X = Application.GetRealWidth(343 - 4 - 52),
+            Y = Application.GetRealHeight(10),
+        };
+        /// <summary>
+        /// View鐨勬柟娉�
+        /// </summary>
+        /// <param name="fLayout"></param>
+        public void FLayoutView(FrameLayout fLayout)
+        {
+            frameLayout.AddChidren(btnTitle);
+            frameLayout.AddChidren(btnCancel);
+            frameLayout.AddChidren(btnConfirm);
+            fLayout.AddChidren(frameLayout);
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SaveView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SaveView.cs
new file mode 100644
index 0000000..6094c45
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SaveView.cs
@@ -0,0 +1,51 @@
+锘縰sing System;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class SaveView
+    {
+        /// <summary>
+        /// 涓绘帶浠禫iew
+        /// </summary>
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Y = Application.GetRealHeight(TextSize.view667 - 76),
+            Height = Application.GetRealHeight(76),
+            Width = Application.GetRealWidth(TextSize.view375),
+            Gravity=Gravity.BottomCenter,//缃簳鐨勫睘鎬�
+           BackgroundColor = CSS.CSS_Color.view,
+
+        };
+        /// <summary>
+        /// 锛堟潯浠舵垨鑰呯洰鏍囷級鏂囨湰鎻忚堪
+        /// </summary>
+        public Button btnSave= new Button
+        {
+            Width = Application.GetRealWidth(220),
+            Height = Application.GetRealHeight(44),
+            Y = Application.GetRealHeight(12),
+            X = Application.GetRealWidth(78),
+            TextID = StringId.save,
+            TextSize = TextSize.text16,
+            TextColor = CSS.CSS_Color.textWhiteColor,
+            TextAlignment = TextAlignment.Center,
+            BackgroundColor= CSS.CSS_Color.btnSaveBackgroundColor,
+            Radius = (uint)Application.GetRealHeight(44),
+
+        };
+        public Button btnClick = new Button
+        {
+            Height = Application.GetRealHeight(76),
+        };
+        /// <summary>
+        /// 淇濆瓨
+        /// </summary>
+        /// <returns></returns>
+        public FrameLayout FLayoutView()
+        {
+            frameLayout.AddChidren(btnSave);
+            frameLayout.AddChidren(btnClick);
+            return frameLayout;
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SelectTypeView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SelectTypeView.cs
new file mode 100644
index 0000000..dc9ea5c
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SelectTypeView.cs
@@ -0,0 +1,135 @@
+锘縰sing System;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class SelectTypeView
+    {
+        /// <summary>
+        /// 涓绘帶浠禫iew
+        /// </summary>
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Height = Application.GetRealHeight(50),
+            BackgroundColor = CSS.CSS_Color.view,
+        };
+        /// <summary>
+        /// 鍥炬爣
+        /// </summary>
+        public Button btnIcon = new Button
+        {
+            Width = Application.GetMinRealAverage(28),
+            Height = Application.GetMinRealAverage(28),
+            //Y = Application.GetRealHeight(8),
+            X = Application.GetRealWidth(TextSize.left12),
+
+        };
+        /// <summary>
+        /// 鏂囨湰鎻忚堪
+        /// </summary>
+        public Button btnText = new Button
+        {
+            TextSize = TextSize.text14,
+            Width = Application.GetRealWidth(250),
+            Height = Application.GetRealHeight(20),
+            TextColor = CSS.CSS_Color.textColor,
+            //Y=Application.GetRealHeight(12),
+            X = Application.GetRealWidth(52),
+        };
+
+
+        /// <summary>
+        /// 璁惧鍚嶇О
+        /// </summary>
+        public Button btnDeviceName = new Button
+        {
+            Width = Application.GetRealWidth(250),
+            Height = Application.GetRealHeight(20),
+            TextSize = TextSize.text14,
+            TextColor = CSS.CSS_Color.textColor,
+            Y =Application.GetRealHeight(6),
+            X = Application.GetRealWidth(52),
+            TextAlignment = TextAlignment.CenterLeft,
+            Visible =false,
+
+        };
+        /// <summary>
+        /// 鎴块棿鍚�(鍗虫槸=鍖哄煙鍚嶇О)
+        /// </summary>
+        public Button btnRoomName= new Button
+        {
+            Width = Application.GetRealWidth(250),
+            Height = Application.GetRealHeight(14),
+            TextSize = TextSize.text10,
+            TextColor = CSS.CSS_Color.textCancelColor,
+            Y=Application.GetRealHeight(30),
+            X = Application.GetRealWidth(52),
+            TextAlignment = TextAlignment.CenterLeft,
+            Visible = false,
+        };
+
+        /// <summary>
+        /// 锛堟潯浠舵垨鑰呯洰鏍囷級璁惧鐘舵�佹枃鏈弿杩�
+        /// </summary>
+        public Button btnState = new Button
+        {
+            TextSize = TextSize.text12,
+            Width = Application.GetRealWidth(130),
+            Height = Application.GetRealHeight(17),
+            TextColor = CSS.CSS_Color.textCancelColor,
+            Y = Application.GetRealHeight(17),
+            X = Application.GetRealWidth(375-48-130),
+            TextAlignment = TextAlignment.CenterRight,
+            Visible=false,
+
+        };
+        /// <summary>
+        /// 鍥炬爣
+        /// </summary>
+        public Button btnNextIcon = new Button
+        {
+            Width = Application.GetMinRealAverage(16),
+            Height = Application.GetMinRealAverage(16),
+            UnSelectedImagePath = "LogicIcon/next.png",
+            X = Application.GetRealWidth(339),
+
+        };
+
+        /// <summary>
+        /// 绾�
+        /// </summary>
+        public Button btnLine = new Button
+        {
+            Width = Application.GetRealWidth(307),
+            X = Application.GetRealWidth(52),
+            Height = 1,
+            BackgroundColor = CSS.CSS_Color.viewLine,
+
+        };
+
+        public Button btnClick = new Button
+        {
+            Height = Application.GetRealHeight(50),
+        };
+        /// <summary>
+        /// View鐨勬柟娉�
+        /// </summary>
+        /// <returns></returns>
+        public FrameLayout FLayoutView()
+        {
+            btnIcon.Gravity = Gravity.CenterVertical;
+            btnText.Gravity = Gravity.CenterVertical;
+            btnText.TextAlignment = TextAlignment.CenterLeft;
+            btnNextIcon.Gravity = Gravity.CenterVertical;
+            frameLayout.AddChidren(btnIcon);
+            frameLayout.AddChidren(btnText);
+            frameLayout.AddChidren(btnDeviceName);
+            frameLayout.AddChidren(btnRoomName);
+            frameLayout.AddChidren(btnState);
+            frameLayout.AddChidren(btnNextIcon);
+            btnLine.Y = frameLayout.Height - 1;
+            frameLayout.AddChidren(btnLine);
+            frameLayout.AddChidren(btnClick);
+            return frameLayout;
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SingleLogicView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SingleLogicView.cs
new file mode 100644
index 0000000..32f8898
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SingleLogicView.cs
@@ -0,0 +1,107 @@
+锘縰sing System;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class SingleLogicView
+    {
+        /// <summary>
+        /// 涓绘帶浠禫iew
+        /// </summary>
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            X = Application.GetRealWidth(16),
+            Y = Application.GetRealHeight(12),
+            Width = Application.GetRealWidth(343),
+            Height = Application.GetRealHeight(102),
+            BackgroundColor = CSS.CSS_Color.view,
+            Radius = (uint)Application.GetRealHeight(12),
+        };
+        /// <summary>
+        /// 閫昏緫鍚嶇О
+        /// </summary>
+        public Button btnLogicName = new Button
+        {
+            Width = Application.GetRealWidth(250),
+            Height = Application.GetRealHeight(20),
+            TextSize = TextSize.text14,
+            TextColor = CSS.CSS_Color.textColor,
+            Y = Application.GetRealHeight(12),
+            X = Application.GetRealWidth(TextSize.left12),
+            TextAlignment = TextAlignment.CenterLeft,
+
+        };
+        /// <summary>
+        /// 鍛ㄦ湡閲嶅鏂囨湰
+        /// </summary>
+        public Button btnWeekText = new Button
+        {
+            Width = Application.GetRealWidth(250),
+            Height = Application.GetRealHeight(14),
+            TextSize = TextSize.text12,
+            TextColor = CSS.CSS_Color.textCancelColor,
+            Y = Application.GetRealHeight(36),
+            X = Application.GetRealWidth(TextSize.left12),
+            TextAlignment = TextAlignment.CenterLeft,
+        };
+        /// <summary>
+        /// 鍔熻兘鍥炬爣
+        /// </summary>
+        public Button btnStateIcon = new Button
+        {
+            Width = Application.GetMinRealAverage(28),
+            Height = Application.GetMinRealAverage(28),
+            Y = Application.GetRealHeight(8),
+            X = Application.GetRealWidth(TextSize.left12),
+
+        };
+        /// <summary>
+        /// 杩炵嚎鍥炬爣
+        /// </summary>
+        public Button btnLienIcon = new Button
+        {
+
+            Width = Application.GetMinRealAverage(20),
+            Height = Application.GetMinRealAverage(20),
+            Y = Application.GetRealHeight(66),
+            X = Application.GetRealWidth(48),
+
+
+        };
+        /// <summary>
+        /// 鍥炬爣寮�鍏�
+        /// </summary>
+        public Button btnSwitchIcon = new Button
+        {
+            Width = Application.GetMinRealAverage(36),
+            Height = Application.GetMinRealAverage(36),
+            Y = Application.GetRealHeight(58),
+            X = Application.GetRealWidth(295),
+            UnSelectedImagePath = "LogicIcon/off.png",
+            SelectedImagePath = "LogicIcon/on.png",
+
+        };
+        /// <summary>
+        /// 鍥炬爣寮�鍏�
+        /// </summary>
+        public Button btnclick= new Button
+        {
+            Width = Application.GetRealWidth(343),
+            Height = Application.GetRealHeight(102),
+        };
+
+        /// <summary>
+        /// View鐨勬柟娉�
+        /// </summary>
+        /// <returns></returns>
+        public FrameLayout FLayoutView()
+        {
+            frameLayout.AddChidren(btnLogicName);
+            frameLayout.AddChidren(btnWeekText);
+            frameLayout.AddChidren(btnStateIcon);
+            frameLayout.AddChidren(btnLienIcon);
+            frameLayout.AddChidren(btnclick);
+            frameLayout.AddChidren(btnSwitchIcon);
+            return frameLayout;
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs
new file mode 100644
index 0000000..881aa54
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs
@@ -0,0 +1,55 @@
+锘縰sing System;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class SwitchView
+    {
+
+        /// <summary>
+        /// 涓绘帶浠�
+        /// </summary>
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            BackgroundColor = CSS.CSS_Color.view,
+            Y = Application.GetRealHeight(515),
+            X = Application.GetRealWidth(16),
+            Height = Application.GetRealHeight(44*44),
+            Width = Application.GetRealWidth(343),
+            Radius=(uint)Application.GetRealHeight(12)
+        };
+        /// <summary>
+        /// 鍙栨秷
+        /// </summary>
+        public Button btnCancel = new Button
+        {
+            TextAlignment = TextAlignment.Center,
+            TextSize = TextSize.text16,
+            TextColor = CSS.CSS_Color.textRedColor,
+            TextID=StringId.cancelSelected,
+            Y = Application.GetRealHeight(611),
+            X = Application.GetRealWidth(16),
+            Height = Application.GetRealHeight(44),
+            Width = Application.GetRealWidth(343),
+            BackgroundColor = CSS.CSS_Color.view,
+            Radius = (uint)Application.GetRealHeight(12)
+        };
+        /// <summary>
+        /// View鐨勬柟娉�
+        /// </summary>
+        ///  <param name="frame">鐖舵帶浠�</param>
+        /// <param name="i">鏄剧ずView鏁伴噺</param>
+        /// <returns></returns>
+        public void FLayoutView(FrameLayout frame,int i)
+        {
+            frameLayout.Y = Application.GetRealHeight(603 - (44 * i));
+            frameLayout.Height = Application.GetRealHeight(44 * i);
+            frame.AddChidren(frameLayout);
+            frame.AddChidren(btnCancel);
+            btnCancel.MouseUpEventHandler += (sender1, e1) =>
+            {
+                frame.RemoveFromParent();
+            };
+
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TextSize.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TextSize.cs
new file mode 100644
index 0000000..1196b10
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TextSize.cs
@@ -0,0 +1,21 @@
+锘縰sing System;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public static class TextSize
+    {
+        public const int text10 = 10;
+        public const int text12 = 12;
+        public const int text14 = 14;
+        public const int text16 = 16;
+        public const int text18 = 18;
+
+        public const int view375 = 375;
+        public const int view667 = 667;
+
+        public const int left16 = 16;
+        public const int left12 = 12;
+
+        public const int layout_Right16 = 16;
+
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeHorizonView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeHorizonView.cs
new file mode 100644
index 0000000..2d1aa45
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeHorizonView.cs
@@ -0,0 +1,98 @@
+锘縰sing System;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class TimeHorizonView : FrameLayout
+    {
+        /// <summary>
+        /// 涓绘帶浠�
+        /// </summary>
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Y = Application.GetRealHeight(460),
+            Height = Application.GetRealHeight(187),
+            Width = Application.GetRealWidth(343),
+            X = Application.GetRealWidth(16),
+            BackgroundColor = CSS.CSS_Color.view,
+            Radius=(uint)Application.GetRealHeight(12),
+        };
+        /// <summary>
+        /// 鏍囬Btn
+        /// </summary>
+        public Button btnTitle = new Button
+        {
+            TextID = StringId.timeHorizon,
+            TextSize = TextSize.text16,
+            TextColor = CSS.CSS_Color.textColor,
+            IsBold = true,
+            Width = Application.GetRealWidth(343-(52 + 4 + 10)*2),
+            Height = Application.GetRealHeight(22),
+            Y = Application.GetRealHeight(15),
+            X = Application.GetRealWidth(52 + 4 + 10)
+        };
+        /// <summary>
+        /// 鍙栨秷Btn
+        /// </summary>
+        public Button btnCancel = new Button
+        {
+            TextID = StringId.cancelSelected,
+            TextSize = TextSize.text14,
+            TextColor = CSS.CSS_Color.textCancelColor,
+            Width = Application.GetRealWidth(52),
+            Height = Application.GetRealHeight(32),
+            Y = Application.GetRealHeight(10),
+            X = Application.GetRealWidth(4)
+        };
+        /// <summary>
+        /// 纭畾Btn
+        /// </summary>
+        public Button btnConfirm = new Button
+        {
+            TextID = StringId.confirmSelected,
+            TextSize = TextSize.text14,
+            TextColor = CSS.CSS_Color.textConfirmColor,
+            Width = Application.GetRealWidth(52),
+            Height = Application.GetRealHeight(32),
+            X = Application.GetRealWidth(343 - 4 - 52),
+            Y = Application.GetRealHeight(10),
+        };
+        /// <summary>
+        ///  绾㈣壊鎻愮ず鏂囨湰
+        /// </summary>
+        public Button btnTip = new Button
+        {
+            TextID = StringId.timeTipText,
+            TextSize = TextSize.text12,
+            TextColor = CSS.CSS_Color.textRedColor,
+            Width = Application.GetRealWidth(306),
+            Height = Application.GetRealHeight(17),
+            X = Application.GetRealWidth(20),
+            Y = Application.GetRealHeight(58),
+        };
+
+        /// <summary>
+        /// View鐨勬柟娉�
+        /// </summary>
+        /// <returns></returns>
+        public void FLayoutView(FrameLayout fLayout)
+        {
+            frameLayout.AddChidren(btnTitle);
+            frameLayout.AddChidren(btnTip);
+            frameLayout.AddChidren(btnCancel);
+            frameLayout.AddChidren(btnConfirm);
+            fLayout.AddChidren(frameLayout);
+            ////鐣岄潰鐐瑰嚮浜嬩欢
+            //fLayout.MouseUpEventHandler += (sender, e1) =>
+            //{
+            //    //绉婚櫎fLayout鐣岄潰
+            //    fLayout.RemoveFromParent();
+            //};
+            //鍙栨秷鐐瑰嚮浜嬩欢
+            btnCancel.MouseUpEventHandler += (sender, e2) =>
+            {
+                //绉婚櫎fLayout鐣岄潰
+                fLayout.RemoveFromParent();
+            };
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs
new file mode 100644
index 0000000..0fd5f05
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs
@@ -0,0 +1,269 @@
+锘縰sing System;
+using Shared;
+using System.Collections.Generic;
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class TimeView
+    {
+        /// <summary>
+        /// 涓绘帶浠�
+        /// </summary>
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Y = Application.GetRealHeight(350),
+            Height = Application.GetRealHeight(297),
+            Width = Application.GetRealWidth(343),
+            X = Application.GetRealWidth(16),
+            BackgroundColor = CSS.CSS_Color.view,
+            Radius=(uint)Application.GetRealHeight(12),
+        };
+        /// <summary>
+        /// 鏃堕棿鎺т欢UIPickerView 
+        /// </summary>
+        public UIPickerView mUIPickerView = new UIPickerView
+        {
+            //Y = Application.GetRealHeight(44),
+            Height = Application.GetRealHeight(297),
+            Width = Application.GetRealWidth(343),
+            BackgroundColor = CSS.CSS_Color.viewTranslucence,
+
+        };
+        /// <summary>
+        /// 鍙栨秷Btn
+        /// </summary>
+        public Button btnCancel = new Button
+        {
+            TextID = StringId.cancelSelected,
+            TextSize = TextSize.text14,
+            TextColor = CSS.CSS_Color.textCancelColor,
+            Width = Application.GetRealWidth(52),
+            Height = Application.GetRealHeight(32),
+            Y = Application.GetRealHeight(6),
+            X = Application.GetRealWidth(8)
+        };
+        /// <summary>
+        /// 纭畾Btn
+        /// </summary>
+        public Button btnConfirm = new Button
+        {
+            TextID = StringId.confirmSelected,
+            TextSize = TextSize.text14,
+            TextColor = CSS.CSS_Color.textConfirmColor,
+            Width = Application.GetRealWidth(52),
+            Height = Application.GetRealHeight(32),
+            X = Application.GetRealWidth(283),
+            Y = Application.GetRealHeight(6),
+        };
+        /// <summary>
+        ///  绾�
+        /// </summary>
+        public Button btnLine = new Button
+        {
+            BackgroundColor = CSS.CSS_Color.viewLine,
+            Width = Application.GetRealWidth(343),
+            Height = 1,
+            Y = Application.GetRealWidth(44)
+        };
+        /// <summary>
+        /// 鏃堕棿View鐨勬柟娉�
+        /// </summary>
+        /// <returns></returns>
+        public void FLayoutView(FrameLayout fLayout)
+        {
+            frameLayout.AddChidren(mUIPickerView);
+            frameLayout.AddChidren(btnCancel);
+            frameLayout.AddChidren(btnConfirm);
+            frameLayout.AddChidren(btnLine);
+            fLayout.AddChidren(frameLayout);
+        }
+        /// <summary>
+        /// 鑾峰彇1-24灏忔椂鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public List<string> GethStringList()
+        {
+            //鍒濆鍖栧垪琛�
+            var hList = new List<string>();
+            for (int i = 1; i < 24; i++)
+            {
+                if (i < 10)
+                {
+                    var a = "0" + i.ToString();
+                    //娣诲姞鏁版嵁
+                    hList.Add(a + " " + Language.StringByID(StringId.h));
+                }
+                else
+                {
+                    //娣诲姞鏁版嵁
+                    hList.Add(i.ToString() + " " + Language.StringByID(StringId.h));
+                }
+
+            }
+            return hList;
+
+
+        }
+        /// <summary>
+        /// 鑾峰彇0-23灏忔椂鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public List<string> GethStringList0()
+        {
+            //鍒濆鍖栧垪琛�
+            var hList = new List<string>();
+            for (int i = 0; i < 23; i++)
+            {
+                if (i < 10)
+                {
+                    var a = "0" + i.ToString();
+                    //娣诲姞鏁版嵁
+                    hList.Add(a + " " + Language.StringByID(StringId.h));
+                }
+                else
+                {
+                    //娣诲姞鏁版嵁
+                    hList.Add(i.ToString() + " " + Language.StringByID(StringId.h));
+                }
+
+            }
+            return hList;
+
+
+        }
+        /// <summary> 
+        /// 鑾峰彇60鍒嗛挓鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public List<string> GetmStringList()
+        {
+            //鍒濆鍖栧垪琛�
+            var mList = new List<string>();
+            for (int i = 0; i < 60; i++)
+            {
+                if (i < 10)
+                {
+                    var a = "0" + i.ToString();
+                    //娣诲姞鏁版嵁
+                    mList.Add(a + " " + Language.StringByID(StringId.m));
+                }
+                else
+                {
+                    //娣诲姞鏁版嵁
+                    mList.Add(i.ToString() + " " + Language.StringByID(StringId.m));
+                }
+
+            }
+
+            return mList;
+        }
+
+        /// <summary>
+        /// 鑾峰彇023灏忔椂鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public List<int> GethIntList0()
+        {
+            //鍒濆鍖栧垪琛�
+            var hList = new List<int>();
+            for (int i = 1; i < 24; i++)
+            {
+                //娣诲姞鏁版嵁
+                hList.Add(i);
+            }
+            return hList;
+
+
+        }
+        /// <summary>
+        /// 鑾峰彇24灏忔椂鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public List<int> GethIntList()
+        {
+            //鍒濆鍖栧垪琛�
+            var hList = new List<int>();
+            for (int i = 1; i < 24; i++)
+            {
+                //娣诲姞鏁版嵁
+                hList.Add(i);
+            }
+            return hList;
+
+
+        }
+        /// <summary>
+        /// 鑾峰彇60鍒嗛挓鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public List<int> GetmIntList()
+        {
+            //鍒濆鍖栧垪琛�
+            var mList = new List<int>();
+            for (int i = 0; i < 60; i++)
+            {
+                //娣诲姞鏁版嵁
+                mList.Add(i);
+            }
+            return mList;
+        }
+       
+        /// <summary>
+        /// 杩斿洖鎸囧畾鍗曚綅鍒楄〃
+        /// </summary>
+        /// <param name="min">鏈�灏忓��</param>
+        /// <param name="max">鏈�澶у��</param>
+        /// <param name="name">鍗曚綅(鏃讹紝鍒嗭紝绉�)</param>
+        /// <param name="digit">浣嶆暟(10浠ヤ笅鐢�(1浣嶈繕鏄�2浣�)鏄剧ず)</param>
+        /// <returns></returns>
+        public List<string> GetStringList(int min, int max, string name, int digit)
+        {
+            //鍒濆鍖栧垪琛�
+            var list = new List<string>();
+
+            for (int i = min; i < max; i++)
+            {
+                if (i < 10 && digit == 2)
+                {
+                    var a = "0" + i.ToString();
+                    //娣诲姞鏁版嵁
+                    list.Add(a + " " + name);
+                }
+                else
+                {
+                    //娣诲姞鏁版嵁
+                    list.Add(i.ToString() + " " + name);
+                }
+
+            }
+            return list;
+        }
+
+        /// <summary>
+        /// 鑾峰彇鏃堕棿鍊�
+        /// </summary>
+        /// <param name="str">婧愭暟鎹�</param>
+        /// <param name="digit">杩斿洖婧愭暟鎹暟缁勯噷闈㈡煇涓�肩储寮�</param>
+        /// <param name="startIndex"></param>
+        /// <param name="list"></param>
+        /// <returns></returns>
+        public int GetValueIndex(string str, int digit, int startIndex, List<int> list)
+        {
+            int index = 0;
+            int value = 0;
+            if (str.Contains(":"))
+            {
+                value = int.Parse(str.Split(':')[digit]);
+            }
+            for (int i = startIndex; i < list.Count; i++)
+            {
+                if (value == i)
+                {
+                    index = i;
+                    break;
+                }
+            }
+            return index;
+        }
+
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs
new file mode 100644
index 0000000..9603b0c
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs
@@ -0,0 +1,569 @@
+锘縰sing System;
+using System.Collections.Generic;
+using HDL_ON.UI.CSS;
+using Shared;
+
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class TipPopView
+    {
+        /// <summary>
+        /// 澶ф鍦嗚鍊�
+        /// </summary>
+        public int RradiusFrameLayout = 15;
+        /// <summary>
+        /// 灏忔鍦嗚鍊�
+        /// </summary>
+        public int radiusEditFrameLayout = 4;
+        /// <summary>
+        /// 杈撳叆妗�
+        /// </summary>
+        /// <param name="titleId">鏍囬鏂囨湰</param>
+        /// <param name="tnputEditTxet">鏄剧ず鏂囨湰</param>
+        /// <param name="errorId_IsNullOrEmpty">杈撳叆妗嗘枃鏈负绌鸿嚜瀹氫箟鎻愮ず閿欒鏂囨湰</param>
+        /// <param name="errorId_PresenceP">妫�绱㈠凡瀛樺湪鍚嶇О鑷畾涔夋彁绀洪敊璇枃鏈�</param>
+        /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
+        /// <param name="List">琚绱㈠垪琛�</param>
+        /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
+        public void InputBox(int titleId, string tnputEditTxet, int errorId_IsNullOrEmpty, int errorId_PresenceP, List<string> List, Action<string> confirmAction)
+        {
+            Dialog dialog = new Dialog()
+            {
+                BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+            };
+
+            FrameLayout whiteView = new FrameLayout()
+            {
+                //Gravity = Gravity.Center,
+                X = Application.GetRealWidth(53),
+                Y = Application.GetRealHeight(264),
+                Width = Application.GetRealWidth(270),
+                Height = Application.GetRealHeight(172),
+                BackgroundColor = CSS_Color.view,
+                BorderColor = CSS_Color.viewTranslucence,
+                BorderWidth = 0,
+                Radius = (uint)Application.GetRealHeight(RradiusFrameLayout),
+            };
+            dialog.AddChidren(whiteView);
+
+            Button btnTitle = new Button()
+            {
+                Y = Application.GetRealHeight(20),
+                X = Application.GetRealWidth(35),
+                Height = Application.GetRealHeight(22),
+                Width = Application.GetRealWidth(200),
+                TextColor =CSS_Color.textConfirmColor,
+                TextSize = TextSize.text16,
+                TextAlignment = TextAlignment.Center,
+                TextID = titleId,
+
+            };
+            whiteView.AddChidren(btnTitle);
+
+            FrameLayout editBjView = new FrameLayout()
+            {
+                // Gravity = Gravity.CenterHorizontal,
+                Y = btnTitle.Bottom + Application.GetRealHeight(16),
+                X = Application.GetRealWidth(24),
+                Width = Application.GetRealWidth(222),
+                Height = Application.GetRealHeight(40),
+                BackgroundColor = CSS_Color.viewMiddle,
+                BorderColor = CSS_Color.viewTranslucence,
+                BorderWidth = 0,
+                Radius = (uint)Application.GetMinRealAverage(radiusEditFrameLayout),
+            };
+            whiteView.AddChidren(editBjView);
+
+            EditText editText = new EditText()
+            {
+                X = Application.GetRealWidth(12),
+                Y = Application.GetRealHeight(10),
+                Width = Application.GetRealWidth(160),
+                Height = Application.GetRealHeight(20),
+                Text = tnputEditTxet,
+                TextColor = CSS_Color.textColor,
+                TextSize = TextSize.text14,
+                TextAlignment = TextAlignment.CenterLeft,
+
+            };
+            editBjView.AddChidren(editText);
+
+            Button clearIconBtn = new Button
+            {
+                X = Application.GetRealWidth(194),
+                Y = Application.GetRealHeight(8),
+                Width = Application.GetMinRealAverage(24),
+                Height = Application.GetMinRealAverage(24),
+                UnSelectedImagePath = "MusicIcon/clear.png",
+            };
+            editBjView.AddChidren(clearIconBtn);
+            clearIconBtn.MouseUpEventHandler += (sender, e) =>
+            {
+                editText.Text = "";
+            };
+
+            Button btnLine = new Button()
+            {
+                Y = whiteView.Height - Application.GetRealHeight(44 + 1),
+                Height = Application.GetRealHeight(1),
+                BackgroundColor = CSS_Color.viewLine,
+            };
+            whiteView.AddChidren(btnLine);
+
+            Button btnCancel = new Button()
+            {
+                Y = btnLine.Bottom,
+                Width = Application.GetRealWidth(135),
+                Height = Application.GetRealHeight(44),
+                TextAlignment = TextAlignment.Center,
+                TextColor =CSS_Color.textTipColor,
+                TextSize = TextSize.text16,
+                TextID = StringId.cancelMusic,
+                Gravity = Gravity.BottomLeft,
+            };
+            whiteView.AddChidren(btnCancel);
+            btnCancel.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomLeft);
+            Button btnConfirm = new Button()
+            {
+                X = btnCancel.Right,
+                Y = btnLine.Bottom,
+                Width = Application.GetRealWidth(135),
+                Height = Application.GetRealHeight(44),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.view,
+                IsBold = true,
+                TextSize = TextSize.text16,
+                TextID = StringId.confirmMusic,
+                BackgroundColor = CSS_Color.textConfirmColor,
+                Gravity = Gravity.BottomRight,
+            };
+            whiteView.AddChidren(btnConfirm);
+            btnConfirm.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomRight);
+
+            dialog.Show();
+            btnCancel.MouseUpEventHandler += (sender, e) =>
+            {
+                dialog.Close();
+            };
+            Button btnTip = new Button
+            {
+                Width = Application.GetRealWidth(0),
+            };
+            whiteView.AddChidren(btnTip);//涓�鐩撮敊璇紝涓�鐩寸寷鐐癸紝涓�鐩村姞鎺т欢
+            btnConfirm.MouseUpEventHandler += (sender, e) =>
+            {
+                string listNameText = editText.Text.Trim();
+                if (string.IsNullOrEmpty(listNameText) || List.Contains(listNameText))
+                {
+                    string tipMsgString = "";
+                    if (string.IsNullOrEmpty(editText.Text.Trim()))
+                    {
+                        tipMsgString = Language.StringByID(errorId_IsNullOrEmpty);
+                    }
+                    else
+                    {
+                        tipMsgString = Language.StringByID(errorId_PresenceP);
+                    }
+
+                    whiteView.Height = Application.GetRealHeight(183);
+                    btnLine.Y = whiteView.Height - Application.GetRealHeight(44 + 1);
+                    btnCancel.Y = btnLine.Bottom;
+                    btnCancel.Gravity = Gravity.BottomLeft;
+                    btnConfirm.Y = btnLine.Bottom;
+                    btnConfirm.Gravity = Gravity.BottomRight;
+
+                    btnTip.X = Application.GetRealWidth(24);
+                    btnTip.Y = editBjView.Bottom + Application.GetRealHeight(12);
+                    btnTip.Width = Application.GetRealWidth(222);
+                    btnTip.Height = Application.GetRealHeight(17);
+                    btnTip.Text = tipMsgString;
+                    btnTip.TextColor = CSS_Color.textRedColor;
+                    btnTip.TextSize = TextSize.text12;
+                    btnTip.TextAlignment = TextAlignment.CenterLeft;
+
+                    return;
+                }
+
+
+                confirmAction(editText.Text.Trim());
+                dialog.Close();
+            };
+
+        }
+
+        /// <summary>
+        /// 杈撳叆妗�
+        /// </summary>
+        /// <param name="titleId">鏍囬鏂囨湰</param>
+        /// <param name="tnputEditTxet">鏄剧ず鏂囨湰</param>
+        /// <param name="errorId_IsNullOrEmpty">杈撳叆妗嗘湰鏂囦负绌鸿嚜瀹氫箟鎻愮ず閿欒鏂囨湰</param>
+        /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
+        public void InputBox(int titleId, string tnputEditTxet, int errorId_IsNullOrEmpty, Action<string> confirmAction)
+        {
+            Dialog dialog = new Dialog()
+            {
+                BackgroundColor = CSS_Color.viewTrans60lucence,
+            };
+
+            FrameLayout whiteView = new FrameLayout()
+            {
+                //Gravity = Gravity.Center,
+                X = Application.GetRealWidth(53),
+                Y = Application.GetRealHeight(264),
+                Width = Application.GetRealWidth(270),
+                Height = Application.GetRealHeight(172),
+                BackgroundColor = CSS_Color.view,
+                BorderColor = CSS_Color.viewTranslucence,
+                BorderWidth = 0,
+                Radius = (uint)Application.GetRealHeight(RradiusFrameLayout),
+            };
+            dialog.AddChidren(whiteView);
+
+            Button btnTitle = new Button()
+            {
+                Y = Application.GetRealHeight(20),
+                X = Application.GetRealWidth(35),
+                Height = Application.GetRealHeight(22),
+                Width = Application.GetRealWidth(200),
+                TextColor = CSS_Color.textConfirmColor,
+                TextSize = TextSize.text16,
+                TextAlignment = TextAlignment.Center,
+                TextID = titleId,
+
+            };
+            whiteView.AddChidren(btnTitle);
+
+            FrameLayout editBjView = new FrameLayout()
+            {
+                // Gravity = Gravity.CenterHorizontal,
+                Y = btnTitle.Bottom + Application.GetRealHeight(16),
+                X = Application.GetRealWidth(24),
+                Width = Application.GetRealWidth(222),
+                Height = Application.GetRealHeight(40),
+                BackgroundColor = CSS_Color.viewMiddle,
+                BorderColor = CSS_Color.viewTranslucence,
+                BorderWidth = 0,
+                Radius = (uint)Application.GetMinRealAverage(radiusEditFrameLayout),
+            };
+            whiteView.AddChidren(editBjView);
+
+            EditText editText = new EditText()
+            {
+                X = Application.GetRealWidth(12),
+                Y = Application.GetRealHeight(10),
+                Width = Application.GetRealWidth(160),
+                Height = Application.GetRealHeight(20),
+                Text = tnputEditTxet,
+                TextColor = CSS_Color.textColor,
+                TextSize = TextSize.text14,
+                TextAlignment = TextAlignment.CenterLeft,
+            };
+            editBjView.AddChidren(editText);
+
+            Button clearIconBtn = new Button
+            {
+                X = Application.GetRealWidth(194),
+                Y = Application.GetRealHeight(8),
+                Width = Application.GetMinRealAverage(24),
+                Height = Application.GetMinRealAverage(24),
+                UnSelectedImagePath = "MusicIcon/clear.png",
+            };
+            editBjView.AddChidren(clearIconBtn);
+            clearIconBtn.MouseUpEventHandler += (sender, e) =>
+            {
+                editText.Text = "";
+            };
+
+            Button btnLine = new Button()
+            {
+                Y = whiteView.Height - Application.GetRealHeight(44 + 1),
+                Height = Application.GetRealHeight(1),
+                BackgroundColor = CSS_Color.viewLine,
+            };
+            whiteView.AddChidren(btnLine);
+
+            Button btnCancel = new Button()
+            {
+                Y = btnLine.Bottom,
+                Width = Application.GetRealWidth(135),
+                Height = Application.GetRealHeight(44),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.textTipColor,
+                TextSize = TextSize.text16,
+                TextID = StringId.cancelMusic,
+                Gravity = Gravity.BottomLeft,
+            };
+            whiteView.AddChidren(btnCancel);
+            btnCancel.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomLeft);
+
+            Button btnConfirm = new Button()
+            {
+                X = btnCancel.Right,
+                Y = btnLine.Bottom,
+                Width = Application.GetRealWidth(135),
+                Height = Application.GetRealHeight(44),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.view,
+                IsBold = true,
+                TextSize = TextSize.text16,
+                TextID = StringId.confirmMusic,
+                BackgroundColor = CSS_Color.textConfirmColor,
+                Gravity = Gravity.BottomRight,
+            };
+            whiteView.AddChidren(btnConfirm);
+            btnConfirm.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomRight);
+            dialog.Show();
+            btnCancel.MouseUpEventHandler += (sender, e) =>
+            {
+                dialog.Close();
+            };
+
+            Button btnTip = new Button
+            {
+                Width = Application.GetRealWidth(0),
+            };
+            whiteView.AddChidren(btnTip);//涓�鐩撮敊璇紝涓�鐩寸寷鐐癸紝涓�鐩村姞鎺т欢
+
+            btnConfirm.MouseUpEventHandler += (sender, e) =>
+            {
+                if (string.IsNullOrEmpty(editText.Text.Trim()))
+                {
+
+                    whiteView.Height = Application.GetRealHeight(183);
+                    btnLine.Y = whiteView.Height - Application.GetRealHeight(44 + 1);
+                    btnCancel.Y = btnLine.Bottom;
+                    btnCancel.Gravity = Gravity.BottomLeft;
+                    btnConfirm.Y = btnLine.Bottom;
+                    btnConfirm.Gravity = Gravity.BottomRight;
+
+                    btnTip.X = Application.GetRealWidth(24);
+                    btnTip.Y = editBjView.Bottom + Application.GetRealHeight(12);
+                    btnTip.Width = Application.GetRealWidth(222);
+                    btnTip.Height = Application.GetRealHeight(17);
+                    btnTip.Text = Language.StringByID(errorId_IsNullOrEmpty);
+                    btnTip.TextColor = CSS_Color.textRedColor;
+                    btnTip.TextSize = TextSize.text12;
+                    btnTip.TextAlignment = TextAlignment.CenterLeft;
+                    return;
+                }
+
+
+                confirmAction(editText.Text.Trim());
+                dialog.Close();
+            };
+
+        }
+
+
+        /// <summary>
+        /// 纭畾鎻愮ず妗�
+        /// </summary>
+        /// <param name="titleId">鏍囬鏂囨湰</param>
+        /// <param name="tipTxet">鑷畾涔夋彁绀烘枃鏈�</param>
+        /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
+        public void TipBox(int titleId, int tipTxet, Action confirmAction)
+        {
+            Dialog dialog = new Dialog()
+            {
+                BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+            };
+
+            FrameLayout whiteView = new FrameLayout()
+            {
+                //Gravity = Gravity.Center,
+                X = Application.GetRealWidth(53),
+                Y = Application.GetRealHeight(264),
+                Width = Application.GetRealWidth(270),
+                Height = Application.GetRealHeight(140),
+                BackgroundColor = CSS_Color.view,
+                BorderColor = CSS_Color.viewTranslucence,
+                BorderWidth = 0,
+                Radius = (uint)Application.GetRealHeight(RradiusFrameLayout),
+            };
+            dialog.AddChidren(whiteView);
+
+            Button titleBtn = new Button()
+            {
+                Y = Application.GetRealHeight(20),
+                X = Application.GetRealWidth(35),
+                Height = Application.GetRealHeight(22),
+                Width = Application.GetRealWidth(270 - 35 * 2),
+                TextColor = CSS_Color.textConfirmColor,
+                TextSize = TextSize.text16,
+                TextAlignment = TextAlignment.Center,
+                TextID = titleId,
+            };
+            whiteView.AddChidren(titleBtn);
+
+            Button tipBtn = new Button()
+            {
+                Y = titleBtn.Bottom + Application.GetRealHeight(8),
+                X = Application.GetRealWidth(20),
+                Height = Application.GetRealHeight(22),
+                Width = Application.GetRealWidth(270 - 20 * 2),
+                TextColor =CSS_Color.textTipColor,
+                TextSize = TextSize.text12,
+                TextAlignment = TextAlignment.Center,
+                TextID = tipTxet,
+            };
+            whiteView.AddChidren(tipBtn);
+
+
+            Button btnLine = new Button()
+            {
+                Y = whiteView.Height - Application.GetRealHeight(44 + 1),
+                Height = Application.GetRealHeight(1),
+                BackgroundColor = CSS_Color.viewLine,
+            };
+            whiteView.AddChidren(btnLine);
+
+            Button btnCancel = new Button()
+            {
+                Y = btnLine.Bottom,
+                Width = Application.GetRealWidth(135),
+                Height = Application.GetRealHeight(44),
+                TextAlignment = TextAlignment.Center,
+                TextColor =CSS_Color.textTipColor,
+                TextSize = TextSize.text16,
+                TextID = StringId.cancelMusic,
+                Gravity = Gravity.BottomLeft,
+            };
+            whiteView.AddChidren(btnCancel);
+            btnCancel.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomLeft);
+            Button btnConfirm = new Button()
+            {
+                X = btnCancel.Right,
+                Y = btnLine.Bottom,
+                Width = Application.GetRealWidth(135),
+                Height = Application.GetRealHeight(44),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.view,
+                IsBold = true,
+                TextSize = TextSize.text16,
+                TextID = StringId.confirmMusic,
+                BackgroundColor = CSS_Color.textConfirmColor,
+                Gravity = Gravity.BottomRight,
+            };
+            whiteView.AddChidren(btnConfirm);
+            btnConfirm.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomRight);
+            dialog.Show();
+            btnCancel.MouseUpEventHandler += (sender, e) =>
+            {
+                dialog.Close();
+            };
+
+            btnConfirm.MouseUpEventHandler += (sender, e) =>
+            {
+                confirmAction();
+                dialog.Close();
+            };
+
+        }
+
+        /// <summary>
+        /// 纭畾鎻愮ず妗�
+        /// </summary>
+        /// <param name="titleId">鏍囬鏂囨湰</param>
+        /// <param name="tipTxet">鑷畾涔夋彁绀烘枃鏈�(鎹㈣)</param>
+        /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
+        public void TipBox1(int titleId, int tipTxet, Action confirmAction)
+        {
+            Dialog dialog = new Dialog()
+            {
+                BackgroundColor = CSS_Color.viewTrans60lucence,
+            };
+
+            FrameLayout whiteView = new FrameLayout()
+            {
+                //Gravity = Gravity.Center,
+                X = Application.GetRealWidth(53),
+                Y = Application.GetRealHeight(264),
+                Width = Application.GetRealWidth(270),
+                Height = Application.GetRealHeight(155),
+                BackgroundColor = CSS_Color.view,
+                BorderColor = CSS_Color.viewTranslucence,
+                BorderWidth = 0,
+                Radius = (uint)Application.GetRealHeight(RradiusFrameLayout),
+            };
+            dialog.AddChidren(whiteView);
+
+            Button titleBtn = new Button()
+            {
+                Y = Application.GetRealHeight(20),
+                X = Application.GetRealWidth(35),
+                Height = Application.GetRealHeight(22),
+                Width = Application.GetRealWidth(270 - 35 * 2),
+                TextColor = CSS_Color.textConfirmColor,
+                TextSize = TextSize.text16,
+                TextAlignment = TextAlignment.Center,
+                TextID = titleId,
+            };
+            whiteView.AddChidren(titleBtn);
+
+            Button tipBtn = new Button()
+            {
+                Y = titleBtn.Bottom + Application.GetRealHeight(8),
+                X = Application.GetRealWidth(20),
+                Height = Application.GetRealHeight(22 + 15),
+                Width = Application.GetRealWidth(270 - 20 * 2),
+                TextColor = CSS_Color.textTipColor,
+                TextSize = TextSize.text12,
+                TextAlignment = TextAlignment.Center,
+                Text = Language.StringByID(tipTxet).Replace("{\\r\\n}", "\r\n"),
+                IsMoreLines = true,
+            };
+            whiteView.AddChidren(tipBtn);
+
+
+            Button btnLine = new Button()
+            {
+                Y = whiteView.Height - Application.GetRealHeight(44 + 1),
+                Height = Application.GetRealHeight(1),
+                BackgroundColor = CSS_Color.viewLine,
+            };
+            whiteView.AddChidren(btnLine);
+
+            Button btnCancel = new Button()
+            {
+                Y = btnLine.Bottom,
+                Width = Application.GetRealWidth(135),
+                Height = Application.GetRealHeight(44),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.viewLine,
+                TextSize = TextSize.text16,
+                TextID = StringId.cancelMusic,
+                Gravity = Gravity.BottomLeft,
+            };
+            whiteView.AddChidren(btnCancel);
+            btnCancel.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomLeft);
+            Button btnConfirm = new Button()
+            {
+                X = btnCancel.Right,
+                Y = btnLine.Bottom,
+                Width = Application.GetRealWidth(135),
+                Height = Application.GetRealHeight(44),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.view,
+                IsBold = true,
+                TextSize = TextSize.text16,
+                TextID = StringId.confirmMusic,
+                BackgroundColor = CSS_Color.textConfirmColor,
+                Gravity = Gravity.BottomRight,
+            };
+            whiteView.AddChidren(btnConfirm);
+            btnConfirm.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomRight);
+            dialog.Show();
+            btnCancel.MouseUpEventHandler += (sender, e) =>
+            {
+                dialog.Close();
+            };
+
+            btnConfirm.MouseUpEventHandler += (sender, e) =>
+            {
+                confirmAction();
+                dialog.Close();
+            };
+
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs
new file mode 100644
index 0000000..28aac76
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs
@@ -0,0 +1,87 @@
+锘縰sing System;
+using Shared;
+
+namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
+{
+    public class TopView
+    {
+        #region 鏈�涓婇潰閭e潡鎺т欢
+        /// <summary>
+        /// 鏈�涓婇潰鍧梀iew
+        /// </summary>
+        public FrameLayout frameLayout = new FrameLayout 
+        {
+            BackgroundColor = CSS.CSS_Color.viewTop,
+            Height = Application.GetRealHeight(64),
+            Width = Application.GetRealWidth(375),
+        };
+        /// <summary>
+        /// 鏍囬Btn
+        /// </summary>
+        public Button topNameBtn = new Button
+        {
+            TextSize = TextSize.text18,
+            TextColor = CSS.CSS_Color.textColor,
+            Width = Application.GetRealWidth(TextSize.view375-60-60),
+            Height = Application.GetRealHeight(25),
+            Y = Application.GetRealHeight(30),
+            X = Application.GetRealWidth(60)
+        };
+        /// <summary>
+        /// 鍚庨��Btn
+        /// </summary>
+        public Button backBtn = new Button
+        {
+            Width = Application.GetRealWidth(12),
+            Height = Application.GetRealHeight(20),
+            X = Application.GetRealWidth(TextSize.left16),
+            Y = Application.GetRealHeight(32),
+            UnSelectedImagePath = "LogicIcon/back.png",
+
+        };
+        /// <summary>
+        /// 璁剧疆鍥炬爣Btn
+        /// </summary>
+        public Button setBtn = new Button
+        {
+            Y = Application.GetRealHeight(28),
+            X = Application.GetRealWidth(337),
+            Width = Application.GetMinRealAverage(32),
+            Height = Application.GetMinRealAverage(32),
+            UnSelectedImagePath = "LogicIcon/set.png",
+            Visible = false,
+        };
+        /// <summary>
+        /// 澧炲姞鐑敭澶у皬Btn
+        /// </summary>
+        public Button clickBackBtn = new Button
+        {
+            Width = Application.GetRealWidth(16 + 12 + 16),
+            Height = Application.GetRealHeight(64),
+        };
+        /// <summary>
+        /// 璁剧疆鍥炬爣澧炲姞鐑敭澶у皬
+        /// </summary>
+        public Button clickSetBtn = new Button 
+        {
+            X = Application.GetRealWidth(337 - 37),
+            Width = Application.GetMinRealAverage(28 + 37),
+            Height = Application.GetMinRealAverage(28 + 7 + 29),
+        };
+        /// <summary>
+        /// 鏈�涓婇潰鐨勯偅鍧楁柟娉�
+        /// </summary>
+        /// <returns></returns>
+        public FrameLayout FLayoutView()
+        {
+            frameLayout.AddChidren(topNameBtn);
+            frameLayout.AddChidren(backBtn);
+            frameLayout.AddChidren(setBtn);
+            frameLayout.AddChidren(clickBackBtn);
+            frameLayout.AddChidren(clickSetBtn);
+            return frameLayout;
+        }
+        #endregion
+    }
+}
+
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
new file mode 100644
index 0000000..ecfd441
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
@@ -0,0 +1,193 @@
+锘縰sing System;
+using HDL_ON.UI.UI2.Intelligence.Automation.LogicView;
+using Shared;
+using System.Collections.Generic;
+namespace HDL_ON.UI.UI2.Intelligence.Automation
+{
+    public class MainView
+    {
+        /// <summary>
+        /// 璁板綍閫昏緫鑷姩鍖栫埗鎺т欢
+        /// </summary>
+        public static FrameLayout automationPage;
+        /// <summary>
+        /// 鍔犺浇閫昏緫鍒楄〃鏄剧ず鐣岄潰
+        /// </summary>
+        public static void MainShow()
+        {
+            automationPage.RemoveAll();
+            VerticalScrolViewLayout vv = new VerticalScrolViewLayout();
+            automationPage.AddChidren(vv);
+
+            for (int i = 0; i < Logic.LogicList.Count; i++)
+            {
+                var currLogic = Logic.LogicList[i];
+                ///涓婁笅闂撮殧12鍍忕礌
+                vv.AddChidren(new FrameLayout { Height = Application.GetRealHeight(12) });
+                LogicView.SingleLogicView logicView = new LogicView.SingleLogicView();
+                vv.AddChidren(logicView.FLayoutView());
+                logicView.btnLogicName.Text = currLogic.name;
+                logicView.btnWeekText.Text = GetWeekText(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;
+                };
+                logicView.btnSwitchIcon.MouseUpEventHandler += (sender1, e1) =>
+                {
+                    logicView.btnSwitchIcon.IsSelected = !logicView.btnSwitchIcon.IsSelected;
+                    if (logicView.btnSwitchIcon.IsSelected)
+                    {
+                        logicView.btnSwitchIcon.IsSelected = true;
+                    }
+                    else
+                    {
+                        logicView.btnSwitchIcon.IsSelected = false;
+                    }
+                };
+                if (currLogic.enable == "true")
+                {
+                    logicView.btnSwitchIcon.IsSelected = true;
+                }
+                else
+                {
+                    logicView.btnSwitchIcon.IsSelected = false;
+                }
+            }
+
+            if (Logic.LogicList.Count == 0)
+            {
+                Button btnTipNot = new Button()
+                {
+                    Gravity = Gravity.CenterHorizontal,
+                    Y = Application.GetRealHeight(120),
+                    Width = Application.GetRealWidth(180),
+                    Height = Application.GetRealWidth(180),
+                    UnSelectedImagePath = "TipNot.png",
+                };
+                automationPage.AddChidren(btnTipNot);
+                Button btnTipNotText = new Button()
+                {
+                    Y = btnTipNot.Bottom,
+                    Height = Application.GetRealWidth(100),
+                    TextID = StringId.TipNotOpen,
+                    TextAlignment = TextAlignment.Center,
+                    TextColor = CSS.CSS_Color.TextualColor,
+                    TextSize = CSS.CSS_FontSize.PromptFontSize_FirstLevel,
+                };
+                automationPage.AddChidren(btnTipNotText);
+            }
+        }
+        /// <summary>
+        ///  鎸�+璺宠浆鍒伴�昏緫鐣岄潰鐨勬柟娉�
+        /// </summary>
+        public static void SkipAddLogicPage()
+        {
+            Logic.currlogic = new Logic();
+            var addLogic = new AddLogic();
+            MainPage.BasePageView.AddChidren(addLogic);
+            addLogic.Show();
+            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+        }
+        /// <summary>
+        ///杩斿洖寰幆鎻忚堪鏂囨湰
+        /// </summary>
+        /// <param name="logic"></param>
+        public static string GetWeekText(Logic logic)
+        {
+
+            string weekName = "";
+            /// (鎵ц涓�娆�:once锛屾瘡澶�:day锛屾瘡鏈�:mon锛屾槦鏈�:week锛屾棩鏈熸:date_to_date)
+            switch (logic.cycle.type)
+            {
+                case "once":
+                    {
+                        weekName = Language.StringByID(StringId.performA);
+                    }
+                    break;
+                case "day":
+                    {
+                        weekName = Language.StringByID(StringId.days);
+                    }
+                    break;
+                case "week":
+                    {
+
+                        weekName = GetWeekString(logic.cycle.value);
+
+                    }
+                    break;
+                case "mon":
+                    {
+                        weekName = GetMonString(logic.cycle.value);
+                    }
+                    break;
+            }
+            return weekName;
+        }
+        /// <summary>
+        /// 鑾峰彇鏄熸湡鐨勫瓧绗︿覆
+        /// </summary>
+        /// <param name="weekList"></param>
+        /// <returns></returns>
+        public static string GetWeekString(List<string> weekList)
+        {
+            string weekTextName = "";
+
+            if (weekList.Contains("0"))
+            {
+                weekTextName += Language.StringByID(StringId.monday) + ",";
+            }
+            if (weekList.Contains("1"))
+            {
+                weekTextName += Language.StringByID(StringId.tuesday) + ",";
+            }
+            if (weekList.Contains("2"))
+            {
+                weekTextName += Language.StringByID(StringId.wednesday) + ",";
+            }
+            if (weekList.Contains("3"))
+            {
+                weekTextName += Language.StringByID(StringId.thursday) + ",";
+            }
+            if (weekList.Contains("4"))
+            {
+                weekTextName += Language.StringByID(StringId.friday) + ",";
+            }
+            if (weekList.Contains("5"))
+            {
+                weekTextName += Language.StringByID(StringId.saturday) + ",";
+            }
+            if (weekList.Contains("6"))
+            {
+                weekTextName += Language.StringByID(StringId.sunday) + ",";
+            }
+            if (weekTextName == "")
+            {
+                return "";
+            }
+            return weekTextName.TrimEnd(',');
+        }
+        /// <summary>
+        /// 鑾峰彇姣忔湀鐨勫瓧绗︿覆
+        /// </summary>
+        /// <param name="monList"></param>
+        /// <returns></returns>
+        public static string GetMonString(List<string> monList)
+        {
+            string monTextName = Language.StringByID(StringId.monthly);
+
+            for (int i = 1; i < 32; i++)
+            {
+                if (monList.Contains(i.ToString()))
+                {
+                    monTextName += i.ToString() + ",";
+                }
+            }
+            return monTextName.TrimEnd(',');
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
new file mode 100644
index 0000000..6f61531
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
@@ -0,0 +1,263 @@
+锘縰sing System;
+using System.IO;
+using System.Net;
+using HDL_ON.DAL.Server;
+using Newtonsoft.Json.Linq;
+using System.Collections.Generic;
+
+namespace HDL_ON.UI.UI2.Intelligence.Automation
+{
+    public class Send
+    {
+        ///// <summary>
+        ///// 浣忓畢ID
+        ///// </summary>
+        //public static string homeId = Entity.DB_ResidenceData.residenceData.CurReginID;
+        ///// <summary>
+        ///// 缃戝叧ID
+        ///// </summary>
+        //public static string gatewayId = DriverLayer.Control.Ins.GatewayId;
+
+        /// <summary>
+        /// 浣忓畢ID
+        /// </summary>
+        public static string homeId = "1333681497069043713";
+        /// <summary>
+        /// 缃戝叧ID
+        /// </summary>
+        public static string gatewayId = "1333682616549752834";
+        /// <summary>
+        /// 鑾峰彇閫昏緫ID鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static ResponsePackNew getLogicIdList()
+        {
+            var jObject = new JObject { { "homeId", homeId } };
+            var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_List);
+            return responsePackNew;
+        }
+        /// <summary>
+        /// 鑾峰彇閫昏緫
+        /// </summary>
+        /// <returns></returns>
+        public static ResponsePackNew getLogic(Logic logic)
+        {
+            var jArray = new JArray { };
+            jArray.Add(logic.sid);
+            var jObject = new JObject { { "userLogicIds", jArray } };
+            var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Info);
+            return responsePackNew;
+        }
+        /// <summary>
+        /// 娣诲姞鑷姩鍖栧懡浠�
+        /// </summary>
+        /// <param name="logic"></param>
+        /// <returns></returns>
+        public static ResponsePackNew AddLogic(Logic logic)
+        {
+            ResponsePackNew responsePackNew = null;
+            try
+            {
+                var cycleJObject = new JObject { };
+                var cyclevaluejArray = new JArray { };
+                cycleJObject.Add("type", logic.cycle.type);
+                foreach (var dictionary in logic.cycle.value)
+                {
+                    cyclevaluejArray.Add(dictionary);
+                }
+                cycleJObject.Add("value", cyclevaluejArray);
+
+                var inputArray = new JArray { };
+                foreach (var dictionary in logic.input)
+                {
+                    var inputTypeJOb = new JObject { };
+                    inputTypeJOb.Add("sid", dictionary.sid);
+                    inputTypeJOb.Add("condition_type", dictionary.condition_type);
+
+                    var conditionArray = new JArray { };
+                    foreach (var dic in dictionary.condition)
+                    {
+                        var conditionJOb = new JObject { };
+                        conditionJOb.Add("key", dic["key"]);
+                        conditionJOb.Add("comparator", dic["comparator"]);
+                        conditionJOb.Add("data_type", dic["data_type"]);
+                        conditionJOb.Add("value", dic["value"]);
+                        conditionArray.Add(conditionJOb);
+                    }
+                    inputTypeJOb.Add("condition",conditionArray);
+                    inputArray.Add(inputTypeJOb);
+                }
+
+                var outputArray = new JArray { };
+                foreach (var dictionary in logic.output)
+                {
+                    var outputTypeJOb = new JObject { };
+                    outputTypeJOb.Add("sid", dictionary.sid);
+                    outputTypeJOb.Add("target_type", dictionary.target_type);
+                    var statusArray = new JArray { };
+                    foreach (var dic in dictionary.status)
+                    {
+                        var statusJOb = new JObject { };
+                        statusJOb.Add("key", dic["key"]);
+                        statusJOb.Add("value", dic["value"]);
+                        statusArray.Add(statusJOb);
+                    }
+                    outputTypeJOb.Add("status", statusArray);
+                    outputArray.Add(outputTypeJOb);
+                }
+
+                var logicjArray = new JArray { };
+                var logicIfon = new JObject { };
+                logicIfon.Add("sid", logic.sid);
+                logicIfon.Add("gatewayId", gatewayId);
+                logicIfon.Add("name", logic.name);
+                logicIfon.Add("relation", logic.relation);
+                logicIfon.Add("enable", logic.enable);
+                logicIfon.Add("cycle", cycleJObject);
+                logicIfon.Add("input", inputArray);
+                logicIfon.Add("output", outputArray);
+                logicjArray.Add(logicIfon);
+                var jObject = new JObject { { "homeId", homeId }, { "logics", logicjArray } };
+                responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Add);
+
+            }
+            catch (Exception e)
+            {
+                var dd = e.Message;
+            }
+
+
+            return responsePackNew;
+        }
+
+        /// <summary>
+        /// 缂栬緫鏇存柊閫昏緫
+        /// </summary>
+        /// <param name="logic"></param>
+        /// <returns></returns>
+        public static ResponsePackNew updateLogic(Logic logic)
+        {
+            ResponsePackNew responsePackNew = null;
+            try
+            {
+                var cycleJObject = new JObject { };
+                var cyclevaluejArray = new JArray { };
+                cycleJObject.Add("type", logic.cycle.type);
+                foreach (var dictionary in logic.cycle.value)
+                {
+                    cyclevaluejArray.Add(dictionary);
+                }
+                cycleJObject.Add("value", cyclevaluejArray);
+
+                var inputArray = new JArray { };
+                foreach (var dictionary in logic.input)
+                {
+                    var inputTypeJOb = new JObject { };
+                    inputTypeJOb.Add("sid", dictionary.sid);
+                    inputTypeJOb.Add("condition_type", dictionary.condition_type);
+
+                    var conditionArray = new JArray { };
+                    foreach (var dic in dictionary.condition)
+                    {
+                        var conditionJOb = new JObject { };
+                        conditionJOb.Add("key", dic["key"]);
+                        conditionJOb.Add("comparator", dic["comparator"]);
+                        conditionJOb.Add("data_type", dic["data_type"]);
+                        conditionJOb.Add("value", dic["value"]);
+                        conditionArray.Add(conditionJOb);
+                    }
+                    inputTypeJOb.Add("condition", conditionArray);
+                    inputArray.Add(inputTypeJOb);
+                }
+
+                var outputArray = new JArray { };
+                foreach (var dictionary in logic.output)
+                {
+                    var outputTypeJOb = new JObject { };
+                    outputTypeJOb.Add("sid", dictionary.sid);
+                    outputTypeJOb.Add("target_type", dictionary.target_type);
+                    var statusArray = new JArray { };
+                    foreach (var dic in dictionary.status)
+                    {
+                        var statusJOb = new JObject { };
+                        statusJOb.Add("key", dic["key"]);
+                        statusJOb.Add("value", dic["value"]);
+                        statusArray.Add(statusJOb);
+                    }
+                    outputTypeJOb.Add("status", statusArray);
+                    outputArray.Add(outputTypeJOb);
+                }
+
+                var logicjArray = new JArray { };
+                var logicIfon = new JObject { };
+                logicIfon.Add("sid", logic.sid);
+                logicIfon.Add("gatewayId", gatewayId);
+                logicIfon.Add("name", logic.name);
+                logicIfon.Add("relation", logic.relation);
+                logicIfon.Add("enable", logic.enable);
+                logicIfon.Add("cycle", cycleJObject);
+                logicIfon.Add("input", inputArray);
+                logicIfon.Add("output", outputArray);
+                logicjArray.Add(logicIfon);
+                var jObject = new JObject { { "homeId", homeId }, { "logics", logicjArray } };
+                responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Update);
+
+            }
+            catch (Exception e)
+            {
+                var dd = e.Message;
+            }
+
+
+            return responsePackNew;
+        }
+        /// <summary>
+        /// 鍒犻櫎閫昏緫
+        /// </summary>
+        /// <returns></returns>
+        public static ResponsePackNew delLogic(Logic logic)
+        {
+            var jArray = new JArray { };
+            jArray.Add(logic.sid);
+            var jObject = new JObject { { "userLogicIds", jArray } };
+            var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Delete);
+            return responsePackNew;
+        }
+        /// <summary>
+        /// 閫昏緫寮�鍏�
+        /// </summary>
+        /// <returns></returns>
+        public static ResponsePackNew switchLogic(Logic logic)
+        {
+            logic.enable ="false";
+            var jArray = new JArray { };
+            var job = new JObject { { "userLogicId", logic.sid } , { "enable", logic.enable } };
+            jArray.Add(job);
+            var jObject = new JObject { { "logics", jArray } };
+            var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Enable);
+            return responsePackNew;
+        }
+        /// <summary>
+        ///璇锋眰鏈嶅姟鍣紙涓庝綇瀹呮湁鍏�:渚嬪锛沨omeId锛�
+        /// </summary>
+        /// <returns></returns>
+        public static ResponsePackNew RequestServerhomeId(object o, string api_Url, int mTimeout = 10)
+        {
+            var requestJson = HttpUtil.GetSignRequestJson(o);
+            return HttpUtil.RequestHttpsPostFroHome(api_Url, requestJson, mTimeout);
+
+        }
+
+        /// <summary>
+        /// 璇锋眰鏈嶅姟鍣�
+        /// </summary>
+        /// <returns></returns>
+        public static ResponsePackNew RequestServer(object o, string api_Url)
+        {
+            var requestJson = HttpUtil.GetSignRequestJson(o);
+            return HttpUtil.RequestHttpsPost(api_Url, requestJson);
+
+        }
+      
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs
new file mode 100644
index 0000000..94c4318
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs
@@ -0,0 +1,114 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation
+{
+    public class Set:FrameLayout
+    {
+        public Set()
+        {
+            Tag = "Logic";
+        }
+
+        public void Show()
+        {
+
+            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
+            LogicView.TopView topView = new LogicView.TopView();
+            this.AddChidren(topView.FLayoutView());
+            topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
+            {
+                RemoveFromParent();
+            };
+            topView.topNameBtn.TextID = StringId.setlogic;
+            FrameLayout viewLayout = new FrameLayout
+            {
+                Y = Application.GetRealHeight(64),
+                Width = Application.GetRealWidth(LogicView.TextSize.view375),
+                Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64 - 76),
+                BackgroundColor = CSS.CSS_Color.viewMiddle,
+            };
+            this.AddChidren(viewLayout);
+
+            LogicView.SelectTypeView nameView = new LogicView.SelectTypeView();
+            nameView.btnText.X = Application.GetRealWidth(16);
+            nameView.btnText.Height = Application.GetRealHeight(22);
+            nameView.btnText.TextID = StringId.namelogic;
+            nameView.btnIcon.Visible = false;
+            nameView.btnNextIcon.Height = Application.GetMinRealAverage(28);
+            nameView.btnNextIcon.Width = Application.GetMinRealAverage(28);
+            nameView.btnNextIcon.UnSelectedImagePath = "LogicIcon/editname.png";
+            viewLayout.AddChidren(nameView.FLayoutView());
+
+            Button btnAutomationName = new Button
+            {
+                TextSize = LogicView.TextSize.text14,
+                Width = Application.GetRealWidth(375 - 40 - 52),
+                Height = Application.GetRealHeight(20),
+                TextColor = CSS.CSS_Color.textCancelColor,
+                X = Application.GetRealWidth(40),
+                Gravity = Gravity.CenterVertical,
+                TextAlignment = TextAlignment.CenterRight,
+                Text =Logic.currlogic.name,
+            };
+            nameView.frameLayout.AddChidren(btnAutomationName);
+
+
+            EventHandler<MouseEventArgs> editClick = (sender, e) =>
+            {
+                List<string> list = new List<string>();
+                foreach (var logic in Logic.LogicList) {
+                    list.Add(logic.name);
+                }
+
+                new LogicView.TipPopView().InputBox(StringId.editName, Logic.currlogic.name, StringId.nameNull, StringId.NameAlreadyExists, list, (logicName) =>
+                {
+                    btnAutomationName.Text = logicName;
+                    Logic.currlogic.name = logicName;
+
+                });
+            };
+            nameView.btnClick.MouseUpEventHandler += editClick;
+            btnAutomationName.MouseUpEventHandler += editClick;
+
+
+            #region  鍒犻櫎
+            FrameLayout frameLayout = new FrameLayout
+            {
+                Y = Application.GetRealHeight(LogicView.TextSize.view667 - 50),
+                Height = Application.GetRealHeight(50),
+                BackgroundColor = CSS.CSS_Color.view,
+                Gravity = Gravity.BottomCenter,//缃簳鐨勫睘鎬�
+            };
+            this.AddChidren(frameLayout);
+            Button btnDel = new Button
+            {
+                TextSize = LogicView.TextSize.text16,
+                Width = Application.GetRealWidth(50),
+                Height = Application.GetRealHeight(22),
+                TextColor = CSS.CSS_Color.textRedColor,
+                Gravity = Gravity.Center,
+                TextID = StringId.Del,
+            };
+            frameLayout.AddChidren(btnDel);
+
+
+            EventHandler<MouseEventArgs> delClick = (sender, e) =>
+            {
+
+                new LogicView.TipPopView().TipBox(StringId.tip, StringId.delAutomation, () =>
+                {
+                    LogicMethod.RemoveAllView();
+                    Logic.LogicList.Remove(Logic.currlogic);
+                    MainView.MainShow();
+                    //鍙戦�佸垹闄ら�昏緫鍛戒护锛�
+                });
+
+            };
+            btnDel.MouseUpEventHandler += delClick;
+            frameLayout.MouseUpEventHandler += delClick;
+            #endregion
+
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs
new file mode 100644
index 0000000..634e7b0
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs
@@ -0,0 +1,386 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared;
+namespace HDL_ON.UI.UI2.Intelligence.Automation
+{
+    public class TimeTpye : FrameLayout
+    {
+        public TimeTpye()
+        {
+            Tag = "Logic";
+        }
+
+        public void Show()
+        {
+            #region  鐣岄潰甯冨眬
+            LogicView.TopView topView = new LogicView.TopView();
+            this.AddChidren(topView.FLayoutView());
+            topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
+            {
+                RemoveFromParent();
+            };
+            topView.topNameBtn.TextID = StringId.selectionTimeCondition;
+
+            FrameLayout viewLayout = new FrameLayout
+            {
+                Y = Application.GetRealHeight(64),
+                Width = Application.GetRealWidth(LogicView.TextSize.view375),
+                Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64),
+                BackgroundColor = CSS.CSS_Color.viewMiddle,
+            };
+            this.AddChidren(viewLayout);
+
+            //鏃跺埢
+            LogicView.SelectTypeView timepointView = new LogicView.SelectTypeView();
+            timepointView.btnIcon.Visible = false;
+            timepointView.btnText.X = Application.GetRealWidth(16);
+            timepointView.btnLine.X = Application.GetRealWidth(16);
+            timepointView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16);
+            timepointView.btnText.TextID = StringId.hour;
+            viewLayout.AddChidren(timepointView.FLayoutView());
+
+            //鏃堕棿鑼冨洿
+            LogicView.SelectTypeView timeHorizonView = new LogicView.SelectTypeView();
+            timeHorizonView.frameLayout.Y = timepointView.frameLayout.Bottom;
+            timeHorizonView.btnIcon.Visible = false;
+            timeHorizonView.btnText.X = Application.GetRealWidth(16);
+            timeHorizonView.btnLine.X = Application.GetRealWidth(16);
+            timeHorizonView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16);
+            timeHorizonView.btnText.TextID = StringId.timeHorizon;
+            viewLayout.AddChidren(timeHorizonView.FLayoutView());
+
+            #endregion
+
+            #region  鏃堕棿鐐�  鏃堕棿鑼冨洿鐐瑰嚮浜嬩欢
+            //鏃堕棿鐐圭偣鍑讳簨浠�
+            timepointView.btnClick.MouseUpEventHandler += (sen, e) =>
+            {
+                //涓荤晫闈㈡帶浠�
+                FrameLayout fLayout = new FrameLayout
+                {
+                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+                };
+                this.AddChidren(fLayout);
+                TimePoint(fLayout, false, 100);
+
+            };
+            //鏃堕棿鑼冨洿鐐瑰嚮浜嬩欢
+            timeHorizonView.btnClick.MouseUpEventHandler += (sen, e) =>
+            {
+                //涓荤晫闈㈡帶浠�
+                FrameLayout fLayout = new FrameLayout
+                {
+                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+                };
+                //娣诲姞涓荤晫闈�
+                this.AddChidren(fLayout);
+                TimeHorizon(fLayout, false, 0);
+            };
+
+            #endregion
+        }
+
+        /// <summary>
+        /// 鏃堕棿鐐规柟娉�
+        /// </summary>
+        /// <param name="fLayout">鍦ㄥ摢涓晫闈㈡樉绀�</param>
+        /// <param name="edit">锛坱rue=缂栬緫锛沠alse=鏂板缓锛�</param>
+        /// <param name="index">缂栬緫鏉′欢鐨勭储寮�</param>
+        public void TimePoint(FrameLayout fLayout, bool edit, int index)
+        {
+            LogicView.TimeView timePointView = new LogicView.TimeView();
+            timePointView.FLayoutView(fLayout);
+            EventHandler<MouseEventArgs> RemovefLayout = (sender, e1) =>
+             {
+                //绉婚櫎fLayout鐣岄潰
+                fLayout.RemoveFromParent();
+             };
+            //鍙栨秷鐐瑰嚮浜嬩欢
+            timePointView.btnCancel.MouseUpEventHandler += RemovefLayout;
+
+            //鍔犺浇鏁版嵁鐣岄潰鐨勮缃柟娉�(鍒楄〃浜掍笉鑱斿姩)
+            timePointView.mUIPickerView.setNPicker(timePointView.GethStringList(), timePointView.GetmStringList(), null);
+            //榛樿鍒濆閫変腑鐘舵��
+            timePointView.mUIPickerView.setCurrentItems(0, 30, 0);
+            //瀹氫箟涓�涓眬閮ㄥ彉閲忚褰曢�変腑鏃堕棿
+            string timepoint = "01:30";
+
+            if (edit)
+            {
+                Input inputs = Logic.currlogic.input[index];
+                if (inputs.condition_type == "1")
+                {
+                    List<Dictionary<string, string>> dicList = inputs.condition as List<Dictionary<string, string>>;
+                    foreach (var dic in dicList)
+                    {
+                        string timeValue = dic["value"];
+                        int hIndex = timePointView.GetValueIndex(timeValue, 0, 1, timePointView.GethIntList());
+                        int mIndex = timePointView.GetValueIndex(timeValue, 1, 0, timePointView.GetmIntList());
+                        //鏇存柊鍒濆鐘舵��
+                        timePointView.mUIPickerView.setCurrentItems(hIndex - 1, mIndex, 0);
+                        timepoint = timeValue;
+                    }
+                }
+            }
+
+
+            //閫変腑鏃堕棿鍥炶皟鏂规硶,鏃堕棿鍙樺寲涓�娆″洖璋冧竴娆�
+            timePointView.mUIPickerView.OnSelectChangeEvent += (index1, index2, index3) =>
+            {
+                string hour = timePointView.GethStringList()[index1].Split(' ')[0];
+                string minuet = timePointView.GetmStringList()[index2].Split(' ')[0];
+                timepoint = hour + ":" + minuet;
+            };
+            //纭畾鐐瑰嚮浜嬩欢
+            timePointView.btnConfirm.MouseUpEventHandler += (sender, e3) =>
+            {
+                Input inputTime = new Input();
+                inputTime.sid = LogicMethod.NewSid();
+                inputTime.condition_type = "1";
+                Dictionary<string, string> dic = new Dictionary<string, string>();
+                LogicMethod.dictionary(dic, "key", "timepoint");
+                LogicMethod.dictionary(dic, "comparator", "=");
+                LogicMethod.dictionary(dic, "data_type", "string");
+                LogicMethod.dictionary(dic, "value", timepoint);
+                inputTime.condition.Add(dic);
+                if (edit)
+                {
+                    //绉婚櫎鏃ф暟鎹�
+                    Logic.currlogic.input.RemoveAt(index);
+                    //鏂版暟鎹彃鍏ユ棫鏁版嵁鐨勪綅缃�;
+                    Logic.currlogic.input.Insert(index, inputTime);
+                }
+                else
+                {
+                    //娣诲姞涓�涓柊鐨勬椂闂寸偣鏉′欢
+                    Logic.currlogic.input.Add(inputTime);
+                }
+                LogicMethod.RemoveAllView();
+                AddLogic addLogic = new AddLogic();
+                MainPage.BasePageView.AddChidren(addLogic);
+                addLogic.Show();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+
+            };
+        }
+        /// <summary>
+        /// 鏃堕棿鑼冨洿鏂规硶
+        /// </summary>
+        /// <param name="fLayout">鍦ㄥ摢涓晫闈㈡樉绀�</param>
+        /// <param name="edit">锛坱rue=缂栬緫锛沠alse=鏂板缓锛�</param>
+        /// <param name="index">缂栬緫鏉′欢鐨勭储寮�</param>
+        public void TimeHorizon(FrameLayout fLayout,bool edit,int index)
+        {
+            #region 鐣岄潰甯冨眬
+            LogicView.TimeHorizonView timeHorizonView = new LogicView.TimeHorizonView();
+            timeHorizonView.FLayoutView(fLayout);
+            //寮�濮嬫椂闂�
+            LogicView.SelectTypeView startTimeView = new LogicView.SelectTypeView();
+            startTimeView.frameLayout.Y = Application.GetRealHeight(87);
+            startTimeView.btnIcon.Visible = false;
+            startTimeView.btnText.X = Application.GetRealWidth(16);
+            startTimeView.btnText.TextID = StringId.startTime;
+            startTimeView.btnLine.X = Application.GetRealWidth(16);
+            startTimeView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16);
+            startTimeView.btnNextIcon.X = Application.GetRealWidth(307);
+            timeHorizonView.frameLayout.AddChidren(startTimeView.FLayoutView());
+            //鏄剧ず寮�濮嬫椂闂存枃鏈�
+            Button btnStartTimeText = new Button
+            {
+                TextSize = LogicView.TextSize.text12,
+                Width = Application.GetRealWidth(32 + 3),
+                Height = Application.GetRealHeight(20),
+                TextColor = CSS.CSS_Color.textCancelColor,
+                Y = Application.GetRealHeight(17),
+                X = Application.GetRealWidth(260),
+                Tag = "0",
+            };
+            startTimeView.frameLayout.AddChidren(btnStartTimeText);
+
+            //缁撴潫鏃堕棿
+            LogicView.SelectTypeView endTimeView = new LogicView.SelectTypeView();
+            endTimeView.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight);
+            endTimeView.frameLayout.Y = startTimeView.frameLayout.Bottom;
+            endTimeView.btnIcon.Visible = false;
+            endTimeView.btnLine.Visible = false;
+            endTimeView.btnText.X = Application.GetRealWidth(16);
+            endTimeView.btnText.TextID = StringId.endTime;
+            endTimeView.btnNextIcon.X = Application.GetRealWidth(307);
+            timeHorizonView.frameLayout.AddChidren(endTimeView.FLayoutView());
+            //鏄剧ず缁撴潫鏃堕棿鏂囨湰
+            Button btnEndTimeText = new Button
+            {
+                TextSize = LogicView.TextSize.text12,
+                Width = Application.GetRealWidth(32 + 3),
+                Height = Application.GetRealHeight(20),
+                TextColor = CSS.CSS_Color.textCancelColor,
+                Y = Application.GetRealHeight(17),
+                X = Application.GetRealWidth(260),
+                Tag = "0",
+            };
+            endTimeView.frameLayout.AddChidren(btnEndTimeText);
+
+            #endregion
+
+            #region 鐐瑰嚮浜嬩欢
+            //寮�濮嬫椂闂寸偣鍑讳簨浠�
+            startTimeView.btnClick.MouseUpEventHandler += (sender, e) =>
+            {
+                SelectedTimeHorizon(fLayout, btnStartTimeText);
+            };
+            //缁撴潫鏃堕棿鐐瑰嚮浜嬩欢
+            endTimeView.btnClick.MouseUpEventHandler += (sender, e) =>
+            {
+                SelectedTimeHorizon(fLayout, btnEndTimeText);
+            };
+            //纭畾鐐瑰嚮浜嬩欢
+            timeHorizonView.btnConfirm.MouseUpEventHandler += (sender, e) =>
+            {
+                if (btnStartTimeText.Tag.ToString() == "0")
+                {
+                    //鎻愮ず锛氳閫変腑寮�濮嬫椂闂�
+                    return;
+                }
+                if (btnEndTimeText.Tag.ToString() == "0")
+                {
+                    //鎻愮ず锛氳閫変腑缁撴潫鏃堕棿
+                    return;
+                }
+                if (btnStartTimeText.Tag.ToString() == btnEndTimeText.Tag.ToString())
+                {
+                    //鎻愮ず锛氭椂闂翠竴鏍风殑
+                    return;
+                }
+                if (int.Parse(btnStartTimeText.Tag.ToString()) > int.Parse(btnEndTimeText.Tag.ToString()))
+                {
+                    //鎻愮ず锛氬紑濮嬫椂闂翠笉鑳藉ぇ浜庣粨鏉熸椂闂�
+                    return;
+                }
+
+                Input inputTime = new Input();
+                inputTime.sid = LogicMethod.NewSid();
+                inputTime.condition_type = "2";
+                Dictionary<string, string> dic = new Dictionary<string, string>();
+                LogicMethod.dictionary(dic, "key", "timesection");
+                LogicMethod.dictionary(dic, "comparator", "=");
+                LogicMethod.dictionary(dic, "data_type", "string");
+                LogicMethod.dictionary(dic, "value", btnStartTimeText.Text+"~"+btnEndTimeText.Text);
+                inputTime.condition.Add(dic);
+                if (edit)
+                {
+                    //绉婚櫎鏃ф暟鎹�
+                    Logic.currlogic.input.RemoveAt(index);
+                    //鏂版暟鎹彃鍏ユ棫鏁版嵁鐨勪綅缃�
+                    Logic.currlogic.input.Insert(index, inputTime);
+                    fLayout.RemoveFromParent();
+                }
+                else
+                {
+                    //娣诲姞涓�涓柊鐨勬椂闂寸偣鏉′欢
+                    Logic.currlogic.input.Add(inputTime);
+                }
+                LogicMethod.RemoveAllView();
+                AddLogic addLogic = new AddLogic();
+                MainPage.BasePageView.AddChidren(addLogic);
+                addLogic.Show();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+
+
+            };
+            #endregion
+
+            if (edit)
+            {
+                Input inputs = Logic.currlogic.input[index];
+                if (inputs.condition_type == "2")
+                {
+                    List<Dictionary<string, string>> dicList = inputs.condition as List<Dictionary<string, string>>;
+                    foreach (var dic in dicList)
+                    {
+                        string value = dic["value"];
+                        string startTime = value.Split('~')[0];
+                        string endtTime = value.Split('~')[1];
+                        btnStartTimeText.Text = startTime;
+                        btnStartTimeText.Tag = int.Parse(startTime.Split(':')[0]) * 60 + int.Parse(startTime.Split(':')[1]);
+                        btnEndTimeText.Text = endtTime;
+                        btnEndTimeText.Tag = int.Parse(endtTime.Split(':')[0]) * 60 + int.Parse(endtTime.Split(':')[1]);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// 璁剧疆鏃堕棿娈垫椂闂寸殑鏂规硶
+        /// </summary>
+        /// <param name="fLayout"></param>
+        /// <param name="btn"></param>
+        public void SelectedTimeHorizon(FrameLayout fLayout, Button btn)
+        {
+
+            LogicView.TimeView timePointView = new LogicView.TimeView();
+            timePointView.FLayoutView(fLayout);
+            EventHandler<MouseEventArgs> RemovefLayout = (sender, e1) =>
+            {
+                //鍙Щ闄ゆ椂闂村脊绐楃晫闈�
+                timePointView.frameLayout.RemoveFromParent();
+            };
+            //鍙栨秷鐐瑰嚮浜嬩欢
+            timePointView.btnCancel.MouseUpEventHandler += RemovefLayout;
+            //鍔犺浇鏁版嵁鐣岄潰鐨勮缃柟娉�(鍒楄〃浜掍笉鑱斿姩)
+            timePointView.mUIPickerView.setNPicker(timePointView.GethStringList(), timePointView.GetmStringList(), null);
+            //榛樿鍒濆閫変腑鐘舵��
+            timePointView.mUIPickerView.setCurrentItems(0, 30, 0);
+            //瀹氫箟涓�涓眬閮ㄥ彉閲忚褰曢�変腑鏃堕棿
+            string timepoint = "01:30";
+            int sumTime = 90;
+
+            if (btn.Tag.ToString() != "0")
+            {
+                string h = "", m = "";
+                sumTime = int.Parse(btn.Tag.ToString());
+                if ((sumTime / 60) < 10)
+                {
+                    h = "0" + (sumTime / 60).ToString();
+                }
+                else
+                {
+                    h = (sumTime / 60).ToString();
+                }
+
+                if ((sumTime % 60) < 10)
+                {
+                    m = "0" + (sumTime % 60).ToString();
+                }
+                else
+                {
+                    m = (sumTime % 60).ToString();
+                }
+                timepoint = h + ":" + m;
+
+                int hourIndex = timePointView.GetValueIndex(timepoint, 0, 1, timePointView.GethIntList());
+                int minuteIndex = timePointView.GetValueIndex(timepoint, 1, 0, timePointView.GetmIntList());
+                //鏇存柊鐘舵��
+                timePointView.mUIPickerView.setCurrentItems(hourIndex - 1, minuteIndex, 0);
+            }
+
+            //閫変腑鏃堕棿鍥炶皟鏂规硶,鏃堕棿鍙樺寲涓�娆″洖璋冧竴娆�
+            timePointView.mUIPickerView.OnSelectChangeEvent += (index1, index2, index3) =>
+            {
+                
+                string hour = timePointView.GethStringList()[index1].Split(' ')[0];
+                string minuet = timePointView.GetmStringList()[index2].Split(' ')[0];
+                timepoint = hour + ":" + minuet;
+                sumTime = int.Parse(hour) * 60 + int.Parse(minuet);
+
+
+            };
+            //纭畾鐐瑰嚮浜嬩欢
+            timePointView.btnConfirm.MouseUpEventHandler += (sender1, e3) =>
+            {
+                btn.Tag = sumTime;
+                btn.Text = timepoint;
+                //鍙Щ闄ゆ椂闂村脊绐楃晫闈�
+                timePointView.frameLayout.RemoveFromParent();
+            };
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
index db28d94..72c5ce7 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
@@ -4,7 +4,7 @@
 using HDL_ON.UI.CSS;
 using Shared;
 
-namespace HDL_ON.UI 
+namespace HDL_ON.UI
 {
     public partial class IntelligencePage : FrameLayout
     {
@@ -177,7 +177,8 @@
 
             #endregion
 
-            sceneFunctionView = new VerticalScrolViewLayout() {
+            sceneFunctionView = new VerticalScrolViewLayout()
+            {
                 Y = floorChangeView.Bottom,
                 Height = Application.GetRealHeight(667 - 64 - 49 - 52 + 30),
             };
@@ -365,30 +366,11 @@
         void LoadAutomationPageView()
         {
             //btnAddIcon.RemoveFromParent();
-
             automationPage = new FrameLayout();
             contentPageView.AddChidren(automationPage);
+            HDL_ON.UI.UI2.Intelligence.Automation.MainView.automationPage = automationPage;
+            HDL_ON.UI.UI2.Intelligence.Automation.MainView.MainShow();
 
-            Button btnTipNot = new Button()
-            {
-                Gravity = Gravity.CenterHorizontal,
-                Y = Application.GetRealHeight(120),
-                Width = Application.GetRealWidth(180),
-                Height = Application.GetRealWidth(180),
-                UnSelectedImagePath = "TipNot.png",
-            };
-            automationPage.AddChidren(btnTipNot);
-
-            Button btnTipNotText = new Button()
-            {
-                Y = btnTipNot.Bottom,
-                Height = Application.GetRealWidth(100),
-                TextID = StringId.TipNotOpen,
-                TextAlignment = TextAlignment.Center,
-                TextColor = CSS_Color.TextualColor,
-                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-            };
-            automationPage.AddChidren(btnTipNotText);
         }
         #endregion
     }
@@ -441,9 +423,9 @@
                 btnSceneTilte.TextSize = CSS_FontSize.HeadlineFontSize;
                 btnAutomationTitle.IsSelected = false;
                 btnAutomationTitle.TextSize = CSS_FontSize.TextFontSize;
-
                 contentPageView.PageIndex = 0;
             };
+            //閫昏緫鐐瑰嚮浜嬩欢
             btnAutomationTitle.MouseUpEventHandler = (sender, e) => {
                 if (btnAutomationTitle.IsSelected)
                 {
@@ -454,6 +436,7 @@
                 btnSceneTilte.IsSelected = false;
                 btnSceneTilte.TextSize = CSS_FontSize.TextFontSize;
                 contentPageView.PageIndex = 1;
+
             };
         }
         #endregion
@@ -465,13 +448,22 @@
         {
             btnAddIcon.MouseUpEventHandler = (sender, e) =>
             {
-                Action action = () => {
-                    LoadSceneFunctionControlZone();
-                };
-                var aep = new NewSceneMenuListPage(action);
-                MainPage.BasePageView.AddChidren(aep);
-                aep.LoadPage();
-                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                if (!btnAutomationTitle.IsSelected)
+                {
+                    Action action = () =>
+                    {
+                        LoadSceneFunctionControlZone();
+                    };
+                    var aep = new NewSceneMenuListPage(action);
+                    MainPage.BasePageView.AddChidren(aep);
+                    aep.LoadPage();
+                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                }
+                else
+                {
+                    //璺宠浆鍒伴�昏緫鐣岄潰
+                    HDL_ON.UI.UI2.Intelligence.Automation.MainView.SkipAddLogicPage();
+                }
             };
         }
 
@@ -492,6 +484,7 @@
             btnName.MouseUpEventHandler = eventHandler;
             btnZone.MouseUpEventHandler = eventHandler;
         }
+
     }
 
 }

--
Gitblit v1.8.0