From c1e3ff02ca39fe65d0685b06d1e1f63e25eaedb5 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期三, 07 六月 2023 14:54:12 +0800 Subject: [PATCH] 2023年06月07日14:53:51 --- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TemperatureView.cs | 8 ++++---- HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 8 ++++---- HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs | 10 ++++++---- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs index 014f3bb..430bd42 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs @@ -1170,8 +1170,8 @@ if (set_temp != "") { - - stateStr += set_temp + "鈩�,"; + string unit = device.GetAttribute("temperature_type") == null ? "掳" : device.GetAttribute("temperature_type").state; + stateStr += set_temp + unit+","; } if (mode != "") @@ -1268,8 +1268,8 @@ } if (set_temp != "") { - - stateStr += set_temp + "鈩�,"; + string unit = device.GetAttribute("temperature_type") == null ? "掳" : device.GetAttribute("temperature_type").state; + stateStr += set_temp + unit + ","; } if (mode != "") { diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TemperatureView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TemperatureView.cs index f93fdc3..f8b7a85 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TemperatureView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TemperatureView.cs @@ -11,7 +11,7 @@ /// <param name="frameLayout">寮圭獥鐖舵帶浠�</param> /// <param name="stateValue">涔嬪墠鐘舵�佸��</param> /// <param name="action">杩斿洖缁撴灉</param> - public void FLayoutView(FrameLayout frameLayout, string stateValue, Action<string> action,int min,int max) + public void FLayoutView(FrameLayout frameLayout, string stateValue, Action<string> action,int min,int max,string unit) { FrameLayout frame = new FrameLayout { @@ -31,15 +31,15 @@ for (int i = min; i < max; i++) { //娣诲姞鏁版嵁 - temperatureList.Add(i.ToString() + "鈩�"); - temperatureList.Add((i + 0.5).ToString() + "鈩�"); + temperatureList.Add(i.ToString() + unit); + temperatureList.Add((i + 0.5).ToString() + unit); } //鍔犺浇鏁版嵁鐣岄潰鐨勮缃柟娉�(鍒楄〃浜掍笉鑱斿姩) view.mUIPickerView.setNPicker(temperatureList, null, null); //榛樿鍒濆閫変腑鐘舵�� view.mUIPickerView.setCurrentItems(9, 0, 0); //瀹氫箟涓�涓眬閮ㄥ彉閲忚褰曢�変腑鏃堕棿 - string temperature = "25鈩�"; + string temperature = "25"+ unit; for (int i = 0; i < temperatureList.Count; i++) { if (temperatureList[i] == stateValue) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs index 2d8e3ba..2104754 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs @@ -333,6 +333,7 @@ }; int min = device.GetAttribute("set_temp") == null ? 16 : device.GetAttribute("set_temp").min; int max = device.GetAttribute("set_temp") == null ? 32 : device.GetAttribute("set_temp").max; + string unit = device.GetAttribute("temperature_type") == null ? "掳" : device.GetAttribute("temperature_type").state; ///娓╁害鐐瑰嚮浜嬩欢 temperatureView.btnClick.MouseUpEventHandler += (sender, e) => { @@ -346,10 +347,10 @@ //璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�; string keyVlaue = "set_temp"; selectedState = device.spk + "_" + keyVlaue; - string set_temp_value = stateStr.Replace("鈩�", ""); + string set_temp_value = stateStr.Replace(unit, ""); //鏁版嵁灏佽 AddDictionary(keyVlaue, set_temp_value); - }, min,max); + }, min,max, unit); }; ///妯″紡鐐瑰嚮浜嬩欢 @@ -438,6 +439,7 @@ { int min = device.GetAttribute("set_temp") == null ? 16 : device.GetAttribute("set_temp").min; int max = device.GetAttribute("set_temp") == null ? 32 : device.GetAttribute("set_temp").max; + string unit = device.GetAttribute("temperature_type") == null ? "掳" : device.GetAttribute("temperature_type").state; string tempValue = temperatureView.btnState.Text; LogicView.TemperatureView tempView = new LogicView.TemperatureView(); tempView.FLayoutView(this, tempValue, (stateStr) => @@ -447,11 +449,11 @@ //璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�; string keyVlaue = "set_temp"; selectedState = device.spk + "_" + keyVlaue; - string set_temp_value = stateStr.Replace("鈩�", ""); + string set_temp_value = stateStr.Replace(unit, ""); //鏁版嵁灏佽 AddDictionary(keyVlaue, set_temp_value); - },min,max); + }, min, max, unit); }; ///妯″紡鐐瑰嚮浜嬩欢 -- Gitblit v1.8.0