From d44d009da78f96fe50e6dc7c1883e79ffb1aff58 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期五, 18 三月 2022 16:42:01 +0800 Subject: [PATCH] 2022=03-18-01 --- HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs | 141 +++++++++++++++++++++++++++++++++------------- 1 files changed, 100 insertions(+), 41 deletions(-) diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs index cdaef53..d579862 100644 --- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs +++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs @@ -79,6 +79,16 @@ btnSwitch.MouseUpEventHandler = (sender, e) => { + if (!function.online)//绂荤嚎涓嶅厑璁告搷浣� + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } btnSwitch.IsSelected = !btnSwitch.IsSelected; if(SPK.NotStatusSpkList.Contains( function.spk )) @@ -109,34 +119,24 @@ } #region 鐏厜鐨勪簨浠跺垪琛� - /// <summary> - /// 鐏厜寮�鍏充簨浠� - /// </summary> - void LoadEvent_LightSwitch(Button btnSwitch) - { - btnSwitch.MouseUpEventHandler += (sender, e) => - { - btnSwitch.IsSelected = !btnSwitch.IsSelected; - new System.Threading.Thread(() => - { - if (SPK.LightSpkList().Contains( function.spk)) - { - function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; - Dictionary<string, string> d = new Dictionary<string, string>(); - d.Add("on_off", function.trait_on_off.curValue.ToString()); - Control.Ins.SendWriteCommand(function, d); - } - }) - { IsBackground = true }.Start(); - }; - } + /// <summary> /// 鐏厜浜害璋冭妭浜嬩欢 /// </summary> void LoadEvent_LightDimming(DiyImageSeekBar dimmerControlBar) { - if(function.spk == SPK.LightDimming || function.spk == SPK.LightRGB) + if (!function.online)//绂荤嚎涓嶅厑璁告搷浣� + { + //new Tip() + //{ + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + //}.Show(MainPage.BaseView); + return; + } + if (function.spk == SPK.LightDimming || function.spk == SPK.LightRGB) { dimmerControlBar.OnStartTrackingTouchEvent = (sender, e) => { onDimmerBar = true; @@ -192,41 +192,71 @@ /// <param name="btnStop"></param> /// <param name="btnOpen"></param> /// <param name="btnClose"></param> - void LoadEvent_ControlCurtain(Button btnStop, Button btnOpen, Button btnClose, Function curtain) + void LoadEvent_ControlCurtain(Button btnStop, Button btnOpen, Button btnClose) { btnClose.MouseUpEventHandler = (sender, e) => { + if (!function.online)//绂荤嚎涓嶅厑璁告搷浣� + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } btnClose.IsSelected = true; btnStop.IsSelected = false; btnOpen.IsSelected = false; - curtain.trait_on_off.curValue = "off"; - curtain.SetAttrState(FunctionAttributeKey.Percent, 0); + function.trait_on_off.curValue = "off"; + function.SetAttrState(FunctionAttributeKey.Percent, 0); Dictionary<string, string> d = new Dictionary<string, string>(); - d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); - Control.Ins.SendWriteCommand(curtain, d); + d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); + Control.Ins.SendWriteCommand(function, d); }; btnStop.MouseUpEventHandler = (sender, e) => { + if (!function.online)//绂荤嚎涓嶅厑璁告搷浣� + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } btnStop.IsSelected = true; btnClose.IsSelected = false; btnOpen.IsSelected = false; - curtain.trait_on_off.curValue = "stop"; + function.trait_on_off.curValue = "stop"; Dictionary<string, string> d = new Dictionary<string, string>(); - d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); - Control.Ins.SendWriteCommand(curtain, d); + d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); + Control.Ins.SendWriteCommand(function, d); }; btnOpen.MouseUpEventHandler = (sender, e) => { + if (!function.online)//绂荤嚎涓嶅厑璁告搷浣� + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } btnOpen.IsSelected = true; btnClose.IsSelected = false; btnStop.IsSelected = false; - curtain.trait_on_off.curValue = "on"; - curtain.SetAttrState(FunctionAttributeKey.Percent, 100); + function.trait_on_off.curValue = "on"; + function.SetAttrState(FunctionAttributeKey.Percent, 100); Dictionary<string, string> d = new Dictionary<string, string>(); - d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); - Control.Ins.SendWriteCommand(curtain, d); + d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); + Control.Ins.SendWriteCommand(function, d); }; } #endregion @@ -243,6 +273,16 @@ }; btnUp.MouseUpEventHandler = (sender, e) => { + if (!function.online)//绂荤嚎涓嶅厑璁告搷浣� + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } new System.Threading.Thread(() => { System.Threading.Thread.Sleep(2000); @@ -264,6 +304,16 @@ }; btnDown.MouseUpEventHandler = (sender, e) => { + if (!function.online)//绂荤嚎涓嶅厑璁告搷浣� + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } new System.Threading.Thread(() => { System.Threading.Thread.Sleep(2000); @@ -291,7 +341,7 @@ /// <param name="btnOpen"></param> /// <param name="btnClose"></param> /// <param name="curtain"></param> - void LoadEvent_ControlMusic(Button btnPlay,Button btnNext,Button btnPrev, A31MusicModel a31player) + void LoadEvent_ControlMusic(Button btnPlay,Button btnNext,Button btnPrev, Function a31player) { if (a31player == null) return; @@ -299,7 +349,10 @@ btnPrev.MouseDownEventHandler = (sender, e) => { btnPrev.IsSelected = true; - SendMethod.Previous(a31player); + a31player.SetAttrState("song_step", "up"); + Dictionary<string, string> dic = new Dictionary<string, string>(); + dic.Add("song_step", "up"); + SendMethod.mMethod.SendControlCommand(a31player, dic); }; btnPrev.MouseUpEventHandler = (sender, e) => { @@ -308,24 +361,30 @@ ///鏆傚仠/鎾斁鐐瑰嚮浜嬩欢 btnPlay.MouseDownEventHandler = (sender, e) => { + string status = "off"; if (btnPlay.IsSelected) { btnPlay.IsSelected = false; - SendMethod.Pause(a31player); - a31player.A31PlayStatus.status = "pause"; + status = "off"; } else { btnPlay.IsSelected = true; - SendMethod.Play(a31player); - a31player.A31PlayStatus.status = "play"; + status = "on"; } + a31player.SetAttrState("on_off", status); + Dictionary<string, string> dic = new Dictionary<string, string>(); + dic.Add("on_off", status); + SendMethod.mMethod.SendControlCommand(a31player, dic); }; ///涓嬩竴鏇茬偣鍑讳簨浠� btnNext.MouseDownEventHandler = (sender, e) => { btnNext.IsSelected = true; - SendMethod.Next(a31player); + a31player.SetAttrState("song_step", "down"); + Dictionary<string, string> dic = new Dictionary<string, string>(); + dic.Add("song_step", "down"); + SendMethod.mMethod.SendControlCommand(a31player, dic); }; btnNext.MouseUpEventHandler = (sender, e) => { -- Gitblit v1.8.0