From acc8caee31c4be90bd38d1af18136b0e84f6fe94 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期五, 27 九月 2024 14:01:19 +0800
Subject: [PATCH] Merge branch 'feature/v2.7_迭代' into feature/V2.7_Google

---
 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs |   48 ++++++++++++++++++++++++++++++++----------------
 1 files changed, 32 insertions(+), 16 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
index c4219e2..67643d3 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
@@ -279,11 +279,6 @@
                         scene.delay = obj;
                         btnSceneDelayInfo.Text = scene.GetDelayText();
                     };
-                    Dictionary<string, string> items = new Dictionary<string, string>();
-                    items.Add("30", "30s");
-                    items.Add("60", "1min");
-                    items.Add("120", "2min");
-                    items.Add("300", "5min");
                     new PublicAssmebly().SetSceneDelayDialog( action ,scene.delay);
 
 
@@ -467,13 +462,23 @@
                     };
                     row.AddChidren(btnFunctionDelayInfo);
 
-                    if (Convert.ToInt32(scenefunction.delay) > 0)
+                    try
                     {
-                        btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText();
+                        int delayTime = 0;
+                        int.TryParse(scenefunction.delay, out delayTime);
+
+                        if (!string.IsNullOrEmpty(scenefunction.delay) && delayTime > 0)
+                        {
+                            btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText();
+                        }
+                        else
+                        {
+                            btnFunctionDelayInfo.Text = Language.StringByID(StringId.NoDelay);
+                        }
                     }
-                    else
+                    catch (Exception ex)
                     {
-                        btnFunctionDelayInfo.Text = Language.StringByID(StringId.NoDelay);
+                        MainPage.Log("Error", $"鍦烘櫙缂栬緫锛岃浆璇戞暟鎹紓甯革細{ex.StackTrace}");
                     }
 
                     var btnFunctionFloorAndRoom = new Button()
@@ -878,11 +883,22 @@
         void LoadEvent_ChangeFunctionList()
         {
             btnAddFunctionTitle.MouseUpEventHandler = (sender, e) => {
-                //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;
+                if (DB_ResidenceData.Instance.HomeGateway.isSupportSceneEnableAutomation)
+                {
+                    //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;
+                }
+                else
+                {
+                    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;
+                }
             };
         }
 
@@ -927,7 +943,7 @@
                 {
                     CropImageCallBack(imagePath);
 
-                }, imageName, 4, 3);
+                }, imageName, 4, 3, 0);
 
                 //}
                 pictureOptionView.Parent.RemoveFromParent();
@@ -946,7 +962,7 @@
                 CropImage.SelectPicture((imagePath) =>
                 {
                     CropImageCallBack(imagePath);
-                }, imageName, 4, 3);
+                }, imageName, 4, 3,0);
 
 
                 //if (pageTitleId == StringId.EditScene)

--
Gitblit v1.8.0