wxr
2023-09-11 ec5a167e0366a75642e45dbd30817c1c8ae57e79
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);
@@ -219,27 +192,6 @@
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                //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) =>
                {
@@ -261,22 +213,6 @@
                };
                //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;
@@ -295,35 +231,7 @@
                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();
            };
                //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();
                //};
            }
        }
    }
}