From cc57e8d53611813232e8f5761aca452a020e031a Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期一, 06 十一月 2023 16:59:03 +0800
Subject: [PATCH] Merge branch 'Dev-Branch' into wjc

---
 HDL-ON_iOS/ViewController.cs                                        |    7 
 HDL_ON/Entity/Function/Scene.cs                                     |  193 ++++---
 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs   |   41 -
 HDL-ON_Android/Properties/AndroidManifest.xml                       |    2 
 HDL-ON_Android/Assets/Language.ini                                  |   10 
 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs                  |  390 +++++++++++----
 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs                 |  290 ++++++++++--
 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneTargetTypeChoosePage.cs     |  158 ++++++
 HDL_ON/DAL/Mqtt/MqttClient.cs                                       |    7 
 HDL_ON/HDL_ON.projitems                                             |    2 
 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAutomationListChoosePage.cs |  239 +++++++++
 HDL_ON/Entity/FunctionList.cs                                       |    2 
 HDL_ON/UI/UI0-Public/TopViewDiv.cs                                  |    8 
 HDL-ON_iOS/Info.plist                                               |    4 
 HDL-ON_iOS/Resources/Language.ini                                   |   10 
 HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs          |    6 
 HDL_ON/DAL/Server/HttpUtil.cs                                       |    2 
 HDL-ON_Android/Resources/Resource.designer.cs                       |    2 
 HDL_ON/Common/R.cs                                                  |    8 
 HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs      |    8 
 HDL_ON/DAL/Server/HttpServerRequest.cs                              |    5 
 HDL_ON/UI/MainPage.cs                                               |   10 
 HDL_ON/UI/UI1-Login/LoginPage.cs                                    |    2 
 23 files changed, 1,105 insertions(+), 301 deletions(-)

diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index 106d06c..96e7893 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -683,6 +683,8 @@
 696=Monthly data of the past year
 697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect.
 698=Break
+699=Choose automation
+700=Add execution action
 
 
 
@@ -2082,6 +2084,8 @@
 696=杩囧幓涓�骞寸殑姣忔湀鏁版嵁
 697=鎻愮ず锛氳捣濮嬮鑹查�夋嫨瓒婇潬杩戣壊鐜竟缂橈紝鐐僵鏁堟灉瓒婃槑鏄俱�傝秺闈犺繎鐧借壊涓績锛岀偒褰╂晥鏋滆秺涓嶆槑鏄俱��
 698=鏂紑
+699=閫夋嫨鑷姩鍖�
+700=娣诲姞鎵ц鐩爣
 
 
 
@@ -3479,6 +3483,8 @@
 696=Monthly data of the past year
 697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect.
 698=Break
+699=Choose automation
+700=Add execution action
 
 
 
@@ -4871,6 +4877,8 @@
 696=Monthly data of the past year
 697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect.
 698=Break
+699=Choose automation
+700=Add execution action
 
 
 
@@ -6248,6 +6256,8 @@
 696=Monthly data of the past year
 697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect.
 698=Break
+699=Choose automation
+700=Add execution action
 
 
 
diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index f522fe1..846f0be 100644
--- a/HDL-ON_Android/Properties/AndroidManifest.xml
+++ b/HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
 锘�<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.3.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202310301">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.3.1" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202311021">
 	<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="30" />
 	<uses-permission android:name="android.permission.RECEIVE_SMS" />
 	<!--鍙嬬洘-->
diff --git a/HDL-ON_Android/Resources/Resource.designer.cs b/HDL-ON_Android/Resources/Resource.designer.cs
index 485dc4b..af7c4b4 100644
--- a/HDL-ON_Android/Resources/Resource.designer.cs
+++ b/HDL-ON_Android/Resources/Resource.designer.cs
@@ -15,7 +15,7 @@
 {
 	
 	
-	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.2.0.99")]
+	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.2.1.111")]
 	public partial class Resource
 	{
 		
diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist
index dd41d60..e4af464 100644
--- a/HDL-ON_iOS/Info.plist
+++ b/HDL-ON_iOS/Info.plist
@@ -11,7 +11,7 @@
 	<key>CFBundleName</key>
 	<string>On Pro</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.3.0</string>
+	<string>2.3.1</string>
 	<key>CFBundleURLTypes</key>
 	<array>
 		<dict>
@@ -36,7 +36,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>2.3.0</string>
+	<string>2.3.1</string>
 	<key>LSApplicationQueriesSchemes</key>
 	<array>
 		<string>weixinULAPI</string>
diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini
index 864ca1a..cad4950 100644
--- a/HDL-ON_iOS/Resources/Language.ini
+++ b/HDL-ON_iOS/Resources/Language.ini
@@ -683,6 +683,8 @@
 696=Monthly data of the past year
 697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect.
 698=Break
+699=Choose automation
+700=Add execution action
 
 
 
@@ -2082,6 +2084,8 @@
 696=杩囧幓涓�骞寸殑姣忔湀鏁版嵁
 697=鎻愮ず锛氳捣濮嬮鑹查�夋嫨瓒婇潬杩戣壊鐜竟缂橈紝鐐僵鏁堟灉瓒婃槑鏄俱�傝秺闈犺繎鐧借壊涓績锛岀偒褰╂晥鏋滆秺涓嶆槑鏄俱��
 698=鏂紑
+699=閫夋嫨鑷姩鍖�
+700=娣诲姞鎵ц鐩爣
 
 
 
@@ -3478,6 +3482,8 @@
 696=Monthly data of the past year
 697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect.
 698=Break
+699=Choose automation
+700=Add execution action
 
 
 
@@ -4870,6 +4876,8 @@
 696=Monthly data of the past year
 697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect.
 698=Break
+699=Choose automation
+700=Add execution action
 
 
 
@@ -6247,6 +6255,8 @@
 696=Monthly data of the past year
 697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect.
 698=Break
+699=Choose automation
+700=Add execution action
 
 
 
diff --git a/HDL-ON_iOS/ViewController.cs b/HDL-ON_iOS/ViewController.cs
index 52dee5d..5e5749e 100644
--- a/HDL-ON_iOS/ViewController.cs
+++ b/HDL-ON_iOS/ViewController.cs
@@ -22,6 +22,13 @@
             }
         }
 
