From 1887ea937010ff8caba39622e8246a2802ca02c5 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期一, 21 十二月 2020 19:40:04 +0800 Subject: [PATCH] 20201221-3 --- HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs | 80 +++++++++++++++++++++++++++++++++------ 1 files changed, 67 insertions(+), 13 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs index 01a8209..236032e 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs @@ -49,7 +49,7 @@ case FunctionType.Dimmer: case FunctionType.RGB: case FunctionType.RGBW: - case FunctionType.CCT: + case FunctionType.ColorTemperature: { //2琛ㄧず(寮�锛屽叧)鍔熻兘 SwitchBrightnessView(fLayout, device, index, edit, 2); @@ -68,8 +68,8 @@ SwitchView(fLayout, device, index, edit, 3); } break; - case FunctionType.TrietexCurtain: - case FunctionType.RollerCurtain: + case FunctionType.MotorCurtain: + case FunctionType.RollingShutter: { //3琛ㄧず(寮�锛屽叧锛屾殏鍋�)鍔熻兘 SwitchBrightnessView(fLayout, device, index, edit, 3); @@ -137,7 +137,6 @@ //鍔犺浇鏁版嵁鐣岄潰鐨勮缃柟娉�(鍒楄〃浜掍笉鑱斿姩) view.mUIPickerView.setNPicker(temperatureList, null, null); - //榛樿鍒濆閫変腑鐘舵�� view.mUIPickerView.setCurrentItems(9, 0, 0); //瀹氫箟涓�涓眬閮ㄥ彉閲忚褰曢�変腑鏃堕棿 @@ -278,7 +277,7 @@ speedTypeView.btnText.Text = speedStr[i]; speedTypeView.btnClick.Tag = speedStr[i];//鏍囪 - if (acModehView.btnState.Text == speedStr[i]) + if (acSpeedView.btnState.Text == speedStr[i]) { //鏄剧ず涔嬪墠鐨勯�変腑鐘舵�� checkBtn.IsSelected = false; @@ -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) { //绉婚櫎鏃ф暟鎹� @@ -664,7 +697,7 @@ ///浜害 LogicView.FunTypeView brightnessView = new LogicView.FunTypeView(); brightnessView.frameLayout.Y = lightSwitchView.frameLayout.Bottom; - if (device.functionType == FunctionType.TrietexCurtain || device.functionType == FunctionType.RollerCurtain) + if (device.functionType == FunctionType.MotorCurtain || device.functionType == FunctionType.RollingShutter) { brightnessView.btnText.TextID = StringId.percentum; @@ -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) => { @@ -887,7 +942,7 @@ case FunctionType.Dimmer: case FunctionType.RGB: case FunctionType.RGBW: - case FunctionType.CCT: + case FunctionType.ColorTemperature: { foreach (var dic in dicList) { @@ -943,8 +998,8 @@ } } break; - case FunctionType.TrietexCurtain: - case FunctionType.RollerCurtain: + case FunctionType.MotorCurtain: + case FunctionType.RollingShutter: { foreach (var dic in dicList) @@ -974,7 +1029,7 @@ } } break; - case "brightness": + case "percent": { button2.Text = value; @@ -1155,7 +1210,6 @@ } break; } - } /// <summary> /// 娣诲姞澶勭悊閫変腑鏁版嵁 -- Gitblit v1.8.0