From 4f2dbd1f6a1ec2d9c3c39b4a37b0b7c9ddece4aa Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期四, 23 九月 2021 15:24:01 +0800 Subject: [PATCH] 主页刷新优化 --- HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 137 ++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 134 insertions(+), 3 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs index 9da0de8..9c69d90 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs @@ -49,6 +49,7 @@ LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp)); break; case FunctionAttributeKey.Mode: + LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Mode)); break; case FunctionAttributeKey.FanSpeed: @@ -138,6 +139,7 @@ // } // catch { } //} + if (temp != null) { temp = sceneFunction; @@ -182,9 +184,18 @@ BackgroundColor = CSS_Color.MainBackgroundColor, }; contentView.AddChidren(row); + + if (sceneStatus.key != FunctionAttributeKey.OnOff) { row.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); + } + else + { + if(sceneStatus.value == "stop") + { + sceneStatus.value = "on"; + } } Button btnRight = new Button() { @@ -196,21 +207,82 @@ }; row.AddChidren(btnRight); + + var showCode = ""; + + if (sceneStatus.key == FunctionAttributeKey.Mode) + { + if (DB_ResidenceData.Instance.GatewayType == 0) + { + if (SPK.AcSpkList().Contains(sceneFunction.localFunction.spk)) + { + //0 鍒跺喎1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍 + switch (sceneStatus.value) + { + case "0": + showCode = "cool"; + break; + case "1": + showCode = "heat"; + break; + case "2": + showCode = "fan"; + break; + case "3": + showCode = "auto"; + break; + case "4": + showCode = "dry"; + break; + } + } + else if (SPK.FhSpkList().Contains(sceneFunction.localFunction.spk)) + { + //1:鏅��,2:鐧藉ぉ,3:澶滄櫄,4:绂诲紑,5:鏃堕棿 + switch (sceneStatus.value) + { + case "5": + showCode = "timer"; + break; + case "1": + showCode = "normal"; + break; + case "2": + showCode = "day"; + break; + case "3": + showCode = "night"; + break; + case "4": + showCode = "away"; + break; + } + } + } + } + var btnFunctionText = new Button() { Width = Application.GetRealWidth(330), TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - Text = sceneStatus.GetValueText() + sceneStatus.GetUintString() + Text = sceneStatus.GetValueText(showCode) + sceneStatus.GetUintString() }; row.AddChidren(btnFunctionText); + + + if (sceneStatus.key == FunctionAttributeKey.OnOff) { btnOnText = btnFunctionText; } else if (sceneStatus.key == FunctionAttributeKey.Brightness || sceneStatus.key == FunctionAttributeKey.Percent) { + int outT = 0; + int.TryParse(sceneStatus.value, out outT); + if (outT < 0) + sceneStatus.value = "0"; btnBrightnessText = btnFunctionText; } @@ -325,7 +397,7 @@ items.Add("60", "1min"); items.Add("120", "2min"); items.Add("300", "5min"); - new PublicAssmebly().SetSceneDelayDialog(items,action,sceneFunction.delay); + new PublicAssmebly().SetSceneDelayDialog(action, sceneFunction.delay); }; #endregion @@ -887,6 +959,65 @@ var lastText = ""; Dialog dialog = new Dialog(); + if(DB_ResidenceData.Instance.GatewayType == 0) + { + if (SPK.AcSpkList().Contains(sceneFunction.localFunction.spk)) + { + //0 鍒跺喎1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍 + for (int i = 0; i < statusList.Count; i++) + { + if (statusList[i] == "0") + { + statusList[i] = "cool"; + } + else if (statusList[i] == "1") + { + statusList[i] = "heat"; + } + else if (statusList[i] == "2") + { + statusList[i] = "fan"; + } + else if (statusList[i] == "3") + { + statusList[i] = "auto"; + } + else if (statusList[i] == "4") + { + statusList[i] = "dry"; + } + } + } + else if (SPK.FhSpkList().Contains(sceneFunction.localFunction.spk)) + { + //1:鏅��,2:鐧藉ぉ,3:澶滄櫄,4:绂诲紑,5:鏃堕棿 + for (int i = 0; i < statusList.Count; i++) + { + if (statusList[i] == "5") + { + statusList[i] = "timer"; + } + else if (statusList[i] == "1") + { + statusList[i] = "normal"; + } + else if (statusList[i] == "2") + { + statusList[i] = "day"; + } + else if (statusList[i] == "3") + { + statusList[i] = "night"; + } + else if (statusList[i] == "4") + { + statusList[i] = "away"; + } + } + + } + } + var pView = new FrameLayout() { BackgroundColor = CSS_Color.DialogTransparentColor1, @@ -993,7 +1124,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.TextFontSize, Tag = m, - Text = trait.GetValueText() + Text = trait.GetValueText(m) }; row.AddChidren(btnPropertyTitle); -- Gitblit v1.8.0