+        // 鍒囨崲鍒扮珫灞忔ā寮�
+        public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations()
+        {
+            return UIInterfaceOrientationMask.Portrait;
+        }
+
+
         public override void ViewDidLoad()
         {
             base.ViewDidLoad();
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index 49f3d59..77189b4 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -5,6 +5,14 @@
     public static class StringId
     {
         /// <summary>
+        /// 娣诲姞鎵ц鍔ㄤ綔
+        /// </summary>
+        public const int AddExecutionAction = 700;
+        /// <summary>
+        /// 閫夋嫨鑷姩鍖�
+        /// </summary>
+        public const int SelectAutomation = 699;
+        /// <summary>
         /// 鏂紑锛堝共鎺ョ偣锛�
         /// </summary>
         public const int DryBreak = 698;
diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs
index 51866d6..4353a7f 100644
--- a/HDL_ON/DAL/Mqtt/MqttClient.cs
+++ b/HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -133,10 +133,6 @@
             new System.Threading.Thread(async () => {
                 while (true)
                 {
-                    if (!UserInfo.Current.IsLogin)
-                    {
-                        return;
-                    }
                     try
                     {
                         System.Threading.Thread.Sleep(2000);
@@ -149,6 +145,7 @@
 
                         await StartCloudMqtt();
                         await SubscribeTopics();
+
                     }
                     catch { }
                 }
@@ -984,7 +981,7 @@
 
 
                 MqttInfoConfig.Current.mMqttInfo = mqttInfoRequestResult_Obj;
-                await MQTTConnectAsync();
+                //await MQTTConnectAsync();
                 //1.鍒ゆ柇鏄惁缁戝畾浜嗙綉鍏筹紝鑾峰彇缃戝叧杩滅▼杩炴帴鐨勫姞瀵咾EY
                 //if (DB_ResidenceData.Instance.CheckWhetherGatewayIsBound())
                 {
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index f6d8677..46ccea0 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -192,9 +192,8 @@
             {
                 if (canRefresh)
                 {
-                    MainPage.Log($"UserInfo.Current.RefreshToken 1 : " + UserInfo.Current.RefreshToken);
-                    UserInfo.Current.RefreshToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GAccessToken);
-                    MainPage.Log($"UserInfo.Current.RefreshToken 2 : " + UserInfo.Current.RefreshToken);
+                    UserInfo.Current.RefreshToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GRefreshToken);
+                    //UserInfo.Current.AccessToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GAccessToken);
                     RefreshToken(false);
                 }
             }
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index 0c95e74..0be5794 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -213,7 +213,7 @@
                 if(apiPath == NewAPI.API_POST_Login)
                 {
                     var ddd = Newtonsoft.Json.JsonConvert.SerializeObject(response);
-                    Console.WriteLine(ddd);
+                    //Console.WriteLine(ddd);
                 }
                 if (response.StatusCode == HttpStatusCode.OK)
                 {
diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs
index 35fba28..1e92f33 100644
--- a/HDL_ON/Entity/Function/Scene.cs
+++ b/HDL_ON/Entity/Function/Scene.cs
@@ -3,6 +3,7 @@
 using HDL_ON.Common;
 using HDL_ON.DAL.Server;
 using HDL_ON.UI;
+using HDL_ON.UI.UI2.Intelligence.Automation;
 using Shared;
 
 namespace HDL_ON.Entity
@@ -86,6 +87,14 @@
         /// 鏄惁鍏佽鍒犻櫎
         /// </summary>
         public bool can_delete = true;
+        /// <summary>
+        /// 鏄惁鍏佽缂栬緫
+        /// </summary>
+        public bool can_edit = true;
+        /// <summary>
+        /// 鏄惁鏄綉鍏虫湰鍦板満鏅�
+        /// </summary>
+        public bool local = false;
 
         /// <summary>
         /// 鍒涘缓璇ュ満鏅殑鐢ㄦ埛ID
@@ -561,12 +570,24 @@
         /// <returns></returns>
         private Function ConvertFunctionObject()
         {
-            var localFunction = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.sid == sid);
-            if(localFunction == null)
+            Function temp = null;
+            if (type == "7")
             {
-                localFunction = FunctionList.List.groupControls.Find((obj) => obj.sid == sid);
+                var logic = Logic.LogicList.Find((obj) => obj.sid == sid);
+                if (logic != null) {
+                    temp = new Function();
+                    temp.name = logic.name;
+                }
             }
-            return localFunction;
+            else
+            {
+                temp = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.sid == sid);
+                if (temp == null)
+                {
+                    temp = FunctionList.List.groupControls.Find((obj) => obj.sid == sid);
+                }
+            }
+            return temp;
         }
 
 
@@ -577,91 +598,109 @@
         public string GetFunctionScnenInfo()
         {
             var sceneFunctionInfo = "";
-            foreach (var sfs in status)
+            if (type == "7")
             {
-                if (sfs.key == FunctionAttributeKey.OnOff)
+                foreach (var sfs in status)
                 {
-                    if (sfs.value == "off")
+                    if (sfs.key == "enable")
                     {
-                        return Language.StringByID(StringId.Close);
+                        if (sfs.value == "true")
+                            return Language.StringByID(StringId.OpenArm);
+                        else
+                        {
+                            return Language.StringByID(StringId.Close);
+                        }
                     }
                 }
             }
-            sceneFunctionInfo += Language.StringByID(StringId.Open) + " ";
+            else
+            {
+                foreach (var sfs in status)
+                {
+                    if (sfs.key == FunctionAttributeKey.OnOff)
+                    {
+                        if (sfs.value == "off")
+                        {
+                            return Language.StringByID(StringId.Close);
+                        }
+                    }
+                }
+                sceneFunctionInfo += Language.StringByID(StringId.Open) + " ";
 
-            var modeState = status.Find((obj) => obj.key == FunctionAttributeKey.Mode);
-            var tempState = status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp);
-            var fanState = status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed);
-            ////娴蜂俊鐢佃鐘舵��
-            //var hisenseTvState = status.Find((obj) => obj.key == "wol");
-            //if(hisenseTvState != null)
-            //{
-            //}
-            if (modeState != null)
-            {
-                sceneFunctionInfo += modeState.GetValueText() + " ";
-            }
-            if (tempState != null)
-            {
-                sceneFunctionInfo += tempState.GetValueText();
-                sceneFunctionInfo += tempState.GetUintString() + " ";
-            }
-            if (fanState != null)
-            {
-                sceneFunctionInfo += fanState.GetValueText() + " ";
-            }
-            var briState = status.Find((obj) => obj.key == FunctionAttributeKey.Brightness);
-            if (briState != null)
-            {
-                sceneFunctionInfo += briState.value + "%" + " ";
-            }
-            var perState = status.Find((obj) => obj.key == FunctionAttributeKey.Percent);
-            if (perState != null)
-            {
-                sceneFunctionInfo += perState.value + "%" + " ";
-            }
-            var cctState = status.Find((obj) => obj.key == FunctionAttributeKey.CCT);
-            if (cctState != null)
-            {
-                sceneFunctionInfo += cctState.value + "K" + " ";
-            }
-            var rgbState = status.Find((obj) => obj.key == FunctionAttributeKey.RGB);
-            if (rgbState != null)
-            {
-                //sceneFunctionInfo += new  cctState.value + "%" + " ";
-            }
+                var modeState = status.Find((obj) => obj.key == FunctionAttributeKey.Mode);
+                var tempState = status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp);
+                var fanState = status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed);
+                ////娴蜂俊鐢佃鐘舵��
+                //var hisenseTvState = status.Find((obj) => obj.key == "wol");
+                //if(hisenseTvState != null)
+                //{
+                //}
+                if (modeState != null)
+                {
+                    sceneFunctionInfo += modeState.GetValueText() + " ";
+                }
+                if (tempState != null)
+                {
+                    sceneFunctionInfo += tempState.GetValueText();
+                    sceneFunctionInfo += tempState.GetUintString() + " ";
+                }
+                if (fanState != null)
+                {
+                    sceneFunctionInfo += fanState.GetValueText() + " ";
+                }
+                var briState = status.Find((obj) => obj.key == FunctionAttributeKey.Brightness);
+                if (briState != null)
+                {
+                    sceneFunctionInfo += briState.value + "%" + " ";
+                }
+                var perState = status.Find((obj) => obj.key == FunctionAttributeKey.Percent);
+                if (perState != null)
+                {
+                    sceneFunctionInfo += perState.value + "%" + " ";
+                }
+                var cctState = status.Find((obj) => obj.key == FunctionAttributeKey.CCT);
+                if (cctState != null)
+                {
+                    sceneFunctionInfo += cctState.value + "K" + " ";
+                }
+                var rgbState = status.Find((obj) => obj.key == FunctionAttributeKey.RGB);
+                if (rgbState != null)
+                {
+                    //sceneFunctionInfo += new  cctState.value + "%" + " ";
+                }
 
 
-            var perAngle = status.Find((obj) => obj.key == FunctionAttributeKey.Angle);
-            if (perAngle != null)
-            {
-                sceneFunctionInfo += " " + perAngle.value + "掳";
-            }
+                var perAngle = status.Find((obj) => obj.key == FunctionAttributeKey.Angle);
+                if (perAngle != null)
+                {
+                    sceneFunctionInfo += " " + perAngle.value + "掳";
+                }
 
-            var perSetVolume = status.Find((obj) => obj.key == FunctionAttributeKey.SetVolume);
-            if (perSetVolume != null)
-            {
-                sceneFunctionInfo += " " + perSetVolume.value;
-            }
+                var perSetVolume = status.Find((obj) => obj.key == FunctionAttributeKey.SetVolume);
+                if (perSetVolume != null)
+                {
+                    sceneFunctionInfo += " " + perSetVolume.value;
+                }
 
