From d987694e57c3bce76bd5a208d74a3696db222a4a Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 14 一月 2021 14:00:06 +0800 Subject: [PATCH] Merge branch 'WJC' into NewFilePath --- HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 174 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 160 insertions(+), 14 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs index 5bacc1d..522f09c 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs @@ -17,12 +17,6 @@ for (int i = 0; i < Logic.currlogic.input.Count; i++) { Input inputCondition = Logic.currlogic.input[i]; - if (inputCondition == null) - { - //闃叉鏈夌殑绌哄璞★紱 - //姝e父鎯呭喌涓嬩笉浼氳鐜拌薄锛� - continue; - } ///鍚勭鏉′欢鐨刅iew LogicView.AddOutputInputView inputView = new LogicView.AddOutputInputView(); inputView.FLayoutView(viewLayout); @@ -170,6 +164,94 @@ } } break; + case "4": + { + inputView.btnIcon.UnSelectedImagePath = "LogicIcon/changesinoutdoor.png"; + string strtext = ""; + string strvalue = ""; + foreach (var dic in dicList) + { + string key = dic["key"]; + string comparator = dic["comparator"]; + string value = dic["value"]; + + switch (key) + { + case "outdoor_temp": + { + strvalue = value; + if (comparator==">") { + strtext = Language.StringByID(StringId.wendugaoyu); + } + else if(comparator == "<"){ + strtext = Language.StringByID(StringId.wendudiyu); + } + + } + break; + case "outdoor_humity": + { + strvalue = value; + if (comparator == ">") + { + strtext = Language.StringByID(StringId.shidugaoyu); + } + else if (comparator == "<") + { + strtext = Language.StringByID(StringId.shidudiyu); + } + + } + break; + case "pm2.5": + { + strtext = Language.StringByID(StringId.PM25); + strvalue = new OutdoorEnvironment { }.GetString(value); + } + break; + + } + + + } + inputView.btnText.Text = strtext; + inputView.btnState.Text = strvalue; + } + break; + case "6": + { + inputView.btnIcon.UnSelectedImagePath = "LogicIcon/changesinoutdoor.png"; + foreach (var dic in dicList) + { + string strtext = ""; + string value = dic["value"]; + switch (value) + { + case "sunny": + { + strtext = Language.StringByID(StringId.clearday); + + } + break; + case "cloudy": + { + + strtext = Language.StringByID(StringId.cloudy); + + } + break; + case "rainy": + { + strtext = Language.StringByID(StringId.rain); + } + break; + + } + inputView.btnText.TextID =StringId.tianqibianhua; + inputView.btnState.Text = strtext; + } + } + break; } //鍐嶆缂栬緫鏉′欢鐘舵�佺偣鍑讳簨浠� @@ -189,7 +271,6 @@ break; } } - //鏍囪缂栬緫鐘舵�� bool edit = true; switch (button.Name) @@ -257,6 +338,78 @@ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; } break; + case "4": + { + ///褰撳墠鐨勭储寮曞�兼暟鎹璞� + Input inputedit = Logic.currlogic.input[indexVulae]; + ///鐘舵�佸�� + string stateValue = ""; + ///鐘舵�佸�兼枃鏈� + int intValue = -1; + foreach (var dic in inputedit.condition) + { + string key = dic["key"]; + string comparator = dic["comparator"]; + stateValue = dic["value"]; + switch (key) + { + case "outdoor_temp": + { + if (comparator == ">") + { + intValue=StringId.wendugaoyu; + } + else if (comparator == "<") + { + intValue = StringId.wendudiyu; + + } + + } + break; + case "outdoor_humity": + { + + if (comparator == ">") + { + intValue = StringId.shidugaoyu; + } + else if (comparator == "<") + { + intValue = StringId.shidudiyu; + } + + } + break; + case "pm2.5": + { + intValue = StringId.PM25; + } + break; + + } + } + OutdoorEnvironment outdoorEnvironment = new OutdoorEnvironment(); + if (intValue == StringId.PM25) + { + outdoorEnvironment.PmAction(thisView, stateValue); + } + else + { + outdoorEnvironment.InputBoxAction(intValue, stateValue); + } + + } + break; + case "6": + { + + WeatherCondition weatherCondition = new WeatherCondition(); + MainPage.BasePageView.AddChidren(weatherCondition); + weatherCondition.Show(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + } + break; } }; ///鍒犻櫎鎺т欢 @@ -279,12 +432,6 @@ for (int i = 0; i < Logic.currlogic.output.Count; i++) { Output outputTarget = Logic.currlogic.output[i]; - if (outputTarget == null) - { - //闃叉鏈夌殑绌哄璞★紱 - //姝e父鎯呭喌涓嬩笉浼氳鐜拌薄锛� - continue; - } ///鍚勭鏉′欢鐨刅iew LogicView.AddOutputInputView targetView = new LogicView.AddOutputInputView(); targetView.FLayoutView(viewLayout); @@ -940,7 +1087,6 @@ } return valueStr; } - /// <summary> ///鑾峰彇鑷姩鍖栧悕绉� /// </summary> -- Gitblit v1.8.0