From e209b6a3cebceb656d60d0724f55c6690ec39129 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期四, 12 十月 2023 13:09:44 +0800
Subject: [PATCH] 2023年10月12日13:09:30
---
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs | 65 +++++++++++++++++++++++++++-----
1 files changed, 54 insertions(+), 11 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
index 49e93b2..4373932 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
@@ -98,6 +98,7 @@
public void LoadPage(Action backRefresh)
{
+ //DB_ResidenceData.Instance.sceneChooseRoomId
new TopViewDiv(bodyView, Language.StringByID(StringId.EditScene)).LoadTopView(backRefresh);
initPage();
}
@@ -432,14 +433,20 @@
var pack = pm.GetSceneInfo(scene.userSceneId);
if (pack.Code == StateCode.SUCCESS)
{
- var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString());
- var tempScene = sceneList.Find((obj) => obj.userSceneId == scene.userSceneId);
- if (tempScene != null)
+ if (pack.Data != null)
{
- scene.name = tempScene.name;
- scene.delay = tempScene.delay;
- scene.roomIds = tempScene.roomIds;
- scene.functions = tempScene.functions;
+ var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString());
+ if (sceneList != null)
+ {
+ var tempScene = sceneList.Find((obj) => obj.userSceneId == scene.userSceneId);
+ if (tempScene != null)
+ {
+ scene.name = tempScene.name;
+ scene.delay = tempScene.delay;
+ scene.roomIds = tempScene.roomIds;
+ scene.functions = tempScene.functions;
+ }
+ }
}
Application.RunOnMainThread(() =>
{
@@ -481,6 +488,33 @@
scene.functions.Remove(scenefunction);
continue;
}
+ try
+ {
+ //灏唖pk瀹炰綋閲岄潰鐨刴in max鍊兼斁鍏ュ満鏅姛鑳藉疄浣撻噷锛岃涓嶇劧鏁版嵁浼氫涪澶� 2022-06-21 16:06:45
+ foreach (var tt in scenefunction.status)
+ {
+ var attr = scenefunction.localFunction.GetAttribute(tt.key);
+ if(attr == null)
+ {
+ continue;
+ }
+ tt.min = attr.min;
+ tt.max = attr.max;
+ tt.valueList = attr.value;
+ if(tt.key == FunctionAttributeKey.SetTemp)
+ {
+ var tempType = scenefunction.localFunction.GetAttribute(FunctionAttributeKey.TempType);
+ if(tempType != null)
+ {
+ tt.UintString = tempType.unit;
+ }
+ }
+ }
+ }catch(Exception ex)
+ {
+ MainPage.Log($"鍦烘櫙鍔犺浇鍔熻兘鍒楄〃寮傚父:{ex.Message}");
+ }
+
i++;
var row = new RowLayout()
{
@@ -563,14 +597,17 @@
EventHandler<MouseEventArgs> skipEvent = (sender, e) =>
{
- var ssf = new SceneFunctionInfoEditPage(scene, scenefunction.localFunction.ConvertSceneFunction(), refreshFunctionRowAction);
+ 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,
@@ -842,6 +879,12 @@
UploadImage(selectImagePath, addSceneImageView, scene, uploadSuccessAction);
}
+ public override void RemoveFromParent()
+ {
+ backAction();
+ base.RemoveFromParent();
+ }
+
/// <summary>
/// 瀹屾垚鎸夐挳鐐瑰嚮浜嬩欢
/// </summary>
@@ -871,7 +914,7 @@
}
scene.EditScene();
FunctionList.List.scenes.Add(scene);
- backAction();
+ //backAction();
this.RemoveFromParent();
}
if (btnComplete.TextID == StringId.Del)
@@ -879,7 +922,7 @@
Action action = () =>
{
FunctionList.List.DeleteScene(scene,true);
- backAction();
+ //backAction();
this.RemoveFromParent();
};
new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.DeleteSceneTip, action);
--
Gitblit v1.8.0