From ec5a167e0366a75642e45dbd30817c1c8ae57e79 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 11 九月 2023 15:34:29 +0800 Subject: [PATCH] 备份 --- OnPro/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs | 161 +++++++++++------------------------------------------ 1 files changed, 33 insertions(+), 128 deletions(-) diff --git a/OnPro/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs b/OnPro/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs index 39f76e8..f377313 100644 --- a/OnPro/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs +++ b/OnPro/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs @@ -139,16 +139,6 @@ { btnCurtainClose.MouseUpEventHandler = (sender, e) => { - if (!function.isOnline()) - { - 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); @@ -168,16 +158,6 @@ btnCurtainStop.MouseUpEventHandler = (sender, e) => { - if (!function.isOnline()) - { - new Tip() - { - CloseTime = 1, - Text = Language.StringByID(StringId.DeviceOfflineCannotOption), - Direction = AMPopTipDirection.None, - }.Show(MainPage.BaseView); - return; - } onCurtainAnimation = false; new System.Threading.Thread(() => { @@ -196,16 +176,6 @@ btnCurtainOpen.MouseUpEventHandler = (sender, e) => { - if (!function.isOnline()) - { - 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); @@ -223,108 +193,43 @@ CurtainAnimation(100); }; - if (function.isOnline()) + btnCurtainStop.MouseDownEventHandler = (sender, e) => { - btnCurtainStop.MouseDownEventHandler = (sender, e) => - { - btnCurtainStop.IsSelected = true; - btnCurtainClose.IsSelected = false; - btnCurtainOpen.IsSelected = false; - }; - btnCurtainOpen.MouseDownEventHandler = (sender, e) => - { - btnCurtainOpen.IsSelected = true; - btnCurtainClose.IsSelected = false; - btnCurtainStop.IsSelected = false; - }; - btnCurtainClose.MouseDownEventHandler = (sender, e) => - { - btnCurtainClose.IsSelected = true; - btnCurtainOpen.IsSelected = false; - btnCurtainStop.IsSelected = false; - }; + btnCurtainStop.IsSelected = true; + btnCurtainClose.IsSelected = false; + btnCurtainOpen.IsSelected = false; + }; + btnCurtainOpen.MouseDownEventHandler = (sender, e) => + { + btnCurtainOpen.IsSelected = true; + btnCurtainClose.IsSelected = false; + btnCurtainStop.IsSelected = false; + }; + btnCurtainClose.MouseDownEventHandler = (sender, e) => + { + btnCurtainClose.IsSelected = true; + btnCurtainOpen.IsSelected = false; + btnCurtainStop.IsSelected = false; + }; - //btnMinusSignIcon.MouseUpEventHandler = (sender, e) => - //{ - // function.percent--; - // controlBar.Progress = function.percent; - // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - // d.Add(FunctionAttributeKey.Percent, function.percent.ToString()); - // DriverLayer.Control.Ins.SendWriteCommand(function, d); - //}; - - //btnPlusSgnIcon.MouseUpEventHandler = (sender, e) => - //{ - // function.percent++; - // controlBar.Progress = function.percent; - // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - // d.Add(FunctionAttributeKey.Percent, function.percent.ToString()); - // DriverLayer.Control.Ins.SendWriteCommand(function, d); - //}; - - curtainSeekBar.OnProgressChangedEvent = (sender, e) => - { - btnProgress.Text = curtainSeekBar.Progress + "%"; - // controlBar.Progress = curtainSeekBar.Progress; - // new System.Threading.Thread(() => - // { - // if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300) - // { - // function.percent = e; - // function.refreshTime = DateTime.Now; - // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - // d.Add("percent", function.percent.ToString()); - // Control.SendWriteCommand(function, d); - // } - // }) - // { IsBackground = true }.Start(); - }; - curtainSeekBar.OnStopTrackingTouchEvent = (sender, e) => - { - btnProgress.Text = curtainSeekBar.Progress + "%"; + curtainSeekBar.OnProgressChangedEvent = (sender, e) => + { + btnProgress.Text = curtainSeekBar.Progress + "%"; + }; + curtainSeekBar.OnStopTrackingTouchEvent = (sender, e) => + { + btnProgress.Text = curtainSeekBar.Progress + "%"; //controlBar.Progress = curtainSeekBar.Progress; new System.Threading.Thread(() => - { - function.SetAttrState(FunctionAttributeKey.Percent, e); - function.refreshTime = DateTime.Now; - System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - d.Add(FunctionAttributeKey.Percent, e.ToString()); - DriverLayer.Control.Ins.SendWriteCommand(function, d); - }) - { IsBackground = true }.Start(); - }; - - //controlBar.OnProgressChangedEvent = (sender, e) => - //{ - // curtainSeekBar.Progress = controlBar.Progress; - // new System.Threading.Thread(() => - // { - // if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300) - // { - // function.percent = e; - // function.refreshTime = DateTime.Now; - // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - // d.Add("percent", function.percent.ToString()); - // Control.SendWriteCommand(function, d); - // } - // }) - // { IsBackground = true }.Start(); - //}; - - //controlBar.OnStopTrackingTouchEvent = (sender, e) => - //{ - // curtainSeekBar.Progress = controlBar.Progress; - // new System.Threading.Thread(() => - // { - // function.percent = e; - // function.refreshTime = DateTime.Now; - // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - // d.Add("percent", function.percent.ToString()); - // DriverLayer.Control.Ins.SendWriteCommand(function, d); - // }) - // { IsBackground = true }.Start(); - //}; - } + { + function.SetAttrState(FunctionAttributeKey.Percent, e); + function.refreshTime = DateTime.Now; + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.Percent, e.ToString()); + DriverLayer.Control.Ins.SendWriteCommand(function, d); + }) + { IsBackground = true }.Start(); + }; } } } -- Gitblit v1.8.0