From 24262d16a0d6e3b7d07486d03ab77e607e1847c3 Mon Sep 17 00:00:00 2001 From: hxb <hxb@hdlchina.com.cn> Date: 星期一, 21 十二月 2020 14:22:26 +0800 Subject: [PATCH] 增加获取Bug列表的功能 --- HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs | 64 +++++++++++++++++++++++++++++-- 1 files changed, 59 insertions(+), 5 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs old mode 100755 new mode 100644 index 00271c2..236032e --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs @@ -137,7 +137,6 @@ //鍔犺浇鏁版嵁鐣岄潰鐨勮缃柟娉�(鍒楄〃浜掍笉鑱斿姩) view.mUIPickerView.setNPicker(temperatureList, null, null); - //榛樿鍒濆閫変腑鐘舵�� view.mUIPickerView.setCurrentItems(9, 0, 0); //瀹氫箟涓�涓眬閮ㄥ彉閲忚褰曢�変腑鏃堕棿 @@ -506,7 +505,41 @@ Output outputDevice = new Output(); outputDevice.target_type = "1"; outputDevice.sid = device.sid; + + switch (device.functionType) + { + case FunctionType.Dimmer: + case FunctionType.RGB: + case FunctionType.RGBW: + case FunctionType.ColorTemperature: + { + //璋冨厜鍋氫簡涓�涓壒娈婂鐞嗭紱 + if (dicSateteList.Count > 1) + { + foreach (var dictionary in dicSateteList) + { + string keyValue = dictionary["key"]; + if (keyValue == "on_off") + { + if (dictionary["value"] == "off") + { + //绉婚櫎鍒楄〃鎵�鏈夋暟鎹� + dicSateteList.Clear(); + //閲嶆柊娣诲姞寮�鍏夊睘鎬ф暟鎹� + Dictionary<string, string> diction = new Dictionary<string, string>(); + diction.Add("key", "on_off"); + diction.Add("value", "off"); + dicSateteList.Add(diction); + break; + } + } + } + } + break; + } + } outputDevice.status = dicSateteList; + if (edit) { //绉婚櫎鏃ф暟鎹� @@ -784,8 +817,30 @@ #region 鐐瑰嚮浜嬩欢 int brightnesValue = 0; Dictionary<string, string> dic = new Dictionary<string, string>(); - LogicMethod.dictionary(dic, "key", "brightness"); - string keyVlaue = "brightness"; + string keyVlaue = ""; + + switch (device.functionType) + { + //寮�鍏崇伅鍏� light.Switch + case FunctionType.Dimmer: + case FunctionType.RGB: + case FunctionType.RGBW: + case FunctionType.ColorTemperature: + { + LogicMethod.dictionary(dic, "key", "brightness"); + keyVlaue = "brightness"; + } + break; + + case FunctionType.MotorCurtain: + case FunctionType.RollingShutter: + { + LogicMethod.dictionary(dic, "key", "percent"); + keyVlaue = "percent"; + } + break; + } + //鈥旂偣鍑讳簨浠� brightness.btn_subtract_click.MouseUpEventHandler += (sender2, e2) => { @@ -974,7 +1029,7 @@ } } break; - case "brightness": + case "percent": { button2.Text = value; @@ -1155,7 +1210,6 @@ } break; } - } /// <summary> /// 娣诲姞澶勭悊閫変腑鏁版嵁 -- Gitblit v1.8.0