From d297fddadd429ffffbeb3f623f5ad860c33b3e5a Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期四, 07 一月 2021 15:41:48 +0800 Subject: [PATCH] 20201-1-7-1 --- HDL_ON/UI/UI2/3-Intelligence/Automation/Time3.cs | 137 +++++++++++++++++++++++++++++++++++++-------- 1 files changed, 111 insertions(+), 26 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Time3.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Time3.cs index 2ef72e0..70ee478 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Time3.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Time3.cs @@ -11,11 +11,11 @@ Tag = "Logic"; } - public void Show(string titelText,bool edit,int index) + public void Show(string titelText, bool edit, int index) { #region 鐣岄潰甯冨眬 LogicView.TopView topView = new LogicView.TopView(); - topView.frameLayout.Height = Application.GetRealHeight(64+20); + topView.frameLayout.Height = Application.GetRealHeight(64 + 20); this.AddChidren(topView.FLayoutView()); Button locationBtn = new Button { @@ -32,7 +32,7 @@ { Height = Application.GetRealHeight(14), Y = Application.GetRealHeight(57), - TextSize =LogicView.TextSize.text10, + TextSize = LogicView.TextSize.text10, TextColor = CSS.CSS_Color.textCancelColor, Text = "骞夸笢骞垮窞甯傜暘绂哄尯鐭虫ゼ闀�", }; @@ -41,17 +41,35 @@ { RemoveFromParent(); }; - topView.topNameBtn.Text=titelText; + topView.topNameBtn.Text = titelText; FrameLayout viewLayout = new FrameLayout { - Y = Application.GetRealHeight(64+20), + Y = Application.GetRealHeight(64 + 20), Width = Application.GetRealWidth(LogicView.TextSize.view375), - Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64-20), + Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64 - 20), BackgroundColor = CSS.CSS_Color.viewMiddle, }; this.AddChidren(viewLayout); + #endregion + //锛堟棩鍑烘椂锛屾棩钀芥椂锛屾鍗堟椂锛� + string str1 = ""; + //锛堟彁鍓嶏紝寤舵椂锛� + string str2 = ""; + //锛堟彁鍓嶏紝寤舵椂澶氬皯鍒嗛挓锛� + string value = ""; + if (edit) + { + new SpeciaTime().GetText(index, (s1, s2, s3) => + { + str1 = s1; + str2 = s2; + value = s3; + }); + + + } var list = new List<string> { Language.StringByID(StringId.punctually), Language.StringByID(StringId.advanced), @@ -67,12 +85,35 @@ timeView.btnLine.X = Application.GetRealWidth(16); timeView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); timeView.btnText.Text = list[i]; - timeView.btnClick.Tag= list[i]; - if (i==0) { + timeView.btnClick.Tag = list[i]; + if (i == 0) + { timeView.btnNextIcon.Visible = false; } - viewLayout.AddChidren(timeView.FLayoutView()); + //鍒ゆ柇鏄�(鏃ュ嚭,鏃ヨ惤,姝e崍) + if (str1 == titelText) + { + //鍒ゆ柇鏄�(鎻愬墠锛屽欢鏃�) + if (str2 == list[i]) + { + string s = ""; + if (value != "0") + { + if (value == "30") + { + s = value + Language.StringByID(StringId.s); + } + else + { + s =value + Language.StringByID(StringId.minute); + } + } + timeView.btnState.Visible = true; + timeView.btnState.Text = s; + } + } + viewLayout.AddChidren(timeView.FLayoutView()); timeView.btnClick.MouseUpEventHandler += (sen, e) => { string clickText = timeView.btnClick.Tag.ToString(); @@ -84,13 +125,39 @@ } else { - //鎻愬墠/寤舵椂 + //瀹氫箟涓�涓眬閮ㄥ彉閲� + string stateValue = ""; + //鍒ゆ柇鏄�(鏃ュ嚭,鏃ヨ惤,姝e崍) + if (str1 == titelText) + { + //鍒ゆ柇鏄�(鎻愬墠锛屽欢鏃�) + if (str2 == clickText) + { + string s = ""; + if (value != "0") + { + if (value == "30") + { + s = value + " s"; + } + else + { + s = value + " min"; + } + } + //鏇存柊鍊約tateValue + //涓轰簡鏄剧ず涔嬪墠鐨勭姸鎬� + stateValue = s; + } + + } + PublicInterface timePublicInterface = new PublicInterface(); var timelist = timePublicInterface.GetViewList("time"); - timePublicInterface.SingleSelectionShow(this, timelist, clickText, "" - , (value) => + timePublicInterface.SingleSelectionShow(this, timelist, clickText, stateValue + , (value1) => { - string timeValue = value.Split(" ")[0]; + string timeValue = value1.Split(" ")[0]; AddDic(keyValue, timeValue, edit, index); }); @@ -98,7 +165,7 @@ }; } - #endregion + } /// <summary> @@ -111,38 +178,56 @@ { string keyValue = ""; - if (clickText == Language.StringByID(StringId.advanced)) + if (titelText == Language.StringByID(StringId.sunrise) + Language.StringByID(StringId.h)) { - if (titelText == Language.StringByID(StringId.sunrise) + Language.StringByID(StringId.h)) + if (clickText == Language.StringByID(StringId.advanced)) { keyValue = "before_sunrise"; + } - else if (titelText == Language.StringByID(StringId.sunset) + Language.StringByID(StringId.h)) + else if (clickText == Language.StringByID(StringId.delayLogic)) { - keyValue = "before_sunset"; + keyValue = "after_sunrise"; } else { - keyValue = "at_sunrise"; + keyValue = "after_sunrise"; + } + } + else if (titelText == Language.StringByID(StringId.sunset) + Language.StringByID(StringId.h)) + { + + if (clickText == Language.StringByID(StringId.advanced)) + { + keyValue = "before_sunset"; + + } + else if (clickText == Language.StringByID(StringId.delayLogic)) + { + keyValue = "after_sunset"; + } + else + { + keyValue = "after_sunset"; } } else { + if (clickText == Language.StringByID(StringId.advanced)) + { + keyValue = "before_noon"; - if (titelText == Language.StringByID(StringId.sunrise) + Language.StringByID(StringId.h)) - { - keyValue = "after_sunrise"; } - else if (titelText == Language.StringByID(StringId.sunset) + Language.StringByID(StringId.h)) + else if (clickText == Language.StringByID(StringId.delayLogic)) { - keyValue = "鈥渁fter_sunset"; + keyValue = "after_noon"; } else { - keyValue = "at_sunset"; - + keyValue = "after_noon"; } + } return keyValue; } -- Gitblit v1.8.0