From ccd5b1c8dc2d0399745779fb4f9a261d24d75a6d Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 23 十一月 2021 14:43:13 +0800 Subject: [PATCH] 备份 --- HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs | 344 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 335 insertions(+), 9 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs index 18ec0c8..b05eac1 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs @@ -16,6 +16,10 @@ /// <param name="textSize">鏄剧ず鏂囨湰瀛椾綋澶у皬</param> public void SingleSelectionShow(FrameLayout frame, List<string> list, string titleText, string stateText, Action<string> action, int textSize = LogicView.TextSize.text14) { + if (list == null) + { + return; + } FrameLayout frameLayout = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTrans60lucence, @@ -75,7 +79,7 @@ }; } - + /// <summary> /// 澶氶�夋嫨 /// </summary> @@ -259,7 +263,8 @@ /// <param name="list">鏄剧ず鏁版嵁婧�</param> /// <param name="titleText">鏍囬</param> /// <param name="action">杩斿洖鍊肩储寮曞��</param> - public void FrameOrVv(FrameLayout frame, List<string>list, int titleText,Action<int> action) { + public void FrameOrVv(FrameLayout frame, List<string> list, List<string> stateList, int titleText, Action<int> action) + { int line = 0; if (list.Count == 0 || list.Count > 5) @@ -361,6 +366,11 @@ { verticalRefresh.AddChidren(checkView.FLayoutView()); } + + if (stateList.Contains(strName)) + { + checkView.btnCheckIcon.IsSelected = true; + } checkView.btnText.Text = strName; checkView.btnClick.Tag = i;//鏍囪 //鐐瑰嚮浜嬩欢 @@ -386,8 +396,7 @@ frameLayout.RemoveFromParent(); }; - } - + } /// <summary> /// 瓒呭嚭5涓厓绱犺鐢ㄦ粦鍔ㄦ帶浠� /// </summary> @@ -395,8 +404,8 @@ /// <param name="list">鏄剧ず鏁版嵁婧�</param> /// <param name="stateList">涔嬪墠鐘舵�佹暟鎹簮</param> /// <param name="titleText">鏍囬</param> - /// <param name="action">杩斿洖鍊肩储寮曞��</param> - public void FrameOrVvList(FrameLayout frame, List<string> list,List<string>stateList, int titleText, Action<List<string>> action) + /// <param name="action">杩斿洖鍊煎垪琛�</param> + public void FrameOrVvList(FrameLayout frame, List<string> list, List<string> stateList, int titleText, Action<List<string>> action) { int line = 0; @@ -495,7 +504,8 @@ { verticalRefresh.AddChidren(checkView.FLayoutView()); } - if (stateList.Contains(strName)) { + if (stateList.Contains(strName)) + { checkView.btnClick.IsSelected = true; checkView.btnCheckIcon.IsSelected = true; selecetdList.Add(strName); @@ -539,6 +549,63 @@ } + /// <summary> + /// 娓╂箍搴︾粍鍚堢晫闈� + /// </summary> + /// <param name="frameLayout">鐖舵帶浠�</param> + /// <param name="text1">鏍囬鏂囨湰1</param> + /// <param name="text2">鏍囬鏂囨湰2</param> + /// <param name="action">鍥炶皟鍑芥暟</param> + public void ViewZuHe(FrameLayout frameLayout, int text1, int text2, Action<int, FrameLayout> action) + { + + FrameLayout frame = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewMiddle }; + frameLayout.AddChidren(frame); + LogicView.TopView topView = new LogicView.TopView(); + topView.topNameBtn.TextID = StringId.wendu; + frame.AddChidren(topView.FLayoutView()); + topView.clickBackBtn.MouseUpEventHandler += (e, sen) => + { + frame.RemoveFromParent(); + }; + FrameLayout viewLayout = new FrameLayout + { + Y = Application.GetRealHeight(64), + Width = Application.GetRealWidth(LogicView.TextSize.view375), + Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64), + BackgroundColor = CSS.CSS_Color.viewMiddle, + }; + frame.AddChidren(viewLayout); + + //娓�,婀垮害楂樹簬 + LogicView.SelectTypeView temperaturehigherView = new LogicView.SelectTypeView(); + temperaturehigherView.btnIcon.Visible = false; + temperaturehigherView.btnText.X = Application.GetRealWidth(16); + temperaturehigherView.btnLine.X = Application.GetRealWidth(16); + temperaturehigherView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); + temperaturehigherView.btnText.TextID = text1; + viewLayout.AddChidren(temperaturehigherView.FLayoutView()); + //娓�,婀垮害浣庝簬 + LogicView.SelectTypeView temperatureunderView = new LogicView.SelectTypeView(); + temperatureunderView.frameLayout.Y = temperaturehigherView.frameLayout.Bottom; + temperatureunderView.btnIcon.Visible = false; + temperatureunderView.btnText.X = Application.GetRealWidth(16); + temperatureunderView.btnLine.X = Application.GetRealWidth(16); + temperatureunderView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); + temperatureunderView.btnText.TextID = text2; + viewLayout.AddChidren(temperatureunderView.FLayoutView()); + + //娓�,婀垮害楂樹簬 + temperaturehigherView.btnClick.MouseUpEventHandler += (sen, e) => + { + action(text1, frame); + }; + //娓�,婀垮害浣庝簬 + temperatureunderView.btnClick.MouseUpEventHandler += (sen, e) => + { + action(text2, frame); + }; + } /// <summary> /// 鑾峰彇鐣岄潰鍒楄〃 @@ -581,6 +648,16 @@ }; } break; + case "airFresh": + { + list = new List<string> { + Language.StringByID(StringId.zidong), + Language.StringByID(StringId.shoudong), + Language.StringByID(StringId.dingshi), + Language.StringByID(StringId.zhineng), + }; + } + break; case "week": { list = new List<string> { @@ -613,7 +690,7 @@ }; } break; - case "pm2.5": + case "pm25": { list = new List<string> { Language.StringByID(StringId.pmyou), @@ -624,7 +701,41 @@ }; } break; - + case "co2": + { + list = new List<string> { + Language.StringByID(StringId.zhengchang)+ ":0~1000PPM", + Language.StringByID(StringId.piangao) + ":1001~2000PPM", + Language.StringByID(StringId.chaobiao) + ":>2000PPM", + }; + } + break; + case "tvoc": + { + list = new List<string> { + Language.StringByID(StringId.zhengchang)+ ":0~399PPB", + Language.StringByID(StringId.chaobiao)+ ":400~699PPB", + Language.StringByID(StringId.yanzhong)+":>700PPB", + }; + } + break; + case "hcho": + { + list = new List<string> { + Language.StringByID(StringId.youxiu)+ ":(0~0.08mg/m3)", + Language.StringByID(StringId.lianghao)+":(0.09~0.1mg/m3)", + Language.StringByID(StringId.chaobiao)+ ":>(0.1mg/m3)", + }; + } + break; + case "security": + { + list = new List<string> { + Language.StringByID(StringId.bufang ), + Language.StringByID(StringId.chefang), + }; + } + break; } return list; } @@ -700,6 +811,27 @@ else if (text == Language.StringByID(StringId.timeMode)) { str = "timer"; + } + } + break; + case "airFresh": + { + + if (text == Language.StringByID(StringId.autoLogic)) + { + str = "auto"; + } + else if (text == Language.StringByID(StringId.shoudong)) + { + str = "manual"; + } + else if (text == Language.StringByID(StringId.dingshi)) + { + str = "timer"; + } + else if (text == Language.StringByID(StringId.zhineng)) + { + str = "smart"; } } break; @@ -798,6 +930,200 @@ return stateList; } + /// <summary> + /// 鏁板�艰繑鍥炴枃鏈� + /// </summary> + /// <param name="type">绫诲瀷</param> + /// <param name="strValue">鍊�</param> + /// <returns></returns> + public string GetString(string type, string strValue) + { + string text = ""; + switch (type) + { + case "pm25": + { + + switch (strValue) { + case "(0,35]": { + text = Language.StringByID(StringId.pmyou); + } + break; + case "(35,75]": { + text = Language.StringByID(StringId.pmliang); + } break; + case "(75,115]": { + text = Language.StringByID(StringId.pmqingdu); + } break; + case "(115,150]": { + text = Language.StringByID(StringId.pmzhongdu); + } break; + case "(151,100000]": { + text = Language.StringByID(StringId.pmzhongduwuran); + } break; + } + + } + break; + case "co2": + { + switch (strValue) + { + case "(0,1000]": + { + text = Language.StringByID(StringId.zhengchang) + ":0~1000PPM"; + } + break; + case "(1000,2000]": + { + text = Language.StringByID(StringId.piangao) + ":1001~2000PPM"; + } + break; + case "(2000,200000]": + { + text = Language.StringByID(StringId.chaobiao) + ":>2000PPM"; + } + break; + } + } + break; + case "tvoc": + { + switch (strValue) + { + case "(0,399]": + { + text = Language.StringByID(StringId.zhengchang) + ":0~399PPB"; + } + break; + case "(399,699]": + { + text = Language.StringByID(StringId.chaobiao) + ":400~699PPB"; + } + break; + case "(699,70000]": + { + text = Language.StringByID(StringId.yanzhong) + ":>700PPB"; + } + break; + } + + } + break; + case "hcho": + { + switch (strValue) + { + case "(0,0.08]": + { + text = Language.StringByID(StringId.youxiu) + ":(0~0.08mg/m3)"; + } + break; + case "(0.08,0.1]": + { + text = Language.StringByID(StringId.lianghao) + ":(0.09~0.1mg/m3)"; + } + break; + case "(0.1,10000]": + { + text = Language.StringByID(StringId.chaobiao) + ":>(0.1mg/m3)"; + } + break; + } + + } + break; + } + return text; + } + + /// <summary> + /// 鏈枃杩斿洖鏁板�艰繑鍥� + /// </summary> + /// <param name="type">绫诲瀷</param> + /// <param name="text">鏂囨湰</param> + /// <returns></returns> + public string GetValue(string type, string text) + { + string value = ""; + switch (type) + { + case "pm25": + { + if (text == Language.StringByID(StringId.pmyou)) + { + value = "(0,35]"; + } + else if (text == Language.StringByID(StringId.pmliang)) + { + value = "(35,75]"; + } + else if (text == Language.StringByID(StringId.pmqingdu)) + { + value = "(75,115]"; + } + else if (text == Language.StringByID(StringId.pmzhongdu)) + { + value = "(115,150]"; + } + else if (text == Language.StringByID(StringId.pmzhongduwuran)) + { + value = "(150,100000]"; + } + } + break; + case "co2": + { + if (text == Language.StringByID(StringId.zhengchang) + ":0~1000PPM") + { + value = "(0,1000]"; + } + else if (text == Language.StringByID(StringId.piangao) + ":1001~2000PPM") + { + value = "(1000,2000]"; + } + else if (text == Language.StringByID(StringId.chaobiao) + ":>2000PPM") + { + value = "(2000,200000]"; + } + } + break; + case "tvoc": + { + if (text == Language.StringByID(StringId.zhengchang) + ":0~399PPB") + { + value = "(0,399]"; + } + else if (text == Language.StringByID(StringId.chaobiao) + ":400~699PPB") + { + value = "(399,699]"; + } + else if (text == Language.StringByID(StringId.yanzhong) + ":>700PPB") + { + value = "(699,70000]"; + } + } + break; + case "hcho": + { + if (text == Language.StringByID(StringId.youxiu) + ":(0~0.08mg/m3)") + { + value = "(0,0.08]"; + } + else if (text == Language.StringByID(StringId.lianghao) + ":(0.09~0.1mg/m3)") + { + value = "(0.08,0.1]"; + } + else if (text == Language.StringByID(StringId.chaobiao) + ":>(0.1mg/m3)") + { + value = "(0.1,10000]"; + } + } + break; + + } + return value; + } } -- Gitblit v1.8.0