From d3189eaa6be7c70ed5ac783efe68f43211a90d27 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 20 七月 2023 08:58:56 +0800 Subject: [PATCH] Merge branch 'Dev-Branch' of http://172.16.1.23:6688/r/~wxr/OnPro into Dev-Branch --- HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs | 148 +++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 129 insertions(+), 19 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs index d9b1b60..3518292 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs @@ -2,6 +2,7 @@ using Shared; using System.Collections.Generic; using HDL_ON.Entity; +using HDL_ON.UI.CSS; namespace HDL_ON.UI.UI2.Intelligence.Automation { @@ -113,8 +114,8 @@ break; //鐏厜寮�鍏� 浜害 case SPK.LightDimming: - case SPK.LightRGB: - case SPK.LightRGBW: + //case SPK.LightRGB: + //case SPK.LightRGBW: { #region 鐣岄潰 ///寮�鍏� @@ -146,6 +147,60 @@ { //鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬� GetEditDeviceState(device, index, lightSwitchView.btnState, brightnessView.btnState, null, null); + } + #endregion + } + break; + case SPK.LightRGB: + case SPK.LightRGBW: + { + #region 鐣岄潰 + ///寮�鍏� + LogicView.FunTypeView lightSwitchView = new LogicView.FunTypeView(); + lightSwitchView.btnText.TextID = StringId.switchLogic; + fLayout.AddChidren(lightSwitchView.FLayoutView()); + ///浜害 + LogicView.FunTypeView brightnessView = new LogicView.FunTypeView(); + brightnessView.frameLayout.Y = lightSwitchView.frameLayout.Bottom; + brightnessView.btnText.TextID = StringId.brightnesLogic; + fLayout.AddChidren(brightnessView.FLayoutView()); + brightnessView.btnState.Text = "5%";//浜у搧缁忕悊鏅撹緣瑕佹眰鏀圭殑 2021-11-06 + ///RGB鑹茬洏 + LogicView.FunTypeView rgbView = new LogicView.FunTypeView(); + rgbView.frameLayout.Y = brightnessView.frameLayout.Bottom; + //rgbView.btnText.TextID = StringId.brightnesLogic; + rgbView.btnText.Text= "RGB鑹茬洏"; + rgbView.btnState.Tag = ""; + rgbView.btnState.Width = Application.GetRealWidth(16); + rgbView.btnState.Height = Application.GetRealWidth(16); + rgbView.btnState.Radius = (uint)Application.GetRealWidth(8); + rgbView.btnState.X = Application.GetRealWidth(375 - 48 - 16); + fLayout.AddChidren(rgbView.FLayoutView()); + ///璁惧寤舵椂iewv + DelayView(fLayout, rgbView.frameLayout.Bottom); + #endregion + #region 鐐瑰嚮浜嬩欢 + ///寮�鍏崇偣鍑讳簨浠� + lightSwitchView.btnClick.MouseUpEventHandler += (sender, e) => + { + SwitchViewMethod(device, lightSwitchView.btnState, 2); + }; + ///浜害鐐瑰嚮浜嬩欢 + brightnessView.btnClick.MouseUpEventHandler += (sender, e) => + { + BrightnessMethod(device, brightnessView.btnState, brightnessView.btnText.Text); + + }; + ///RGB鑹茬洏鐐瑰嚮浜嬩欢 + rgbView.btnClick.MouseUpEventHandler += (sender, e) => + { + RgbColorDiskMethod(device, rgbView.btnState, rgbView.btnText.Text); + + }; + if (edit) + { + //鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬� + GetEditDeviceState(device, index, lightSwitchView.btnState, brightnessView.btnState, rgbView.btnState, null); } #endregion } @@ -229,10 +284,10 @@ ///寮�鍏� LogicView.FunTypeView curtainSwitchView = new LogicView.FunTypeView(); curtainSwitchView.btnText.TextID = StringId.switchLogic; - fLayout.AddChidren(curtainSwitchView.FLayoutView()); + //fLayout.AddChidren(curtainSwitchView.FLayoutView());//2023骞�04鏈�17鏃�16:27:10 浜у搧瑕佹眰鐨勫幓鎺� ///鐧惧垎姣� LogicView.FunTypeView crtainPercentumView = new LogicView.FunTypeView(); - crtainPercentumView.frameLayout.Y = curtainSwitchView.frameLayout.Bottom; + //crtainPercentumView.frameLayout.Y = curtainSwitchView.frameLayout.Bottom; crtainPercentumView.btnText.TextID = StringId.percentum; fLayout.AddChidren(crtainPercentumView.FLayoutView()); crtainPercentumView.btnState.Text = "5%";//浜у搧缁忕悊鏅撹緣瑕佹眰鏀圭殑 2021-11-06 @@ -297,6 +352,7 @@ break; case SPK.AcStandard: case SPK.HvacAC: + case SPK.AcIr: { #region 鐣岄潰 ///寮�鍏� @@ -330,6 +386,9 @@ { SwitchViewMethod(device, acSwitchVie.btnState, 2); }; + 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 = InpOrOutLogicMethod.Current.GetTemperatureUnit(device); ///娓╁害鐐瑰嚮浜嬩欢 temperatureView.btnClick.MouseUpEventHandler += (sender, e) => { @@ -343,11 +402,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, unit); }; ///妯″紡鐐瑰嚮浜嬩欢 @@ -434,6 +492,9 @@ ///娓╁害鐐瑰嚮浜嬩欢 temperatureView.btnClick.MouseUpEventHandler += (sender, e) => { + 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 = InpOrOutLogicMethod.Current.GetTemperatureUnit(device); string tempValue = temperatureView.btnState.Text; LogicView.TemperatureView tempView = new LogicView.TemperatureView(); tempView.FLayoutView(this, tempValue, (stateStr) => @@ -443,11 +504,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, unit); }; ///妯″紡鐐瑰嚮浜嬩欢 @@ -599,25 +660,30 @@ { //HDL_ON.DriverLayer.Control.Ins.GetMusicDirectory(device); //var palyListName = Music.SendMethod.mMethod.GetListName(device); - var palyList= Music.SendMethod.Current.GetListMusic(device, "hdl_special"); - List<string> musicNameList = new List<string>(); + var palyList= Music.SendMethod.Current.GetSingleSongList(device, "hdl_special",""); + List<string> songNameList = new List<string>(); for (int i = 0; i < palyList.songs.Count; i++) { - var music = palyList.songs[i]; - musicNameList.Add(music.name); + var song = palyList.songs[i]; + songNameList.Add(song.name); } Application.RunOnMainThread(() => { loading.Hide(); PublicInterface publicInterface = new PublicInterface(); - publicInterface.FrameOrVv(this, musicNameList, new List<string> { funTypeView.btnState.Text }, palyList.group, (index2) => + publicInterface.FrameOrVv(this, songNameList, new List<string> { funTypeView.btnState.Text }, palyList.group, (index2) => { - var musicSelecetd = palyList.songs[index2]; + var songSelecetd = palyList.songs[index2]; //鐣岄潰鏄剧ず閫変腑鍊� - funTypeView.btnState.Text = musicSelecetd.name; + funTypeView.btnState.Text = songSelecetd.name; //鏁版嵁灏佽 AddDictionary("playlist_name", palyList.group);//鍒楄〃鍚� - AddDictionary("song_name", musicSelecetd.name);//姝屾洸鍚� + AddDictionary("song_name", songSelecetd.name);//姝屾洸鍚� + if (!string.IsNullOrEmpty(songSelecetd.url)) + { + //瀛樺湪url灏变竴璧峰彂閫佽繃鍘� + AddDictionary("url", songSelecetd.url); + } },false); @@ -694,6 +760,7 @@ break; } case SPK.HvacAC: + case SPK.AcIr: case SPK.AcStandard: case SPK.FloorHeatStandard: case SPK.HvacFloorHeat: @@ -741,7 +808,7 @@ break; } - outputDevice.status = dicSateteList; + outputDevice.status.AddRange(dicSateteList); if (edit) { @@ -939,6 +1006,47 @@ #endregion } + + /// <summary> + /// RGB鑹茬洏涓撶敤 + /// </summary> + /// <param name="device">璁惧</param> + /// <param name="button">鐘舵�佹帶浠�</param> + /// <param name="titleName">鏍囬</param> + private void RgbColorDiskMethod(Entity.Function device, Button button, string titleName) + { + LogicView.RGBColorView rgbColorView = new LogicView.RGBColorView(); + rgbColorView.LoadRGBDialog(button.Tag.ToString(), (rgbValueStr) => + { + button.BackgroundColor = rgbColorView.GetBackgroundColor(rgbValueStr); + //鐣岄潰鏄剧ず閫変腑鍊� + button.Tag = rgbValueStr; + //button.Text = rgbValueStr; + selectedState = device.spk + rgbValueStr.ToString(); + //璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�; + string keyVlaue = ""; + switch (device.spk) + { + case SPK.LightRGB: + { + keyVlaue = "rgb"; + } + break; + case SPK.LightRGBW: + { + keyVlaue = "rgbw"; + } + break; + } + //鏁版嵁灏佽 + AddDictionary(keyVlaue, rgbValueStr); + }); + + } + + + + /// <summary> /// 鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬� /// </summary> @@ -957,7 +1065,7 @@ if (dicList.Count != 0) { //鏈夋暟鎹噸鏂拌祴鍊� - dicSateteList = dicList; + dicSateteList.AddRange(dicList); } if (this.btnDelay != null) { @@ -1042,5 +1150,7 @@ } + + } } -- Gitblit v1.8.0