2023年06月07日14:53:51
输出空调地暖设备兼用华摄度单位
| | |
| | | |
| | | if (set_temp != "") |
| | | { |
| | | |
| | | stateStr += set_temp + "℃,"; |
| | | string unit = device.GetAttribute("temperature_type") == null ? "°" : device.GetAttribute("temperature_type").state; |
| | | stateStr += set_temp + unit+","; |
| | | } |
| | | |
| | | if (mode != "") |
| | |
| | | } |
| | | if (set_temp != "") |
| | | { |
| | | |
| | | stateStr += set_temp + "℃,"; |
| | | string unit = device.GetAttribute("temperature_type") == null ? "°" : device.GetAttribute("temperature_type").state; |
| | | stateStr += set_temp + unit + ","; |
| | | } |
| | | if (mode != "") |
| | | { |
| | |
| | | /// <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 |
| | | { |
| | |
| | | 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) |
| | |
| | | }; |
| | | 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) => |
| | | { |
| | |
| | | //设备属性值,云雀上定义好的; |
| | | 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); |
| | | |
| | | }; |
| | | ///模式点击事件 |
| | |
| | | { |
| | | 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) => |
| | |
| | | //设备属性值,云雀上定义好的; |
| | | 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); |
| | | |
| | | }; |
| | | ///模式点击事件 |