-            var perSignal = status.Find((obj) => obj.key == FunctionAttributeKey.Signal);
-            if (perSignal != null)
-            {
-                var p = new HDL_ON.UI.UI2.Intelligence.Automation.PublicInterface();
-                string key = p.GetKey(p.GetHisenseSignalSourceDic(), perSignal.value);
-                sceneFunctionInfo += " " + key;
-            }
+                var perSignal = status.Find((obj) => obj.key == FunctionAttributeKey.Signal);
+                if (perSignal != null)
+                {
+                    var p = new HDL_ON.UI.UI2.Intelligence.Automation.PublicInterface();
+                    string key = p.GetKey(p.GetHisenseSignalSourceDic(), perSignal.value);
+                    sceneFunctionInfo += " " + key;
+                }
 
-            var perVolume =status.Find((obj) => obj.key == FunctionAttributeKey.Volume);
-            if (perVolume != null)
-            {
-                sceneFunctionInfo += " " + perVolume.value;
-            }
+                var perVolume = status.Find((obj) => obj.key == FunctionAttributeKey.Volume);
+                if (perVolume != null)
+                {
+                    sceneFunctionInfo += " " + perVolume.value;
+                }
 
-            var perSongName =status.Find((obj) => obj.key == FunctionAttributeKey.SongName);
-            if (perSongName != null)
-            {
-                sceneFunctionInfo += " " + perSongName.value;
+                var perSongName = status.Find((obj) => obj.key == FunctionAttributeKey.SongName);
+                if (perSongName != null)
+                {
+                    sceneFunctionInfo += " " + perSongName.value;
+                }
             }
             return sceneFunctionInfo;
         }
@@ -670,6 +709,8 @@
         /// 璁惧
         /// 鍦烘櫙 =scene
         /// 缇ゆ帶=5
+        /// 鑷姩鍖�=7
+        /// 
         /// </summary>
         public string type = "0";
     }
diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index 919bfe1..f91b737 100644
--- a/HDL_ON/Entity/FunctionList.cs
+++ b/HDL_ON/Entity/FunctionList.cs
@@ -282,6 +282,8 @@
                 SPK.SensorSmoke,
                 SPK.SensorWater,
                 SPK.SensorGas,
+                SPK.SensorDryContact,
+                SPK.SensorDryContact2,
             };
 
             return Functions.FindAll((obj) => spkList.Contains(obj.spk));
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index edb07df..708c9a1 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -598,6 +598,8 @@
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\AirSwitchP3EnergyPage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\AirSwitchP3SubloopEnergyPage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Constant.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Scene\SceneTargetTypeChoosePage.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Scene\SceneAutomationListChoosePage.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs
index 6f0454c..3d6d3c4 100644
--- a/HDL_ON/UI/MainPage.cs
+++ b/HDL_ON/UI/MainPage.cs
@@ -26,7 +26,7 @@
         /// <summary>
         /// 鐗堟湰鍙�
         /// </summary>
-        public static string VersionString = "2.3.0";
+        public static string VersionString = "2.3.1";
         ///// <summary>
         ///// 瀹㈡埛绔被鍨�
         ///// </summary>
