From b271bcceb1c4e718377ca86b6213816abcf7482a Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期一, 11 一月 2021 13:57:18 +0800 Subject: [PATCH] 20210111-删除功能类别,统一使用spk去设备功能 --- HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs | 76 +++++++++++++++++++------------------ 1 files changed, 39 insertions(+), 37 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs index a139048..cf96fe7 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs @@ -1,6 +1,8 @@ 锘縰sing System; using Shared; using System.Collections.Generic; +using HDL_ON.Entity; + namespace HDL_ON.UI.UI2.Intelligence.Automation { public class TargetDeviceFunList : FrameLayout @@ -43,34 +45,34 @@ this.AddChidren(saveView.FLayoutView()); #endregion #region 缂栬緫璁惧鐘舵�� - switch (device.functionType) + switch (device.spk) { //寮�鍏崇伅鍏� light.Switch - case FunctionType.Dimmer: - case FunctionType.RGB: - case FunctionType.RGBW: - case FunctionType.ColorTemperature: + case SPK.LightDimming: + case SPK.LightRGB: + case SPK.LightRGBW: + case SPK.LightCCT: { //2琛ㄧず(寮�锛屽叧)鍔熻兘 SwitchBrightnessView(fLayout, device, index, edit, 2); } break; - case FunctionType.Relay: + case SPK.LightSwitch: { //2琛ㄧず(寮�锛屽叧)鍔熻兘 SwitchView(fLayout, device, index, edit, 2); } break; //绐楀笜 - case FunctionType.Curtain: - case FunctionType.MotorCurtain: - case FunctionType.RollingShutter: + case SPK.CurtainSwitch: + case SPK.CurtainTrietex: + case SPK.CurtainRoller: { //3琛ㄧず(寮�锛屽叧锛屾殏鍋�)鍔熻兘 SwitchView(fLayout, device, index, edit, 3); } break; - case FunctionType.AC: + case SPK.AcStandard: { #region 鐣岄潰 ///寮�鍏� @@ -113,7 +115,7 @@ temperatureView.btnState.Text = stateStr; //璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�; string keyVlaue = "set_temp"; - selectedState = device.functionType + "_"+ keyVlaue; + selectedState = device.spk + "_"+ keyVlaue; string set_temp_value = stateStr.Replace("鈩�", ""); //鏁版嵁灏佽 Dictionary<string, string> dic = new Dictionary<string, string>(); @@ -131,7 +133,7 @@ string currText = acModehView.btnState.Text; //璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�; string keyVlaue = "mode"; - selectedState = device.functionType + "_"+keyVlaue; + selectedState = device.spk + "_"+keyVlaue; PublicInterface modeView = new PublicInterface(); var modeListStr= modeView.GetViewList(keyVlaue); modeView.SingleSelectionShow(this, modeListStr, Language.StringByID(StringId.modeLogic), currText @@ -156,7 +158,7 @@ string currText = acSpeedView.btnState.Text; //璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�; string keyVlaue = "fan"; - selectedState = device.functionType + "_" + keyVlaue; + selectedState = device.spk + "_" + keyVlaue; PublicInterface speedView = new PublicInterface(); var speedListStr = speedView.GetViewList(keyVlaue); speedView.SingleSelectionShow(this, speedListStr, Language.StringByID(StringId.speedLogic), currText @@ -181,7 +183,7 @@ #endregion } break; - case FunctionType.FloorHeating: + case SPK.FloorHeatStandard: { #region 鐣岄潰 ///寮�鍏� @@ -219,7 +221,7 @@ temperatureView.btnState.Text = stateStr; //璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�; string keyVlaue = "set_temp"; - selectedState = device.functionType + "_"+ keyVlaue; + selectedState = device.spk + "_"+ keyVlaue; string set_temp_value = stateStr.Replace("鈩�", ""); //鏁版嵁灏佽 Dictionary<string, string> dic = new Dictionary<string, string>(); @@ -239,7 +241,7 @@ string currText= floorHeatingModehView.btnState.Text; //璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�; string keyVlaue = "mode"; - selectedState = device.functionType + "_"+ keyVlaue; + selectedState = device.spk + "_"+ keyVlaue; PublicInterface modeView = new PublicInterface(); var modeListStr = modeView.GetViewList("floorheatingmode"); @@ -278,12 +280,12 @@ Output outputDevice = new Output(); outputDevice.target_type = "1"; outputDevice.sid = device.sid; - switch (device.functionType) + switch (device.spk) { - case FunctionType.Dimmer: - case FunctionType.RGB: - case FunctionType.RGBW: - case FunctionType.ColorTemperature: + case SPK.LightDimming: + case SPK.LightRGB: + case SPK.LightRGBW: + case SPK.LightCCT: { //璋冨厜鍋氫簡涓�涓壒娈婂鐞嗭紱 if (dicSateteList.Count > 1) @@ -309,8 +311,8 @@ } break; } - case FunctionType.AC: - case FunctionType.FloorHeating: + case SPK.AcStandard: + case SPK.FloorHeatStandard: { //(绌鸿皟/鍦扮儹)鍋氫簡涓�涓壒娈婂鐞嗭紱 @@ -421,7 +423,7 @@ ///浜害 LogicView.FunTypeView brightnessView = new LogicView.FunTypeView(); brightnessView.frameLayout.Y = lightSwitchView.frameLayout.Bottom; - if (device.functionType == FunctionType.MotorCurtain || device.functionType == FunctionType.RollingShutter) + if (device.spk == SPK.CurtainTrietex || device.spk == SPK.CurtainRoller) { brightnessView.btnText.TextID = StringId.percentum; @@ -466,7 +468,7 @@ }; this.AddChidren(frame); LogicView.SwitchView switchView = new LogicView.SwitchView(); - switchView.FLayoutView(frame, len, button.Text, (strValue) => + switchView.FLayoutView(frame, len, button.Text, (Action<string>)((strValue) => { int id = 0; switch (strValue) { @@ -483,7 +485,7 @@ } //鐣岄潰鏄剧ず閫変腑鍊� button.TextID = id; - selectedState = device.functionType + "_" + strValue; + selectedState = device.spk + "_" + strValue; string keyVlaue = "on_off"; //鏁版嵁灏佽 Dictionary<string, string> dic = new Dictionary<string, string>(); @@ -491,7 +493,7 @@ LogicMethod.dictionary(dic, "value", strValue); AddDictionaryData(dicSateteList, keyVlaue, dic); - }); + })); #endregion } /// <summary> @@ -505,28 +507,28 @@ //涔嬪墠鐨勭姸鎬佸�� string stateVlaue = button.Text; LogicView.BrightnessView brightness = new LogicView.BrightnessView(); - brightness.FLayoutView(this, titleName, stateVlaue, (brightnesValue) => + brightness.FLayoutView(this, titleName, stateVlaue, (Action<string>)((brightnesValue) => { //鐣岄潰鏄剧ず閫変腑鍊� button.Text = brightnesValue+"%"; string keyVlaue = ""; - selectedState = device.functionType + brightnesValue.ToString(); + selectedState = device.spk + brightnesValue.ToString(); //鏁版嵁灏佽 Dictionary<string, string> dic = new Dictionary<string, string>(); - switch (device.functionType) + switch (device.spk) { //寮�鍏崇伅鍏� light.Switch - case FunctionType.Dimmer: - case FunctionType.RGB: - case FunctionType.RGBW: - case FunctionType.ColorTemperature: + case SPK.LightDimming: + case SPK.LightRGB: + case SPK.LightRGBW: + case SPK.LightCCT: { LogicMethod.dictionary(dic, "key", "brightness"); keyVlaue = "brightness"; } break; - case FunctionType.MotorCurtain: - case FunctionType.RollingShutter: + case SPK.CurtainTrietex: + case SPK.CurtainRoller: { LogicMethod.dictionary(dic, "key", "percent"); keyVlaue = "percent"; @@ -535,7 +537,7 @@ } LogicMethod.dictionary(dic, "value", brightnesValue.ToString()); AddDictionaryData(dicSateteList, keyVlaue, dic); - }); + })); #endregion } -- Gitblit v1.8.0