From 43b0d5870d528f23ecd6aeceb6cfd4325188b46f Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 01 七月 2021 15:50:43 +0800 Subject: [PATCH] Revert "1" --- HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 50 ++++++++++++++++++++++++++++++-------------------- 1 files changed, 30 insertions(+), 20 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs index 173cb69..ff17320 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs @@ -138,6 +138,7 @@ // } // catch { } //} + if (temp != null) { temp = sceneFunction; @@ -182,9 +183,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() { @@ -202,7 +212,7 @@ TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - Text = FunctionList.List.GetValueText(sceneStatus.key,sceneStatus.value) + FunctionList.List.GetUintString(sceneStatus.key) + Text = sceneStatus.GetValueText() + sceneStatus.GetUintString() }; row.AddChidren(btnFunctionText); if (sceneStatus.key == FunctionAttributeKey.OnOff) @@ -220,7 +230,7 @@ TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.SubheadingFontSize, - Text = FunctionList.List.GetNameText(sceneStatus.key) + Text = sceneStatus.GetNameText() }; row.AddChidren(btnFunctionName); btnFunctionName.MouseUpEventHandler = (sender, e) => @@ -300,7 +310,7 @@ TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - Text = FunctionList.List.GetDelayText( sceneFunction.delay) + Text = new Scene() { delay = sceneFunction.delay }.GetDelayText() }; delayRow.AddChidren(btnDelayInfo); @@ -318,14 +328,14 @@ btnSceneDelayTitle.MouseUpEventHandler = (sender, e) => { Action<string> action = (obj) => { sceneFunction.delay = obj; - btnDelayInfo.Text = FunctionList.List.GetDelayText(obj); + btnDelayInfo.Text = new Scene() { delay = sceneFunction.delay }.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(items,action,sceneFunction.delay); + new PublicAssmebly().SetSceneDelayDialog(action, sceneFunction.delay); }; #endregion @@ -423,7 +433,7 @@ dialog.Close(); trait.value = "on"; sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "on"; - btn.Text = FunctionList.List.GetValueText(trait.key, trait.value) + FunctionList.List.GetUintString(trait.key); + btn.Text = trait.GetValueText() + trait.GetUintString(); var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); if (temp == null) @@ -436,14 +446,14 @@ { temp.value = "100"; } - btnBrightnessText.Text = FunctionList.List.GetValueText(temp.key, temp.value) + "%"; + btnBrightnessText.Text = temp.GetValueText() + "%"; } }; btnOff.MouseUpEventHandler = (sender,e) =>{ dialog.Close(); trait.value = "off"; sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "off"; - btn.Text= FunctionList.List.GetValueText(trait.key,trait.value) + FunctionList.List.GetUintString(trait.key); + btn.Text= trait.GetValueText() + trait.GetUintString(); var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); if(temp == null) @@ -456,7 +466,7 @@ { temp.value = "0"; } - btnBrightnessText.Text = FunctionList.List.GetValueText(temp.key, temp.value) + "%"; + btnBrightnessText.Text = temp.GetValueText() + "%"; } }; @@ -540,16 +550,16 @@ }; for (int i = 16; i <= 32; i += 1) { - pickerItems.Add(i.ToString() + FunctionList.List.GetUintString(trait.key)); + pickerItems.Add(i.ToString() + trait.GetUintString()); } uIPickerView.setNPicker(pickerItems, null, null); optionBaseView.AddChidren(uIPickerView); uIPickerView.setCurrentItems(pickerItems.IndexOf(trait.value.ToString()), 4, 5); string selectItem = pickerItems[0]; - if (pickerItems.Contains(trait.value + FunctionList.List.GetUintString(trait.key))) + if (pickerItems.Contains(trait.value + trait.GetUintString())) { - selectItem = trait.value.ToString() + FunctionList.List.GetUintString(trait.key); + selectItem = trait.value.ToString() + trait.GetUintString(); } dialog.Show(); @@ -568,7 +578,7 @@ dialog.Close(); btn.Text = selectItem; //sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.value.ToString() ; - trait.value = selectItem.Replace(FunctionList.List.GetUintString(trait.key),""); + trait.value = selectItem.Replace(trait.GetUintString(),""); }; } @@ -622,7 +632,7 @@ Gravity = Gravity.CenterHorizontal, TextAlignment = TextAlignment.Center, Width = Application.GetRealWidth(100), - Text = FunctionList.List.GetNameText(trait.key), + Text = trait.GetNameText(), IsBold = true, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.SubheadingFontSize, @@ -711,7 +721,7 @@ { dialog.Close(); trait.value = controlBar.Progress.ToString(); - btn.Text = trait.value + FunctionList.List.GetUintString(trait.key); + btn.Text = trait.value + trait.GetUintString(); var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff); if (temp != null) @@ -724,7 +734,7 @@ { temp.value = "off"; } - btnOnText.Text = FunctionList.List.GetValueText(temp.key, temp.value); + btnOnText.Text = temp.GetValueText(); } }; } @@ -779,7 +789,7 @@ Gravity = Gravity.CenterHorizontal, TextAlignment = TextAlignment.Center, Width = Application.GetRealWidth(100), - Text = FunctionList.List.GetNameText(trait.key), + Text = trait.GetNameText(), IsBold = true, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.SubheadingFontSize, @@ -872,7 +882,7 @@ { dialog.Close(); trait.value = controlBar.Progress.ToString(); - btn.Text = trait.value + FunctionList.List.GetUintString(trait.key); + btn.Text = trait.value + trait.GetUintString(); }; } @@ -921,7 +931,7 @@ Gravity = Gravity.CenterHorizontal, TextAlignment = TextAlignment.Center, Width = Application.GetRealWidth(100), - Text = FunctionList.List.GetNameText(trait.key), + Text = trait.GetNameText(), IsBold = true, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.SubheadingFontSize, @@ -993,7 +1003,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.TextFontSize, Tag = m, - Text = FunctionList.List.GetValueText(trait.key, m) + Text = trait.GetValueText() }; row.AddChidren(btnPropertyTitle); -- Gitblit v1.8.0