@@ -632,11 +632,9 @@
         public static void Log(string msg)
         {
 #if DEBUG
-            if (msg.Contains("鏀跺埌鏁版嵁")
-                || msg.Contains("鍙戦��")
-                || msg.Contains("鎺ユ敹鍒版帹閫�")
-                   || msg.Contains("api")
-                || msg.Contains("璇诲彇鍔熻兘鐘舵��")
+            if (msg.Contains("鏀跺埌")
+                //|| msg.Contains("鍙戦��")
+                //|| msg.Contains("鎺ユ敹")
                 || true
                 )
                 Console.WriteLine(msg);
diff --git a/HDL_ON/UI/UI0-Public/TopViewDiv.cs b/HDL_ON/UI/UI0-Public/TopViewDiv.cs
index 572cffe..31658f6 100644
--- a/HDL_ON/UI/UI0-Public/TopViewDiv.cs
+++ b/HDL_ON/UI/UI0-Public/TopViewDiv.cs
@@ -42,6 +42,8 @@
         /// </summary>
         Action backAction;
 
+        public int maginY = 0;
+
         public TopViewDiv(FrameLayout frame, string str)
         {
             baseView = frame;
@@ -84,7 +86,7 @@
         {
             contentView = new FrameLayout()
             {
-                Height = Application.GetRealHeight(64),
+                Height = Application.GetRealHeight(64+ maginY),
                 BackgroundColor = color,
             };
             baseView.AddChidren(contentView);
@@ -92,7 +94,7 @@
             Button btnBackIcon = new Button()
             {
                 X = Application.GetRealWidth(10),
-                Y = Application.GetRealHeight(29),
+                Y = Application.GetRealHeight(29 + maginY),
                 Width = Application.GetRealWidth(40),
                 Height = Application.GetRealWidth(28),
                 UnSelectedImagePath = "Public/BackIcon.png",
@@ -102,7 +104,7 @@
             btnTilte = new Button()
             {
                 Gravity = Gravity.CenterHorizontal,
-                Y = Application.GetRealHeight(30),
+                Y = Application.GetRealHeight(30 + maginY),
                 Width = Application.GetRealWidth(270),
                 Height = Application.GetRealHeight(25),
                 TextAlignment = TextAlignment.Center,
diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs
index d4ba44d..87bea6c 100644
--- a/HDL_ON/UI/UI1-Login/LoginPage.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -330,7 +330,7 @@
                     etAccount.Text = "13533335801";
                     etAccount.Text = "13682244600";
                     etAccount.Text = "marketing@australindo.co.id";
-                    etAccount.Text = "dcai.assist@gmail.com";
+                    etAccount.Text = "support7@hdlautomation.com";
 
                 }
                 else
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs
index efb7272..6ec4b00 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs
@@ -24,13 +24,15 @@
         public void LoadPage()
         {
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
-            new TopViewDiv(bodyView, Language.StringByID(StringId.NewScene)).LoadTopView();
+            var topView = new TopViewDiv(bodyView, Language.StringByID(StringId.NewScene));
+            topView.maginY = 10;
+            topView.LoadTopView();
 
             #region 娣诲姞鍦烘櫙
             FrameLayout addSceneView = new FrameLayout()
             {
                 Gravity = Gravity.CenterHorizontal,
-                Y = Application.GetRealHeight(67),
+                Y = Application.GetRealHeight(67 + 10),
                 Width = Application.GetRealWidth(361),
                 Height = Application.GetRealWidth(202),
                 Radius = (uint)Application.GetRealWidth(12),
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
index 4586b64..c4219e2 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
@@ -97,14 +97,16 @@
 
         public void LoadPage()
         {
-            new TopViewDiv(bodyView, Language.StringByID(StringId.NewScene)).LoadTopView();
+            var topView = new TopViewDiv(bodyView, Language.StringByID(StringId.NewScene));
+            topView.maginY = 10;
+            topView.LoadTopView();
      
             bodyView.BackgroundColor = CSS_Color.MainBackgroundColor;
 
             var contentView = new VerticalScrolViewLayout()
             {
-                Y = Application.GetRealHeight(64),
-                Height = Application.GetRealHeight(603 - 50),
+                Y = Application.GetRealHeight(64+10),
+                Height = Application.GetRealHeight(603 - 50 -10),
                 //BackgroundColor = CSS_Color.DividingLineColor,
             };
             bodyView.AddChidren(contentView);
@@ -423,25 +425,6 @@
                 };
                 row.AddChidren(btnFunctionInfo);
 
-                var btnFunctionDelayInfo = new Button()
-                {
-                    Width = Application.GetRealWidth(327),
-                    Y = Application.GetRealWidth(35),
-                    Height = Application.GetRealWidth(32),
-                    TextAlignment = TextAlignment.TopRight,
-                    TextColor = CSS_Color.PromptingColor1,
-                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                };
-                row.AddChidren(btnFunctionDelayInfo);
-
-                if (Convert.ToInt32(scenefunction.delay) > 0)
-                {
-                    btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText();
-                }
-                else
-                {
-                    btnFunctionDelayInfo.Text = Language.StringByID(StringId.NoDelay);
-                }
 
                 var btnFunctionName = new Button()
                 {
@@ -454,34 +437,74 @@
                 };
                 row.AddChidren(btnFunctionName);
 
-                var btnFunctionFloorAndRoom = new Button()
+                if (scenefunction.type == "7")
                 {
-                    X = Application.GetRealWidth(16),
-                    Y = Application.GetRealWidth(24),
-                    Height = Application.GetRealWidth(41),
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = CSS_Color.PromptingColor1,
-                    TextSize = CSS_FontSize.TextFontSize,
-                    Text = scenefunction.localFunction.GetRoomListName(),
-                };
-                row.AddChidren(btnFunctionFloorAndRoom);
+                    btnFunctionName.Gravity = Gravity.CenterVertical;
+                    btnFunctionInfo.TextAlignment = TextAlignment.CenterRight;
+                    btnFunctionInfo.Gravity = Gravity.CenterVertical;
 
-                EventHandler<MouseEventArgs> skipEvent= (sender, e) =>
+                    btnFunctionName.MouseUpEventHandler = (sender, e) =>{
+                        try
+                        {
+                            LoadAutomationSettingDialog(scenefunction, btnFunctionInfo);
+                        }
+                        catch (Exception ex)
+                        {
+                            MainPage.Log($"load automation error : {ex.Message}");
+                        }
+                    };
+                }
+                else
                 {
-                    try
+                    var btnFunctionDelayInfo = new Button()
                     {
-                        var ssf = new SceneFunctionInfoEditPage(scene, scenefunction.localFunction.ConvertSceneFunction(), refreshFunctionRowAction);
-                        MainPage.BasePageView.AddChidren(ssf);
-                        ssf.LoadPage();
-                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-                    }catch(Exception ex)
+                        Width = Application.GetRealWidth(327),
+                        Y = Application.GetRealWidth(35),
+                        Height = Application.GetRealWidth(32),
+                        TextAlignment = TextAlignment.TopRight,
+                        TextColor = CSS_Color.PromptingColor1,
+                        TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                    };
+                    row.AddChidren(btnFunctionDelayInfo);
+
+                    if (Convert.ToInt32(scenefunction.delay) > 0)
                     {
-                        MainPage.Log($"load SceneFunctionInfoEditPage error : {ex.Message}");
+                        btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText();
                     }
-                };
+                    else
+                    {
+                        btnFunctionDelayInfo.Text = Language.StringByID(StringId.NoDelay);
+                    }
 
-                btnFunctionName.MouseUpEventHandler = skipEvent;
-                btnFunctionFloorAndRoom.MouseUpEventHandler = skipEvent;
+                    var btnFunctionFloorAndRoom = new Button()
+                    {
+                        X = Application.GetRealWidth(16),
+                        Y = Application.GetRealWidth(24),
+                        Height = Application.GetRealWidth(41),
+                        TextAlignment = TextAlignment.CenterLeft,
+                        TextColor = CSS_Color.PromptingColor1,
+                        TextSize = CSS_FontSize.TextFontSize,
+                        Text = scenefunction.localFunction.GetRoomListName(),
+                    };
+                    row.AddChidren(btnFunctionFloorAndRoom);
+                    EventHandler<MouseEventArgs> skipEvent = (sender, e) =>
+                    {
+                        try
+                        {
+                            var ssf = new SceneFunctionInfoEditPage(scene, scenefunction.localFunction.ConvertSceneFunction(), refreshFunctionRowAction);
+                            MainPage.BasePageView.AddChidren(ssf);
+                            ssf.LoadPage();
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        }
+                        catch (Exception ex)
+                        {
+                            MainPage.Log($"load SceneFunctionInfoEditPage error : {ex.Message}");
+                        }
+                    };
+
+                    btnFunctionName.MouseUpEventHandler = skipEvent;
+                    btnFunctionFloorAndRoom.MouseUpEventHandler = skipEvent;
+                }
 
                 Button btnDelSceneFunction = new Button()
                 {
@@ -508,93 +531,111 @@
         string GetFunctionScnenInfo(SceneFunction sceneFunction)
         {
             var sceneFunctionInfo = "";
-            foreach (var sfs in sceneFunction.status)
+            if (sceneFunction.type == "7")
             {
-                if (sfs.key == FunctionAttributeKey.OnOff)
+                foreach (var sfs in sceneFunction.status)
                 {
-                    if (sfs.value == "off")
-                        return Language.StringByID(StringId.Close);
-                }
-            }
-
-            sceneFunctionInfo += Language.StringByID(StringId.Open);
-
-            var modeState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Mode);
-            var tempState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp);
-            var fanState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed);
-            if (modeState != null)
-            {
-                sceneFunctionInfo += modeState.GetValueText();
-            }
-            if (tempState != null)
-            {
-                sceneFunctionInfo += tempState.GetValueText();
-                sceneFunctionInfo += tempState.GetUintString();
-            }
-            if (fanState != null)
-            {
-                sceneFunctionInfo += fanState.GetValueText();
-            }
-            var briState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness);
-            if (briState != null)
-            {
-                sceneFunctionInfo += " " + briState.value + "%";
-            }
-            var perState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent);
-            if (perState != null)
-            {
-                sceneFunctionInfo += " " + perState.value + "%";
-            }
-            var perAngle = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Angle);
-            if (perAngle != null)
-            {
-                sceneFunctionInfo += " "+ perAngle.value + "掳";
-            }
-
-            var perColorful = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful);
-            if(perColorful != null)
-            {
-                if (perColorful.value == "on")
-                {
-                    sceneFunctionInfo += " " + Language.StringByID(StringId.HorseRaceLamp);
-                }
-                else
-                {
-                    if (sceneFunction.localFunction.spk == SPK.GroupControl)
+                    if (sfs.key == "enable")
                     {
-                        sceneFunctionInfo += " " + Language.StringByID(StringId.Close) + " " + Language.StringByID(StringId.HorseRaceLamp);
+                        if (sfs.value == "true")
+                            return Language.StringByID(StringId.OpenArm);
+                        else
+                        {
+                            return Language.StringByID(StringId.Close);
+                        }
+                    }
+                }
+            }
+            else
+            {
+                foreach (var sfs in sceneFunction.status)
+                {
+                    if (sfs.key == FunctionAttributeKey.OnOff)
+                    {
+                        if (sfs.value == "off")
+                            return Language.StringByID(StringId.Close);
+                    }
+                }
+
+                sceneFunctionInfo += Language.StringByID(StringId.Open);
+
+                var modeState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Mode);
+                var tempState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp);
+                var fanState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed);
+                if (modeState != null)
+                {
+                    sceneFunctionInfo += modeState.GetValueText();
+                }
+                if (tempState != null)
+                {
+                    sceneFunctionInfo += tempState.GetValueText();
+                    sceneFunctionInfo += tempState.GetUintString();
+                }
+                if (fanState != null)
+                {
+                    sceneFunctionInfo += fanState.GetValueText();
+                }
+                var briState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness);
+                if (briState != null)
+                {
+                    sceneFunctionInfo += " " + briState.value + "%";
+                }
+                var perState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent);
+                if (perState != null)
+                {
+                    sceneFunctionInfo += " " + perState.value + "%";
+                }
+                var perAngle = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Angle);
+                if (perAngle != null)
+                {
+                    sceneFunctionInfo += " " + perAngle.value + "掳";
+                }
+
+                var perColorful = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful);
+                if (perColorful != null)
+                {
+                    if (perColorful.value == "on")
+                    {
+                        sceneFunctionInfo += " " + Language.StringByID(StringId.HorseRaceLamp);
                     }
                     else
                     {
-                        sceneFunctionInfo = Language.StringByID(StringId.Close) + " " + Language.StringByID(StringId.HorseRaceLamp);
+                        if (sceneFunction.localFunction.spk == SPK.GroupControl)
+                        {
+                            sceneFunctionInfo += " " + Language.StringByID(StringId.Close) + " " + Language.StringByID(StringId.HorseRaceLamp);
+                        }
+                        else
+                        {
+                            sceneFunctionInfo = Language.StringByID(StringId.Close) + " " + Language.StringByID(StringId.HorseRaceLamp);
+                        }
                     }
                 }
-            }
 
-            var perSetVolume = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetVolume);
-            if (perSetVolume != null)
-            {
-                sceneFunctionInfo += " " + perSetVolume.value ;
-            }
+                var perSetVolume = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetVolume);
+                if (perSetVolume != null)
+                {
+                    sceneFunctionInfo += " " + perSetVolume.value;
+                }
 
