From d9fd4c59bea0f21d4c8241920cef90440cf53f43 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期六, 28 八月 2021 17:20:45 +0800 Subject: [PATCH] 2021-8-28-05 --- HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs | 165 ++++++++++++++++++++------------ HDL-ON_iOS/Resources/Language.ini | 16 ++- HDL-ON_Android/Assets/Language.ini | 16 ++- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 4 HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 19 +++ HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs | 29 ++--- HDL_ON/Common/R.cs | 10 + HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs | 2 8 files changed, 168 insertions(+), 93 deletions(-) diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index 7cbdacb..076b1a7 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -955,9 +955,9 @@ 7101=*Please set the value in this range (1 ~ 100). 7102=No set value. 7103=Excellent: 0 ~ 35ug/m3 -7104=Good: 35 ~ 75ug/m3 -7105=Light pollution: 75 ~ 115ug/m3 -7106=Moderate pollution: 115 ~ 150ug/m3 +7104=Good: 36 ~ 75ug/m3 +7105=Light pollution: 76 ~ 115ug/m3 +7106=Moderate pollution: 116 ~ 150ug/m3 7107=Heavy pollution: > 150ug/m3 7108=Leak/No Leak 7109=Leak @@ -1002,6 +1002,8 @@ 7148=Disarm 7149=Manually 7150=Smart +7151=Good + @@ -2049,9 +2051,9 @@ 7101=*璇峰湪杩欎釜鑼冨洿(1~100)璁剧疆鍊笺�� 7102=杩樻病鏈夎缃�笺�� 7103=浼�:0~35ug/m鲁 -7104=鑹�:35~75ug/m鲁 -7105=杞诲害姹℃煋:75~115ug/m鲁 -7106=涓害姹℃煋:115~150ug/m鲁 +7104=鑹�:36~75ug/m鲁 +7105=杞诲害姹℃煋:76~115ug/m鲁 +7106=涓害姹℃煋:116~150ug/m鲁 7107=閲嶅害姹℃煋:>150ug/m鲁 7108=娉勬紡/鏃犳硠婕� 7109=娉勬紡 @@ -2096,6 +2098,8 @@ 7148=鎾ら槻 7149=鎵嬪姩 7150=鏅鸿兘 +7151=鑹ソ + 9000=璇蜂娇鐢ㄦ柊鐨勬墜鏈鸿处鍙风櫥褰旳PP diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index 7cbdacb..076b1a7 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -955,9 +955,9 @@ 7101=*Please set the value in this range (1 ~ 100). 7102=No set value. 7103=Excellent: 0 ~ 35ug/m3 -7104=Good: 35 ~ 75ug/m3 -7105=Light pollution: 75 ~ 115ug/m3 -7106=Moderate pollution: 115 ~ 150ug/m3 +7104=Good: 36 ~ 75ug/m3 +7105=Light pollution: 76 ~ 115ug/m3 +7106=Moderate pollution: 116 ~ 150ug/m3 7107=Heavy pollution: > 150ug/m3 7108=Leak/No Leak 7109=Leak @@ -1002,6 +1002,8 @@ 7148=Disarm 7149=Manually 7150=Smart +7151=Good + @@ -2049,9 +2051,9 @@ 7101=*璇峰湪杩欎釜鑼冨洿(1~100)璁剧疆鍊笺�� 7102=杩樻病鏈夎缃�笺�� 7103=浼�:0~35ug/m鲁 -7104=鑹�:35~75ug/m鲁 -7105=杞诲害姹℃煋:75~115ug/m鲁 -7106=涓害姹℃煋:115~150ug/m鲁 +7104=鑹�:36~75ug/m鲁 +7105=杞诲害姹℃煋:76~115ug/m鲁 +7106=涓害姹℃煋:116~150ug/m鲁 7107=閲嶅害姹℃煋:>150ug/m鲁 7108=娉勬紡/鏃犳硠婕� 7109=娉勬紡 @@ -2096,6 +2098,8 @@ 7148=鎾ら槻 7149=鎵嬪姩 7150=鏅鸿兘 +7151=鑹ソ + 9000=璇蜂娇鐢ㄦ柊鐨勬墜鏈鸿处鍙风櫥褰旳PP diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index 3924bf6..bb86f24 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -2403,15 +2403,15 @@ /// </summary> public const int pmyou = 7103; /// <summary> - /// 鑹�:35~75ug/m鲁 + /// 鑹�:36~75ug/m鲁 /// </summary> public const int pmliang = 7104; /// <summary> - /// 杞诲害姹℃煋:75~115ug/m鲁 + /// 杞诲害姹℃煋:76~115ug/m鲁 /// </summary> public const int pmqingdu= 7105; /// <summary> - /// 涓害姹℃煋:115~150ug/m鲁 + /// 涓害姹℃煋:116~150ug/m鲁 /// </summary> public const int pmzhongdu = 7106; /// <summary> @@ -2590,6 +2590,10 @@ /// smart锛氭櫤鑳� /// </summary> public const int zhineng = 7150; + /// <summary> + /// 鑹ソ + /// </summary> + public const int lianghao = 7151; diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs index 6944734..0bc97bc 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs @@ -360,17 +360,16 @@ } break; //鐢查啗 - case SPK.: + case SPK.SensorHcho: { - ///tvoc - LogicView.FunTypeView tvocView = new LogicView.FunTypeView(); - tvocView.btnText.TextID = StringId.tvoc; - fLayout.AddChidren(tvocView.FLayoutView()); - - ///tvoc鐐瑰嚮浜嬩欢 - tvocView.btnClick.MouseUpEventHandler += (sender, e) => + ///hcho + LogicView.FunTypeView hchoView = new LogicView.FunTypeView(); + hchoView.btnText.TextID = StringId.tvoc; + fLayout.AddChidren(hchoView.FLayoutView()); + ///hcho鐐瑰嚮浜嬩欢 + hchoView.btnClick.MouseUpEventHandler += (sender, e) => { - PmCo2TvocAction(this, device, "tvoc", StringId.tvoc, index, edit); + PmCo2TvocAction(this, device, "hcho", StringId.Formaldehyde, index, edit); }; } @@ -624,7 +623,7 @@ /// <param name="index"></param> /// <param name="edit"></param> /// <param name="stateValue">缂栬緫涔嬪墠鐨勭姸鎬佸��,榛樿涓�""</param> - public void PmCo2TvocAction(FrameLayout frame, Entity.Function device,string key,int title, int index, bool edit, string stateValue = "") + public void PmCo2TvocAction(FrameLayout frame, Entity.Function device, string key, int title, int index, bool edit, string stateValue = "") { if (edit) { @@ -637,15 +636,15 @@ dicSateteList = inputs.condition; } } - PublicInterface view = new PublicInterface(); - var listStr = view.GetViewList(key); + PublicInterface view = new PublicInterface(); + var listStr = view.GetViewList(key); view.SingleSelectionShow(frame, listStr, Language.StringByID(title), view.GetString(key, stateValue) , (text) => { var value = view.GetValue(key, text); - selectedState = device.spk + "_"+ key; - AddDictionary(key, value, "integer","in"); - Save(device,index, edit); + selectedState = device.spk + "_" + key; + AddDictionary(key, value, "integer", "in"); + Save(device, index, edit); }); } /// <summary> diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs index 1158bc6..999ffc2 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs @@ -413,6 +413,13 @@ } break; + case SPK.SensorHcho: + { + string str = new InpOrOutLogicMethod { }.GetText(dicList); + inputView.btnState.Text = str; + + } + break; } } break; @@ -656,6 +663,7 @@ || device.spk == SPK.SensorCO2 || device.spk == SPK.SensorPm25 || device.spk == SPK.SensorTVOC + || device.spk == SPK.SensorHcho ) { //杩欎釜璁惧姣旇緝鐗规畩 @@ -708,12 +716,16 @@ case "pm25": { conditionDeviceFunList.PmCo2TvocAction(thisView, device, "pm25", StringId.pm25, indexVulae, true, stateValue); - } break; case "tvoc": { conditionDeviceFunList.PmCo2TvocAction(thisView, device, "tvoc", StringId.tvoc, indexVulae, true, stateValue); + } + break; + case "hcho": + { + conditionDeviceFunList.PmCo2TvocAction(thisView, device, "hcho", StringId.tvoc, indexVulae, true, stateValue); } break; } @@ -2148,6 +2160,11 @@ strtext = Language.StringByID(StringId.tvoc) + new PublicInterface { }.GetString("tvoc", value); } break; + case "hcho": + { + strtext = Language.StringByID(StringId.Formaldehyde) + new PublicInterface { }.GetString("hcho", value); + } + break; } } return strtext; diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs index 34b72d7..906212f 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs @@ -367,6 +367,7 @@ case SPK.SensorCO2: case SPK.SensorPm25: case SPK.SensorTVOC: + case SPK.SensorHcho: { strPath = "LogicIcon/sensor.png"; } @@ -438,6 +439,7 @@ || device.spk == SPK.SensorCO2 || device.spk == SPK.SensorPm25 || device.spk == SPK.SensorTVOC + || device.spk == SPK.SensorHcho ); if (sensor != null) { @@ -500,6 +502,7 @@ functionTypeList.Add(SPK.SensorCO2); functionTypeList.Add(SPK.SensorPm25); functionTypeList.Add(SPK.SensorTVOC); + functionTypeList.Add(SPK.SensorHcho); } @@ -546,6 +549,7 @@ deviceTypeList.Add(SPK.SensorCO2); deviceTypeList.Add(SPK.SensorPm25); deviceTypeList.Add(SPK.SensorTVOC); + deviceTypeList.Add(SPK.SensorHcho); } break; diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs index 677aeed..3db3fcd 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs @@ -719,12 +719,12 @@ }; } break; - case "tvoc": + case "hcho": { list = new List<string> { - Language.StringByID(StringId.zhengchang)+ ":0~399PPB", - Language.StringByID(StringId.chaobiao)+ ":400~699PPB", - Language.StringByID(StringId.yanzhong)+":>700PPB", + 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; @@ -939,71 +939,98 @@ public string GetString(string type, string strValue) { string text = ""; - int intValue = 0; - if (strValue != "") - { - intValue = int.Parse(strValue); - } - switch (type) { case "pm25": { - if (intValue >= 0 && intValue <= 35) - { - text = Language.StringByID(StringId.pmyou); + switch (strValue) { + case "(0,35]": { + text = Language.StringByID(StringId.pmyou); + } + break; + case "(36,75]": { + text = Language.StringByID(StringId.pmliang); + } break; + case "(76,115]": { + text = Language.StringByID(StringId.pmqingdu); + } break; + case "(116,150]": { + text = Language.StringByID(StringId.pmzhongdu); + } break; + case "(150,100000]": { + text = Language.StringByID(StringId.pmzhongduwuran); + } break; } - else if (intValue >35 && intValue <= 75) - { - text = Language.StringByID(StringId.pmliang); - } - else if (intValue > 75 && intValue <= 115) - { - text = Language.StringByID(StringId.pmqingdu); - } - else if (intValue >115 && intValue <= 150) - { - text = Language.StringByID(StringId.pmzhongdu); - } - else if (intValue > 150) - { - text = Language.StringByID(StringId.pmzhongduwuran); - } + } break; case "co2": { - - if (intValue >= 0 && intValue <= 1000) + switch (strValue) { - text = Language.StringByID(StringId.zhengchang)+ ":0~1000PPM"; - } - else if (intValue > 1000 && intValue <= 2000) - { - text = Language.StringByID(StringId.piangao) + ":1001~2000PPM"; - } - else if (intValue > 2000) - { - text = Language.StringByID(StringId.chaobiao) + ":>2000PPM"; + case "(0,1000]": + { + text = Language.StringByID(StringId.zhengchang) + ":0~1000PPM"; + } + break; + case "(1001,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,1000]": + { + text = Language.StringByID(StringId.zhengchang) + ":0~399PPB"; + } + break; + case "(1001,2000]": + { + text = Language.StringByID(StringId.chaobiao) + ":400~699PPB"; + } + break; + case "(2000,200000]": + { + text = Language.StringByID(StringId.yanzhong) + ":>700PPB"; + } + break; + } - if (intValue >=1 && intValue <= 3) + } + break; + case "hcho": + { + switch (strValue) { - text = Language.StringByID(StringId.zhengchang) + ":0~399PPB"; + case "(0,0.08]": + { + text = Language.StringByID(StringId.youxiu) + ":(0~0.08mg/m3)"; + } + break; + case "(0.09,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; } - else if (intValue >=4 && intValue<=6) - { - text = Language.StringByID(StringId.chaobiao) + ":400~699PPB"; - } - else if (intValue >= 7 && intValue <= 9) - { - text = Language.StringByID(StringId.yanzhong) + ":>700PPB"; - } + } break; } @@ -1025,23 +1052,23 @@ { if (text == Language.StringByID(StringId.pmyou)) { - value = "10"; + value = "(0,35]"; } else if (text == Language.StringByID(StringId.pmliang)) { - value = "50"; + value = "(36,75]"; } else if (text == Language.StringByID(StringId.pmqingdu)) { - value = "90"; + value = "(76,115]"; } else if (text == Language.StringByID(StringId.pmzhongdu)) { - value = "130"; + value = "(116,150]"; } else if (text == Language.StringByID(StringId.pmzhongduwuran)) { - value = "170"; + value = "(150,100000]"; } } break; @@ -1049,15 +1076,15 @@ { if (text == Language.StringByID(StringId.zhengchang) + ":0~1000PPM") { - value = "400"; + value = "(0,1000]"; } else if (text == Language.StringByID(StringId.piangao) + ":1001~2000PPM") { - value = "1850"; + value = "(1001,2000]"; } else if (text == Language.StringByID(StringId.chaobiao) + ":>2000PPM") { - value = "2200"; + value = "(2000,200000]"; } } break; @@ -1065,15 +1092,31 @@ { if (text == Language.StringByID(StringId.zhengchang) + ":0~399PPB") { - value = "2"; + value = "(0,399]"; } else if (text == Language.StringByID(StringId.chaobiao) + ":400~699PPB") { - value = "5"; + value = "(400,699]"; } else if (text == Language.StringByID(StringId.yanzhong) + ":>700PPB") { - value = "8"; + value = "(700,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.09,0.1]"; + } + else if (text == Language.StringByID(StringId.chaobiao) + ":>(0.1mg/m3)") + { + value = "(0.1,10000]"; } } break; diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs index c405438..2e43f26 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs @@ -470,7 +470,7 @@ var dic = dicSateteList[i]; if (dic.ContainsValue("on_off")) { - if (dic["on_off"] == "on") + if (dic["value"] == "on") { //鍒ゆ柇鏄惁瀛樺湪涓旀槸寮�鐘舵�� _bool = true; -- Gitblit v1.8.0