From d5088d3bb198c0f53d4716022f010a02ac393977 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期四, 25 八月 2022 15:06:01 +0800 Subject: [PATCH] 2022年08月25日15:04:41 --- HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs | 103 ++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 85 insertions(+), 18 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs index 2fe4c85..8ca2a76 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs @@ -81,7 +81,7 @@ if (edit) { //鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬� - GetEditState(device, index, lightSwitchView.btnState, null, null, null); + GetEditDeviceState(device, index, lightSwitchView.btnState, null, null, null); } #endregion } @@ -121,7 +121,7 @@ if (edit) { //鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬� - GetEditState(device, index, lightSwitchView.btnState, brightnessView.btnState, null, null); + GetEditDeviceState(device, index, lightSwitchView.btnState, brightnessView.btnState, null, null); } #endregion } @@ -145,7 +145,7 @@ if (edit) { //鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬� - GetEditState(device, index, curtainSwitchView.btnState, null, null, null); + GetEditDeviceState(device, index, curtainSwitchView.btnState, null, null, null); } #endregion } @@ -181,7 +181,7 @@ if (edit) { //鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬� - GetEditState(device, index, curtainSwitchView.btnState, crtainPercentumView.btnState, null, null); + GetEditDeviceState(device, index, curtainSwitchView.btnState, crtainPercentumView.btnState, null, null); } #endregion } @@ -218,7 +218,7 @@ if (edit) { //鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬� - GetEditState(device, index, crtainPercentumView.btnState, AngleView.btnState, null, null); + GetEditDeviceState(device, index, crtainPercentumView.btnState, AngleView.btnState, null, null); } #endregion } @@ -322,13 +322,14 @@ if (edit) { //鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬� - GetEditState(device, index, acSwitchVie.btnState, temperatureView.btnState, acModehView.btnState, acSpeedView.btnState); + GetEditDeviceState(device, index, acSwitchVie.btnState, temperatureView.btnState, acModehView.btnState, acSpeedView.btnState); } #endregion } break; - case SPK.FloorHeatStandard:case SPK.HvacFloorHeat: + case SPK.FloorHeatStandard: + case SPK.HvacFloorHeat: { #region 鐣岄潰 ///寮�鍏� @@ -402,7 +403,7 @@ if (edit) { //鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬� - GetEditState(device, index, floorHeatingSwitchVie.btnState, temperatureView.btnState, floorHeatingModehView.btnState, null); + GetEditDeviceState(device, index, floorHeatingSwitchVie.btnState, temperatureView.btnState, floorHeatingModehView.btnState, null); } #endregion @@ -488,7 +489,72 @@ if (edit) { //鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬� - GetEditState(device, index, AirFreshSwitchVie.btnState, AirFreshSpeedView.btnState, null, null); + GetEditDeviceState(device, index, AirFreshSwitchVie.btnState, AirFreshSpeedView.btnState, null, null); + } + + #endregion + } + break; + //闊充箰 + case SPK.MusicStandard: + case SPK.AvMusic: + { + #region 鐣岄潰 + //鎻愮ず璇煶 + LogicView.FunTypeView funTypeView = new LogicView.FunTypeView(); + funTypeView.btnText.TextID = StringId.tishiyin; + fLayout.AddChidren(funTypeView.FLayoutView()); + + ///璁惧寤舵椂iewv + DelayView(fLayout, funTypeView.frameLayout.Bottom); + #endregion + #region 鐐瑰嚮浜嬩欢 + ///鎻愮ず璇煶鐐瑰嚮浜嬩欢 + funTypeView.btnClick.MouseUpEventHandler += (sender, e) => + { + selectedState = device.spk + "_"; + Loading loading = new Loading(); + this.AddChidren(loading); + loading.Start(); + System.Threading.Tasks.Task.Run(() => + { + try + { + //HDL_ON.DriverLayer.Control.Ins.GetMusicDirectory(device); + //var palyListName = Music.SendMethod.mMethod.GetListName(device); + var palyList= Music.SendMethod.mMethod.GetListMusic(device, "hdl_special"); + List<string> musicNameList = new List<string>(); + for (int i = 0; i < palyList.songs.Count; i++) + { + var music = palyList.songs[i]; + musicNameList.Add(music.name); + } + Application.RunOnMainThread(() => + { + loading.Hide(); + PublicInterface publicInterface = new PublicInterface(); + publicInterface.FrameOrVv(this, musicNameList, new List<string> { funTypeView.btnState.Text }, palyList.group, (index) => + { + var musicSelecetd = palyList.songs[index]; + //鐣岄潰鏄剧ず閫変腑鍊� + funTypeView.btnState.Text = musicSelecetd.name; + //鏁版嵁灏佽 + AddDictionary("playlist_name", palyList.group);//鍒楄〃鍚� + AddDictionary("song_name", musicSelecetd.name);//姝屾洸鍚� + + },false); + + }); + } + catch { } + + }); + }; + + if (edit) + { + //鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬� + GetEditDeviceState(device, index, funTypeView.btnState, null, null, null); } #endregion @@ -505,7 +571,7 @@ Output outputDevice = new Output(); outputDevice.target_type = "1"; outputDevice.sid = device.sid; - outputDevice.delay= strdelay; + outputDevice.delay = strdelay; switch (device.spk) { case SPK.LightDimming: @@ -539,7 +605,8 @@ } case SPK.HvacAC: case SPK.AcStandard: - case SPK.FloorHeatStandard:case SPK.HvacFloorHeat: + case SPK.FloorHeatStandard: + case SPK.HvacFloorHeat: { //鍋氫簡涓�涓壒娈婂鐞嗭紱 bool _bool = false; @@ -563,7 +630,7 @@ } } break; - + } outputDevice.status = dicSateteList; @@ -592,7 +659,7 @@ this.RemoveFromParent(); return; } - LogicMethod.CurrLogicMethod.RemoveAllView(); + LogicMethod.Current.RemoveAllView(); AddLogic addLogic = new AddLogic(); MainPage.BasePageView.AddChidren(addLogic); addLogic.Show(); @@ -716,7 +783,7 @@ break; } //鏁版嵁灏佽 - AddDictionary(keyVlaue, brightnesValue); + AddDictionary(keyVlaue, brightnesValue); }); #endregion @@ -730,7 +797,7 @@ /// <param name="button2">鏄剧ずBtn</param> /// <param name="button3">鏄剧ずBtn</param> /// <param name="button4">鏄剧ずBtn</param> - private void GetEditState(Entity.Function device, int index, Button button1, Button button2, Button button3, Button button4) + private void GetEditDeviceState(Entity.Function device, int index, Button button1, Button button2, Button button3, Button button4) { Output outputs = Logic.currlogic.output[index]; var dicList = outputs.status; @@ -747,7 +814,7 @@ this.btnDelay.Text = outputs.delay + "s"; this.strdelay = outputs.delay; } - InpOrOutLogicMethod.EditState(device, dicList, button1, button2, button3, button4); + InpOrOutLogicMethod.Current.EditDeviceState(device, dicList, button1, button2, button3, button4); } /// <summary> /// 娣诲姞閫変腑鏁版嵁 @@ -758,8 +825,8 @@ { //鏁版嵁灏佽 Dictionary<string, string> dic = new Dictionary<string, string>(); - LogicMethod.CurrLogicMethod.dictionary(dic, "key", KeyValue); - LogicMethod.CurrLogicMethod.dictionary(dic, "value", selectedValue); + LogicMethod.Current.dictionary(dic, "key", KeyValue); + LogicMethod.Current.dictionary(dic, "value", selectedValue); AddDictionaryList(KeyValue, dic); } /// <summary> -- Gitblit v1.8.0