-            var perSignal = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Signal);
-            if (perSignal != null)
-            {
-                var p = new HDL_ON.UI.UI2.Intelligence.Automation.PublicInterface();
-                string key = p.GetKey(p.GetHisenseSignalSourceDic(), perSignal.value);
-                sceneFunctionInfo += " " + key;
-            }
+                var perSignal = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Signal);
+                if (perSignal != null)
+                {
+                    var p = new HDL_ON.UI.UI2.Intelligence.Automation.PublicInterface();
+                    string key = p.GetKey(p.GetHisenseSignalSourceDic(), perSignal.value);
+                    sceneFunctionInfo += " " + key;
+                }
 
-            var perVolume = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Volume);
-            if (perVolume != null)
-            {
-                sceneFunctionInfo += " " + perVolume.value;
-            }
+                var perVolume = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Volume);
+                if (perVolume != null)
+                {
+                    sceneFunctionInfo += " " + perVolume.value;
+                }
 
-            var perSongName = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SongName);
-            if (perSongName != null)
-            {
-                sceneFunctionInfo += " " + perSongName.value;
+                var perSongName = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SongName);
+                if (perSongName != null)
+                {
+                    sceneFunctionInfo += " " + perSongName.value;
+                }
             }
             return sceneFunctionInfo;
         }
@@ -687,6 +728,116 @@
         }
 
 
+
+        /// <summary>
+        /// 鍔犺浇鑷姩鍖栭厤缃脊绐�
+        /// </summary>
+        void LoadAutomationSettingDialog(SceneFunction temp,Button btnTipText)
+        {
+            Dialog dialog = new Dialog();
+
+            var pView = new FrameLayout()
+            {
+                BackgroundColor = CSS_Color.DialogTransparentColor1,
+            };
+            dialog.AddChidren(pView);
+
+            var optionBaseView = new FrameLayout()
+            {
+                Y = Application.GetRealHeight(500),
+                Height = Application.GetRealHeight(160),
+                AnimateSpeed = 0.3f,
+                Animate = Animate.DownToUp,
+            };
+            pView.AddChidren(optionBaseView);
+
+            var optionView = new VerticalScrolViewLayout()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Width = Application.GetRealWidth(343),
+                Height = Application.GetRealHeight(100),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+                Radius = (uint)Application.GetRealWidth(12),
+                ScrollEnabled = false,
+            };
+            optionBaseView.AddChidren(optionView);
+
+            var btnOn = new Button()
+            {
+                Height = Application.GetRealHeight(50),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.TextualColor,
+                SelectedTextColor = CSS_Color.MainColor,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextID = StringId.OpenArm,
+            };
+            optionView.AddChidren(btnOn);
+
+            optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor });
+
+            var btnOff = new Button()
+            {
+                Height = Application.GetRealHeight(50),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.TextualColor,
+                SelectedTextColor = CSS_Color.MainColor,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextID = StringId.Close,
+            };
+            optionView.AddChidren(btnOff);
+
+            var btnCancel = new Button()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Y = Application.GetRealHeight(8) + optionView.Bottom,
+                Width = Application.GetRealWidth(343),
+                Height = Application.GetRealHeight(50),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+                Radius = (uint)Application.GetRealWidth(12),
+                TextID = StringId.Cancel,
+                TextColor = CSS_Color.WarningColor,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+            };
+            optionBaseView.AddChidren(btnCancel);
+
+            dialog.Show();
+
+            pView.MouseUpEventHandler = (sender, e) =>
+            {
+                dialog.Close();
+            };
+
+            btnCancel.MouseUpEventHandler = (sender, e) =>
+            {
+                dialog.Close();
+            };
+            btnOn.MouseUpEventHandler = (sender, e) =>
+            {
+                dialog.Close();
+                temp = new SceneFunction();
+                temp.type = "7";
+                temp.status.Add(new SceneFunctionStatus()
+                {
+                    key = "enable",
+                    value = "true"
+                });
+                btnTipText.TextID = StringId.OpenArm;
+            };
+            btnOff.MouseUpEventHandler = (sender, e) =>
+            {
+                dialog.Close();
+                temp = new SceneFunction();
+                temp.type = "7";
+                temp.status.Add(new SceneFunctionStatus()
+                {
+                    key = "enable",
+                    value = "false"
+                });
+                btnTipText.TextID = StringId.Close;
+            };
+
+        }
+
     }
     //--------------------------------------
     public partial class SceneAddPage
