From d22864834edebb8215886f2286b028fcdd00d6b0 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期三, 23 三月 2022 15:32:23 +0800
Subject: [PATCH] 2022-01-23-01
---
HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs | 124 +++++++++++++++++++++++++++++------------
1 files changed, 87 insertions(+), 37 deletions(-)
diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
index e4a3f68..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);
@@ -302,7 +352,7 @@
a31player.SetAttrState("song_step", "up");
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add("song_step", "up");
- SendMethod.sendMethod.SendControlCommand(a31player, dic);
+ SendMethod.mMethod.SendControlCommand(a31player, dic);
};
btnPrev.MouseUpEventHandler = (sender, e) =>
{
@@ -325,7 +375,7 @@
a31player.SetAttrState("on_off", status);
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add("on_off", status);
- SendMethod.sendMethod.SendControlCommand(a31player, dic);
+ SendMethod.mMethod.SendControlCommand(a31player, dic);
};
///涓嬩竴鏇茬偣鍑讳簨浠�
btnNext.MouseDownEventHandler = (sender, e) =>
@@ -334,7 +384,7 @@
a31player.SetAttrState("song_step", "down");
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add("song_step", "down");
- SendMethod.sendMethod.SendControlCommand(a31player, dic);
+ SendMethod.mMethod.SendControlCommand(a31player, dic);
};
btnNext.MouseUpEventHandler = (sender, e) =>
{
--
Gitblit v1.8.0