From f5268d43584a1f72cb7b19c17232645c24e2348b Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期四, 17 十二月 2020 15:29:31 +0800 Subject: [PATCH] 20201217-3 --- HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 62 +++++++++++++++++++++--------- 1 files changed, 43 insertions(+), 19 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs index e1695e9..3131df6 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs @@ -136,12 +136,17 @@ if (result == DAL.Server.StateCode.SUCCESS) { refreshAction(); - this.RemoveFromParent(); + this.RemoveFromParent(); } else { DAL.Server.IMessageCommon.Current.ShowErrorInfoAlter(result); } + } + else + { + refreshAction(); + this.RemoveFromParent(); } }; } @@ -272,7 +277,7 @@ TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - Text = scene.delayText + Text = FunctionList.List.GetDelayText( sceneFunction.delay) }; delayRow.AddChidren(btnDelayInfo); @@ -288,10 +293,12 @@ btnSceneDelayTitle.MouseUpEventHandler = (sender, e) => { - new PublicAssmebly().SetSceneDelayDialog(scene, btnDelayInfo); + Action<string> action = (obj) => { + sceneFunction.delay = obj; + btnDelayInfo.Text = FunctionList.List.GetDelayText(obj); + }; + new PublicAssmebly().SetSceneDelayDialog(action,sceneFunction.delay); }; - - #endregion @@ -405,6 +412,10 @@ /// <param name="btn"></param> void LoadEditDialog_Temp(SceneFunctionStatus trait, Button btn) { + double temp = 16; + double.TryParse(trait.value, out temp); + trait.value = temp.ToString(); + List<string> pickerItems = new List<string>(); if(trait == null) { @@ -477,7 +488,12 @@ uIPickerView.setNPicker(pickerItems, null, null); optionBaseView.AddChidren(uIPickerView); uIPickerView.setCurrentItems(pickerItems.IndexOf(trait.value.ToString()), 4, 5); - string selectItem = trait.value.ToString() + FunctionList.List.GetUintString(trait.key); + + string selectItem = pickerItems[0]; + if (pickerItems.Contains(trait.value + FunctionList.List.GetUintString(trait.key))) + { + selectItem = trait.value.ToString() + FunctionList.List.GetUintString(trait.key); + } dialog.Show(); @@ -600,7 +616,7 @@ ProgressTextColor = CSS_Color.FirstLevelTitleColor, ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, MaxValue = 100, - Progress = trait.value.ToString().Replace("{}", "") == "" ? 0 : Convert.ToInt32( trait.value.Replace("{}","")), + Progress = trait.value.ToString().Replace("{}", "") == "" ? 0 : Convert.ToInt32(trait.value.Replace("{}", "")), SeekBarPadding = Application.GetRealWidth(20), }; optionBaseView.AddChidren(controlBar); @@ -615,39 +631,47 @@ }; optionBaseView.AddChidren(btnPlusSgnIcon); - btnMinusSignIcon.MouseUpEventHandler = (sender, e) => { + btnMinusSignIcon.MouseUpEventHandler = (sender, e) => + { controlBar.Progress--; }; - btnPlusSgnIcon.MouseUpEventHandler = (sender, e) => { + btnPlusSgnIcon.MouseUpEventHandler = (sender, e) => + { controlBar.Progress++; }; dialog.Show(); - pView.MouseUpEventHandler = (sender, e) => { + pView.MouseUpEventHandler = (sender, e) => + { dialog.Close(); }; - btnCancel.MouseUpEventHandler = (sender, e) => { + btnCancel.MouseUpEventHandler = (sender, e) => + { dialog.Close(); }; - btnConfrim.MouseUpEventHandler = (sender, e) => { + btnConfrim.MouseUpEventHandler = (sender, e) => + { dialog.Close(); trait.value = controlBar.Progress.ToString(); btn.Text = trait.value + FunctionList.List.GetUintString(trait.key); - if (controlBar.Progress > 0) + + var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff); + if (temp != null) { - var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff); - if (temp != null) + if (controlBar.Progress > 0) { temp.value = "on"; - btnOnText.Text = FunctionList.List.GetValueText(temp.key, temp.value); } + else + { + temp.value = "off"; + } + btnOnText.Text = FunctionList.List.GetValueText(temp.key, temp.value); } }; } - - - + /// <summary> /// 鍔犺浇鍔熻兘灞炴�ф暟鎹�夋嫨寮圭獥 /// </summary> -- Gitblit v1.8.0