@@ -727,7 +878,8 @@
         void LoadEvent_ChangeFunctionList()
         {
             btnAddFunctionTitle.MouseUpEventHandler = (sender, e) => {
-                var sefp = new SceneFunctionListChoosePage(scene, refreshFunctionRowAction);
+                //var sefp = new SceneFunctionListChoosePage(scene, refreshFunctionRowAction);
+                var sefp = new SceneTargetTypeChoosePage(scene, refreshFunctionRowAction);
                 MainPage.BasePageView.AddChidren(sefp);
                 sefp.LoadPage();
                 MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAutomationListChoosePage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAutomationListChoosePage.cs
new file mode 100644
index 0000000..47b80df
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAutomationListChoosePage.cs
@@ -0,0 +1,239 @@
+锘縰sing System;
+using System.Collections.Generic;
+using HDL_ON.Entity;
+using HDL_ON.UI.CSS;
+using HDL_ON.UI.UI2.Intelligence.Automation;
+using Shared;
+
+namespace HDL_ON.UI
+{
+    public class SceneAutomationListChoosePage : FrameLayout
+    {
+        FrameLayout bodyView;
+        Scene scene;
+        Action refreshAction;
+        List<Logic> addedList = new List<Logic>();
+
+        public SceneAutomationListChoosePage(Scene function, Action action)
+        {
+            scene = function;
+            bodyView = this;
+            refreshAction = action;
+            refreshAction += () => {
+                this.RemoveFromParent();
+            };
+        }
+
+        public void LoadPage()
+        {
+            this.bodyView.BackgroundColor = CSS_Color.MainBackgroundColor;
+            var topView = new TopViewDiv(bodyView,Language.StringByID( StringId.SelectAutomation));
+            topView.maginY = 10;
+            topView.LoadTopView();
+
+            var contentView = new VerticalScrolViewLayout()
+            {
+                Y = Application.GetRealHeight(74),
+                Height = Application.GetRealHeight(667-80),
+            };
+            bodyView.AddChidren(contentView);
+
+
+            foreach (var logic in Logic.LogicList)
+            {
+               
+
+                var funtionView = new FrameLayout()
+                {
+                    Height = Application.GetRealHeight(50),
+                };
+                contentView.AddChidren(funtionView);
+
+                Button btnRight = new Button()
+                {
+                    X = Application.GetRealWidth(339),
+                    Gravity = Gravity.CenterVertical,
+                    Width = Application.GetMinRealAverage(16),
+                    Height = Application.GetMinRealAverage(16),
+                    UnSelectedImagePath = "Public/Right.png",
+                };
+                funtionView.AddChidren(btnRight);
+
+
+                if (scene.functions.Find((obj) => obj.sid == logic.sid) != null)
+                {
+                    addedList.Add(logic); var btnTipAdded = new Button()
+                    {
+                        Width = Application.GetRealWidth(327),
+                        TextAlignment = TextAlignment.CenterRight,
+                        TextColor = CSS_Color.MainColor,
+                        TextSize = CSS_FontSize.TextFontSize,
+                        TextID = StringId.Added
+                    };
+                    funtionView.AddChidren(btnTipAdded);
+                    addedList.Add(logic);
+                }
+
+                var btnFunctionTitle = new Button()
+                {
+                    X = Application.GetRealWidth(16),
+                    Width = Application.GetRealWidth(220),
+                    TextAlignment = TextAlignment.CenterLeft,
+                    TextColor = CSS_Color.FirstLevelTitleColor,
+                    TextSize = CSS_FontSize.SubheadingFontSize,
+                    Text = logic.name
+                };
+                funtionView.AddChidren(btnFunctionTitle);
+
+                var btnClick = new Button()
+                {
+                    X = Application.GetRealWidth(300),
+                    Width = Application.GetRealWidth(70),
+                };
+                funtionView.AddChidren(btnClick);
+                btnClick.MouseUpEventHandler = (sender, e) =>
+                {
+                    LoadEditDialog_OnOff(logic.sid);
+                };
+
+                contentView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor });
+
+            }
+
+
+        }
+
+
+        /// <summary>
+        /// 鍔犺浇鑷姩鍖栭厤缃脊绐�
+        /// </summary>
+        void LoadEditDialog_OnOff(string logicSid)
+        {
+            Dialog dialog = new Dialog();
+
+            var pView = new FrameLayout()
+            {
+                BackgroundColor = CSS_Color.DialogTransparentColor1,
+            };
+            dialog.AddChidren(pView);
+
+            var optionBaseView = new FrameLayout()
+            {
+                Y = Application.GetRealHeight(500),
+                Height = Application.GetRealHeight(160),
+                AnimateSpeed = 0.3f,
+                Animate = Animate.DownToUp,
+            };
+            pView.AddChidren(optionBaseView);
+
+            var optionView = new VerticalScrolViewLayout()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Width = Application.GetRealWidth(343),
+                Height = Application.GetRealHeight(100),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+                Radius = (uint)Application.GetRealWidth(12),
+                ScrollEnabled = false,
+            };
+            optionBaseView.AddChidren(optionView);
+
+            var btnOn = new Button()
+            {
+                Height = Application.GetRealHeight(50),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.TextualColor,
+                SelectedTextColor = CSS_Color.MainColor,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextID = StringId.OpenArm,
+            };
+            optionView.AddChidren(btnOn);
+
+            optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor });
+
+            var btnOff = new Button()
+            {
+                Height = Application.GetRealHeight(50),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.TextualColor,
+                SelectedTextColor = CSS_Color.MainColor,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextID = StringId.Close,
+            };
+            optionView.AddChidren(btnOff);
+
+            var btnCancel = new Button()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Y = Application.GetRealHeight(8) + optionView.Bottom,
+                Width = Application.GetRealWidth(343),
+                Height = Application.GetRealHeight(50),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+                Radius = (uint)Application.GetRealWidth(12),
+                TextID = StringId.Cancel,
+                TextColor = CSS_Color.WarningColor,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+            };
+            optionBaseView.AddChidren(btnCancel);
+
+            dialog.Show();
+
+            pView.MouseUpEventHandler = (sender, e) =>
+            {
+                dialog.Close();
+            };
+
+            btnCancel.MouseUpEventHandler = (sender, e) =>
+            {
+                dialog.Close();
+            };
+            btnOn.MouseUpEventHandler = (sender, e) =>
+            {
+                dialog.Close();
+                var temp = scene.functions.Find((obj) => obj.sid == logicSid);
+                if (temp != null)
+                {
+                    temp.status.Clear();
+                }
+                else
+                {
+                    temp = new SceneFunction();
+                    temp.type = "7";
+                    temp.sid = logicSid;
+                    scene.functions.Add(temp);
+                }
+                temp.status.Add(new SceneFunctionStatus()
+                {
+                    key = "enable",
+                    value = "true"
+                });
+                refreshAction();
+            };
+            btnOff.MouseUpEventHandler = (sender, e) =>
+            {
+                dialog.Close();
+                var temp = scene.functions.Find((obj) => obj.sid == logicSid);
+                if (temp != null)
+                {
+                    temp.status.Clear();
+                }
+                else
+                {
+                    temp = new SceneFunction();
+                    temp.type = "7";
+                    temp.sid = logicSid;
+                    scene.functions.Add(temp);
+                }
+                temp.status.Add(new SceneFunctionStatus()
+                {
+                    key = "enable",
+                    value = "false"
+                });
+                refreshAction();
+            };
+
+        }
+
+
+    }
+}
+
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
index 4373932..40589b1 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
@@ -98,8 +98,10 @@
 
         public void LoadPage(Action backRefresh)
         {
-             //DB_ResidenceData.Instance.sceneChooseRoomId
-            new TopViewDiv(bodyView, Language.StringByID(StringId.EditScene)).LoadTopView(backRefresh);
+            var topView = new TopViewDiv(bodyView, Language.StringByID(StringId.EditScene));
+            topView.maginY = 10;
+            topView.LoadTopView(backRefresh);
+
             initPage();
         }
 
@@ -109,8 +111,8 @@
 
             VerticalScrolViewLayout contentView = new VerticalScrolViewLayout()
             {
-                Y = Application.GetRealHeight(64),
-                Height = Application.GetRealHeight(603-50),
+                Y = Application.GetRealHeight(64 + 10),
+                Height = Application.GetRealHeight(603-50-10),
             };
             bodyView.AddChidren(contentView);
             contentView.AddChidren(new Button() { Height = Application.GetRealWidth(12) });
@@ -408,9 +410,9 @@
                 Y = Application.GetRealHeight(667 - 50),
                 Height = Application.GetRealHeight(50),
                 TextAlignment = TextAlignment.Center,
-                TextColor =  CSS_Color.WarningColor,
+                TextColor = CSS_Color.WarningColor,
                 TextSize = CSS_FontSize.SubheadingFontSize,
-                TextID =   StringId.Del,
+                TextID = StringId.Del,
                 BackgroundColor = CSS_Color.MainBackgroundColor,
                 //IsBold = true
             };
