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/RollingShutterPageBLL.cs |  172 +++++++++++++--------------------------------------------
 1 files changed, 40 insertions(+), 132 deletions(-)

diff --git a/OnPro/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs b/OnPro/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs
index 373ccd5..711e299 100644
--- a/OnPro/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs
+++ b/OnPro/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs
@@ -138,16 +138,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);
@@ -167,19 +157,12 @@
 
             btnCurtainStop.MouseUpEventHandler = (sender, e) =>
             {
-                if (!function.isOnline())
+
+                new System.Threading.Thread(() =>
                 {
-                    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);
-                    Application.RunOnMainThread(() => {
+                    Application.RunOnMainThread(() =>
+                    {
                         btnCurtainStop.IsSelected = false;
                     });
                 })
@@ -193,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);
@@ -220,110 +193,45 @@
                 //CurtainAnimation(0);
             };
 
-            //btnMinusSignIcon.MouseUpEventHandler = (sender, e) =>
-            //{
-            //    controlBar.Progress -= 1;
-            //    function.SetAttrState(FunctionAttributeKey.Percent, controlBar.Progress);
-            //    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
-            //    d.Add(FunctionAttributeKey.Percent, controlBar.Progress.ToString());
-            //    DriverLayer.Control.Ins.SendWriteCommand(function, d);
-            //};
-
-            //btnPlusSgnIcon.MouseUpEventHandler = (sender, e) =>
-            //{
-            //    controlBar.Progress += 1;
-            //    function.SetAttrState(FunctionAttributeKey.Percent, controlBar.Progress);
-            //    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
-            //    d.Add(FunctionAttributeKey.Percent, controlBar.Progress.ToString());
-            //    DriverLayer.Control.Ins.SendWriteCommand(function, d);
-            //};
-
-            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;
-                };
-
-
-                //curtainSeekBar.OnProgressChangedEvent = (sender, e) =>
-                //{
-                //    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) =>
-                {
-                //controlBar.Progress = curtainSeekBar.Progress;
-                btnProgress.Text = 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();
-                };
-
-                curtainSeekBar.OnProgressChangedEvent = (sender, e) =>
-                {
-                    btnProgress.Text = 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();
+                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;
             };
 
-                //controlBar.OnStopTrackingTouchEvent = (sender, e) =>
-                //{
-                //    curtainSeekBar.Progress = controlBar.Progress;
-                //    btnProgress.Text = 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("percent", e.ToString());
-                //        DriverLayer.Control.Ins.SendWriteCommand(function, d);
-                //    })
-                //    { IsBackground = true }.Start();
-                //};
-            }
+
+            curtainSeekBar.OnStopTrackingTouchEvent = (sender, e) =>
+            {
+                //controlBar.Progress = curtainSeekBar.Progress;
+                btnProgress.Text = 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();
+            };
+
+            curtainSeekBar.OnProgressChangedEvent = (sender, e) =>
+            {
+                btnProgress.Text = curtainSeekBar.Progress + "%";
+            };
         }
     }
 }

--
Gitblit v1.8.0