@@ -479,7 +481,6 @@
         void LoadFunctionRow()
         {
             functionListView.RemoveAll();
-            functionListView.Height = Application.GetRealWidth(65 * scene.functions.Count);
             for(int i =0;i<scene.functions.Count;)
             {
                 var scenefunction = scene.functions[i];
@@ -488,6 +489,7 @@
                     scene.functions.Remove(scenefunction);
                     continue;
                 }
+                functionListView.Height = Application.GetRealWidth(65 * scene.functions.Count);
                 try
                 {
                     //灏唖pk瀹炰綋閲岄潰鐨刴in max鍊兼斁鍏ュ満鏅姛鑳藉疄浣撻噷锛岃涓嶇劧鏁版嵁浼氫涪澶� 2022-06-21 16:06:45
@@ -552,26 +554,6 @@
                 };
                 row.AddChidren(btnFunctionInfo);
 
-                var btnFunctionDelayInfo = new Button()
-                {
-                    Width = Application.GetRealWidth(327),
-                    Y = Application.GetRealWidth(35),
-                    Height = Application.GetRealWidth(32),
-                    TextAlignment = TextAlignment.TopRight,
-                    TextColor = CSS_Color.PromptingColor1,
-                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                };
-                row.AddChidren(btnFunctionDelayInfo);
-
-                if (!string.IsNullOrEmpty(scenefunction.delay) && Convert.ToInt32( scenefunction.delay) > 0)
-                {
-                    btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText();
-                }
-                else
-                {
-                    btnFunctionDelayInfo.Text = Language.StringByID(StringId.NoDelay);
-                }
-
                 var btnFunctionName = new Button()
                 {
                     X = Application.GetRealWidth(16),
@@ -583,31 +565,72 @@
                 };
                 row.AddChidren(btnFunctionName);
 
-                var btnFunctionFloorAndRoom = new Button()
+                if (scenefunction.type == "7")
                 {
-                    X = Application.GetRealWidth(16),
-                    Y = Application.GetRealWidth(24),
-                    Height = Application.GetRealWidth(41),
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = CSS_Color.PromptingColor1,
-                    TextSize = CSS_FontSize.TextFontSize,
-                    Text = scenefunction.localFunction.GetRoomListName(),
-                };
-                row.AddChidren(btnFunctionFloorAndRoom);
+                    btnFunctionName.Gravity = Gravity.CenterVertical;
+                    btnFunctionInfo.TextAlignment = TextAlignment.CenterRight;
+                    btnFunctionInfo.Gravity = Gravity.CenterVertical;
 
-                EventHandler<MouseEventArgs> skipEvent = (sender, e) =>
+                    btnFunctionName.MouseUpEventHandler = (sender, e) => {
+                        try
+                        {
+                            LoadAutomationSettingDialog(scenefunction, btnFunctionInfo);
+                        }
+                        catch (Exception ex)
+                        {
+                            MainPage.Log($"load automation error : {ex.Message}");
+                        }
+                    };
+                }
+                else
                 {
-                    var ssf = new SceneFunctionInfoEditPage(scene, scenefunction, refreshFunctionRowAction);
-                    MainPage.BasePageView.AddChidren(ssf);
-                    ssf.LoadPage();
-                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-                };
-                btnFunctionName.MouseUpEventHandler = skipEvent;
-                btnFunctionFloorAndRoom.MouseUpEventHandler = skipEvent;
-                btnFunctionDelayInfo.MouseUpEventHandler = skipEvent;
-                btnFunctionInfo.MouseUpEventHandler = skipEvent;
-                btnRight.MouseUpEventHandler = skipEvent;
-                row.MouseUpEventHandler = skipEvent;
+                    var btnFunctionDelayInfo = new Button()
+                    {
+                        Width = Application.GetRealWidth(327),
+                        Y = Application.GetRealWidth(35),
+                        Height = Application.GetRealWidth(32),
+                        TextAlignment = TextAlignment.TopRight,
+                        TextColor = CSS_Color.PromptingColor1,
+                        TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                    };
+                    row.AddChidren(btnFunctionDelayInfo);
+
+                    if (!string.IsNullOrEmpty(scenefunction.delay) && Convert.ToInt32(scenefunction.delay) > 0)
+                    {
+                        btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText();
+                    }
+                    else
+                    {
+                        btnFunctionDelayInfo.Text = Language.StringByID(StringId.NoDelay);
+                    }
+
+
+                    var btnFunctionFloorAndRoom = new Button()
+                    {
+                        X = Application.GetRealWidth(16),
+                        Y = Application.GetRealWidth(24),
+                        Height = Application.GetRealWidth(41),
+                        TextAlignment = TextAlignment.CenterLeft,
+                        TextColor = CSS_Color.PromptingColor1,
+                        TextSize = CSS_FontSize.TextFontSize,
+                        Text = scenefunction.localFunction.GetRoomListName(),
+                    };
+                    row.AddChidren(btnFunctionFloorAndRoom);
+
+                    EventHandler<MouseEventArgs> skipEvent = (sender, e) =>
+                    {
+                        var ssf = new SceneFunctionInfoEditPage(scene, scenefunction, refreshFunctionRowAction);
+                        MainPage.BasePageView.AddChidren(ssf);
+                        ssf.LoadPage();
+                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                    };
+                    btnFunctionName.MouseUpEventHandler = skipEvent;
+                    btnFunctionFloorAndRoom.MouseUpEventHandler = skipEvent;
+                    btnFunctionDelayInfo.MouseUpEventHandler = skipEvent;
+                    btnFunctionInfo.MouseUpEventHandler = skipEvent;
+                    btnRight.MouseUpEventHandler = skipEvent;
+                    row.MouseUpEventHandler = skipEvent;
+                }
 
                 Button btnDelSceneFunction = new Button() {
                     BackgroundColor = CSS_Color.WarningColor,
@@ -712,6 +735,172 @@
         }
 
 
+
+        /// <summary>
+        /// 鍔犺浇鑷姩鍖栭厤缃脊绐�
+        /// </summary>
+        void LoadAutomationSettingDialog(SceneFunction temp, Button btnTipText)
+        {
+            Dialog dialog = new Dialog();
+
+            var pView = new FrameLayout()
+            {
+                BackgroundColor = CSS_Color.DialogTransparentColor1,
+            };
+            dialog.AddChidren(pView);
+
+            var optionBaseView = new FrameLayout()
+            {
+                Y = Application.GetRealHeight(500),
+                Height = Application.GetRealHeight(160),
+                AnimateSpeed = 0.3f,
+                Animate = Animate.DownToUp,
+            };
+            pView.AddChidren(optionBaseView);
+
+            var optionView = new VerticalScrolViewLayout()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Width = Application.GetRealWidth(343),
+                Height = Application.GetRealHeight(100),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+                Radius = (uint)Application.GetRealWidth(12),
+                ScrollEnabled = false,
+            };
+            optionBaseView.AddChidren(optionView);
+
+            var btnOn = new Button()
+            {
+                Height = Application.GetRealHeight(50),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.TextualColor,
+                SelectedTextColor = CSS_Color.MainColor,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextID = StringId.OpenArm,
+            };
+            optionView.AddChidren(btnOn);
+
+            optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor });
+
+            var btnOff = new Button()
+            {
+                Height = Application.GetRealHeight(50),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.TextualColor,
+                SelectedTextColor = CSS_Color.MainColor,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextID = StringId.Close,
+            };
+            optionView.AddChidren(btnOff);
+
+            var btnCancel = new Button()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Y = Application.GetRealHeight(8) + optionView.Bottom,
+                Width = Application.GetRealWidth(343),
+                Height = Application.GetRealHeight(50),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+                Radius = (uint)Application.GetRealWidth(12),
+                TextID = StringId.Cancel,
+                TextColor = CSS_Color.WarningColor,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+            };
+            optionBaseView.AddChidren(btnCancel);
+
+            dialog.Show();
+
+            pView.MouseUpEventHandler = (sender, e) =>
+            {
+                dialog.Close();
+            };
+
+            btnCancel.MouseUpEventHandler = (sender, e) =>
+            {
+                dialog.Close();
+            };
+            btnOn.MouseUpEventHandler = (sender, e) =>
+            {
+                dialog.Close();
+                temp = new SceneFunction();
+                temp.type = "7";
+                temp.status.Add(new SceneFunctionStatus()
+                {
+                    key = "enable",
+                    value = "true"
+                });
+                var waitPage = new Loading();
+                bodyView.AddChidren(waitPage);
+                waitPage.Start("");
+                new System.Threading.Thread(() => {
+                    try
+                    {
+                        var code = scene.EditScene();
+                        Application.RunOnMainThread(() =>
+                        {
+                            if (code == "0")
+                            {
+                                btnTipText.TextID = StringId.OpenArm;
+                            }
+                        });
+                    }
+                    catch { }
+                    finally
+                    {
+                        Application.RunOnMainThread(() => {
+                            if(waitPage!= null)
+                            {
+                                waitPage.RemoveFromParent();
+                                waitPage = null;
+                            }
+                        });
+                    }
+                })
+                { IsBackground = true }.Start();
+            };
+            btnOff.MouseUpEventHandler = (sender, e) =>
+            {
+                dialog.Close();
+                temp = new SceneFunction();
+                temp.type = "7";
+                temp.status.Add(new SceneFunctionStatus()
+                {
+                    key = "enable",
+                    value = "false"
+                });
+
+                var waitPage = new Loading();
+                bodyView.AddChidren(waitPage);
+                waitPage.Start("");
+                new System.Threading.Thread(() => {
+                    try
+                    {
+                        var code = scene.EditScene();
+                        Application.RunOnMainThread(() =>
+                        {
+                            if (code == "0")
+                            {
+                                btnTipText.TextID = StringId.Close;
+                            }
+                        });
+                    }
+                    catch { }
+                    finally
+                    {
+                        Application.RunOnMainThread(() => {
+                            if (waitPage != null)
+                            {
+                                waitPage.RemoveFromParent();
+                                waitPage = null;
+                            }
+                        });
+                    }
+                })
+                { IsBackground = true }.Start();
+            };
+
+        }
+
+
     }
     //--------------------------------------
     public partial class SceneEditPage
@@ -759,7 +948,8 @@
         void LoadEvent_ChangeFunctionList()
         {
             btnAddFunctionTitle.MouseUpEventHandler = (sender, e) => {
-                var sefp =new SceneFunctionListChoosePage(scene,refreshFunctionRowAction);
+                //var sefp =new SceneFunctionListChoosePage(scene,refreshFunctionRowAction);
+                var sefp = new SceneTargetTypeChoosePage(scene, refreshFunctionRowAction);
                 MainPage.BasePageView.AddChidren(sefp);
                 sefp.LoadPage();
                 MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs
index c0f6581..2278e48 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs
@@ -57,14 +57,15 @@
         public void LoadPage()
         {
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
-            new TopViewDiv(bodyView, Language.StringByID(StringId.AddFunction)).LoadTopView();
-            //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.AddFunction));
+            var topView = new TopViewDiv(bodyView, Language.StringByID(StringId.AddFunction));
+            topView.maginY = 10;
+            topView.LoadTopView();
 
             #region 鏄剧ず鐨勫姛鑳界被鍨嬪垏鎹㈠尯鍩�
             showdFunctionTypeRow = new FrameLayout()
             {
-                Y = Application.GetRealHeight(64),
-                Height = Application.GetRealHeight(62),
+                Y = Application.GetRealHeight(64+10),
+                Height = Application.GetRealHeight(50),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
             };
             bodyView.AddChidren(showdFunctionTypeRow);
@@ -93,30 +94,14 @@
             };
             showdFunctionTypeRow.AddChidren(btnFloor);
 
-
-            //btnScreenIcon = new Button()
-            //{
-            //    Width = Application.GetMinRealAverage(16),
-            //    Height = Application.GetMinRealAverage(16),
-            //    X = Application.GetRealWidth(122),
-            //    Y = Application.GetRealHeight(18),
-            //    UnSelectedImagePath = "Public/DownIcon.png",
-            //};
-            //showdFunctionTypeRow.AddChidren(btnScreenIcon);
-
-            //btnScreenText = new Button()
-            //{
-            //    X = btnScreenIcon.Right,
-            //    Y = Application.GetRealHeight(18),
-            //    Width = Application.GetRealWidth(200),
-            //    Height = Application.GetMinRealAverage(16),
-            //    TextColor = CSS_Color.FirstLevelTitleColor,
-            //    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-            //    TextAlignment = TextAlignment.CenterLeft,
-            //    TextID = StringId.Screen
-            //};
-            //showdFunctionTypeRow.AddChidren(btnScreenText);
-
+            showdFunctionTypeRow.AddChidren(new Button()
+            {
+                Y = Application.GetRealHeight(49),
+                Gravity = Gravity.CenterHorizontal,
+                Width = Application.GetRealWidth(343),
+                Height = Application.GetRealWidth(1),
+                BackgroundColor = CSS_Color.DividingLineColor,
+            });
 
             #endregion
 
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneTargetTypeChoosePage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneTargetTypeChoosePage.cs
new file mode 100644
index 0000000..effe348
--- /dev/null
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneTargetTypeChoosePage.cs
@@ -0,0 +1,158 @@
+锘縰sing System;
+using System.Collections.Generic;
+using HDL_ON.Entity;
+using HDL_ON.UI.CSS;
+using Shared;
+
+namespace HDL_ON.UI
+{
+	/// <summary>
+	/// 鍦烘櫙妯℃澘绫诲瀷閫夋嫨鐣岄潰
+	/// 鍔熻兘
+	/// 鑷姩鍖�
+	/// </summary>
+	public class SceneTargetTypeChoosePage : FrameLayout
+	{
+		FrameLayout bodyView;
+        Scene scene;
+        /// <summary>
+        /// 鏇存柊鍔熻兘row
+        /// </summary>
+        Action refreshFunctionRowAction;
+
+        public SceneTargetTypeChoosePage(Scene function, Action action)
+		{
+			bodyView = this;
+            scene = function;
+            refreshFunctionRowAction = () =>
+            {
+                this.RemoveFromParent();
+                action();
+            };
+        }
+
+		public void LoadPage()
+		{
+			bodyView.BackgroundColor = CSS_Color.MainBackgroundColor;
+            bodyView.AddChidren(new Button()
+            {
+                Height = Application.GetRealHeight(20),
+                BackgroundColor = CSS_Color.BackgroundColor
+            });
+            var topView = new TopViewDiv(bodyView,Language.StringByID(StringId.AddExecutionAction));
+            topView.maginY = 10;
+            topView.LoadTopView();
+
+
+            var contentView = new VerticalScrolViewLayout()
+            {
+                Y = Application.GetRealHeight(74),
+                Height = Application.GetRealHeight(530),
+                ScrollEnabled = false,
+            };
+            bodyView.AddChidren(contentView);
+
+			var funtionView = new FrameLayout()
+			{
+				Height = Application.GetRealHeight(50),
+			};
+			contentView.AddChidren(funtionView);
+
+
+            var btnFunctionIcon = new Button()
+            {
+                Gravity = Gravity.CenterVertical,
+                X = Application.GetRealWidth(16),
+                Width = Application.GetMinRealAverage(22),
+                Height = Application.GetMinRealAverage(22),
+                UnSelectedImagePath = "Navigation/ClassificationIcon.png",
+            };
+            funtionView.AddChidren(btnFunctionIcon);
+
+            var btnFunctionRight = new Button()
+            {
+                X = Application.GetRealWidth(339),
+                Gravity = Gravity.CenterVertical,
+                Width = Application.GetMinRealAverage(16),
+                Height = Application.GetMinRealAverage(16),
+                UnSelectedImagePath = "Public/Right.png",
+            };
+            funtionView.AddChidren(btnFunctionRight);
+
+			var btnFunctionTitle = new Button()
+			{
+                X = Application.GetRealWidth(50),
+                TextAlignment = TextAlignment.CenterLeft,
+                TextColor = CSS_Color.FirstLevelTitleColor,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextID = StringId.Functions,
+            };
+            funtionView.AddChidren(btnFunctionTitle);
+
+            btnFunctionTitle.MouseUpEventHandler = (sender, e) => {
+
+                refreshFunctionRowAction += () => {
+                    this.RemoveFromParent();
+                };
+                var sefp = new SceneFunctionListChoosePage(scene, refreshFunctionRowAction);
+                MainPage.BasePageView.AddChidren(sefp);
+                sefp.LoadPage();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
+
+            contentView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor });
+
+            var automationView = new FrameLayout()
+            {
+                Height = Application.GetRealHeight(50),
+            };
+            contentView.AddChidren(automationView);
+
+
+            var btnAutomationRight = new Button()
+            {
+                X = Application.GetRealWidth(339),
+                Gravity = Gravity.CenterVertical,
+                Width = Application.GetMinRealAverage(16),
+                Height = Application.GetMinRealAverage(16),
+                UnSelectedImagePath = "Public/Right.png",
+            };
+            automationView.AddChidren(btnAutomationRight);
+            var btnAutomationIcon = new Button()
+            {
+                Gravity = Gravity.CenterVertical,
+                X = Application.GetRealWidth(16),
+                Width = Application.GetMinRealAverage(22),
+                Height = Application.GetMinRealAverage(22),
+                UnSelectedImagePath = "Navigation/IntellectualizationIcon.png",
+            };
+            automationView.AddChidren(btnAutomationIcon);
+
+            var btnAutomationTitle = new Button()
+            {
+                X = Application.GetRealWidth(50),
+                TextAlignment = TextAlignment.CenterLeft,
+                TextColor = CSS_Color.FirstLevelTitleColor,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextID = StringId.Automation,
+            };
+            automationView.AddChidren(btnAutomationTitle);
+
+            btnAutomationTitle.MouseUpEventHandler = (sender, e) => {
+
+                refreshFunctionRowAction += () => {
+                    this.RemoveFromParent();
+                };
+
+                var sefp = new SceneAutomationListChoosePage(scene, refreshFunctionRowAction);
+                MainPage.BasePageView.AddChidren(sefp);
+                sefp.LoadPage();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
+
+
+            contentView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor });
+        }
+    }
+}
+
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
index 4713ac2..08820bd 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
@@ -53,12 +53,14 @@
         {
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
 
-            new TopViewDiv(bodyView, sceneFunction.localFunction.name).LoadTopView();
+            var topView = new TopViewDiv(bodyView, sceneFunction.localFunction.name);
+            topView.maginY = 10;
+            topView.LoadTopView();
 
             contentView = new VerticalScrolViewLayout()
             {
-                Y = Application.GetRealHeight(64),
-                Height = Application.GetRealHeight(520),
+                Y = Application.GetRealHeight(64 + 10),
+                Height = Application.GetRealHeight(510),
                 ScrollEnabled = false,
             };
             bodyView.AddChidren(contentView);

--
Gitblit v1.8.0