黄学彪
2020-04-28 e22fdb94322e6cec38e5e4a9aec13d431a133fde
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceCurtainDetailCardForm.cs
@@ -83,6 +83,22 @@
            btnOpen.Y = Application.GetRealHeight(994) - btnOpen.YOffset;
            btnOpen.ButtonClickEvent += (sender, e) =>
            {
                //如果住宅为虚拟住宅,则此功能无效
                if (Common.Config.Instance.Home.IsVirtually == true)
                {
                    ((Rollershade)device).WcdCurrentPositionLiftPercentage = 100;
                    if (this.WcdType == 0)
                    {
                        SeekBarSiphonateCurtain.Progress = 100;
                    }
                    else
                    {
                        SeekBarOpenCurtain.Progress = 100;
                    }
                    //设置状态文字
                    this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
                    return;
                }
                //发送窗帘命令
                this.SetCurtainCommand(0);
            };
@@ -98,6 +114,11 @@
            btnStop.Y = btnOpen.Y;
            btnStop.ButtonClickEvent += (sender, e) =>
            {
                //如果住宅为虚拟住宅,则此功能无效
                if (Common.Config.Instance.Home.IsVirtually == true)
                {
                    return;
                }
                //发送窗帘命令
                this.SetCurtainCommand(2);
            };
@@ -111,6 +132,22 @@
            btnClose.Y = btnOpen.Y;
            btnClose.ButtonClickEvent += (sender, e) =>
            {
                //如果住宅为虚拟住宅,则此功能无效
                if (Common.Config.Instance.Home.IsVirtually == true)
                {
                    ((Rollershade)device).WcdCurrentPositionLiftPercentage = 0;
                    if (this.WcdType == 0)
                    {
                        SeekBarSiphonateCurtain.Progress = 0;
                    }
                    else
                    {
                        SeekBarOpenCurtain.Progress = 0;
                    }
                    //设置状态文字
                    this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
                    return;
                }
                //发送窗帘命令
                this.SetCurtainCommand(1);
            };
@@ -143,8 +180,8 @@
            //卷帘控件
            this.SeekBarSiphonateCurtain = new CurtainRollSeekBar();
            SeekBarSiphonateCurtain.Y = Application.GetRealHeight(300);
            SeekBarSiphonateCurtain.Width = Application.GetMinRealAverage(438);
            SeekBarSiphonateCurtain.Height = Application.GetMinRealAverage(576);
            SeekBarSiphonateCurtain.Width = this.GetPictrueRealSize(438);
            SeekBarSiphonateCurtain.Height = this.GetPictrueRealSize(576);
            SeekBarSiphonateCurtain.Gravity = Gravity.CenterHorizontal;
            SeekBarSiphonateCurtain.Progress = (device as Rollershade).WcdCurrentPositionLiftPercentage;
            frameWhiteBack.AddChidren(SeekBarSiphonateCurtain);
@@ -193,7 +230,16 @@
                //变更进度百分比的显示
                btnProgress.Y = progressY + SeekBarSiphonateCurtain.NowProgressY;
                btnProgress.Text = value + "%";
                nowProgressValue = value;
                if (Common.Config.Instance.Home.IsVirtually == false)
                {
                    nowProgressValue = value;
                }
                else
                {
                    //如果住宅为虚拟住宅,直接改缓存
                    (device as Rollershade).WcdCurrentPositionLiftPercentage = value;
                }
            };
            if (this.hadInitControl == true)
@@ -233,8 +279,8 @@
            //开合帘控件
            this.SeekBarOpenCurtain = new CurtainSeekBar();
            SeekBarOpenCurtain.Y = Application.GetRealHeight(334);
            SeekBarOpenCurtain.Width = Application.GetMinRealAverage(570);
            SeekBarOpenCurtain.Height = Application.GetMinRealAverage(513);
            SeekBarOpenCurtain.Width = this.GetPictrueRealSize(570);
            SeekBarOpenCurtain.Height = this.GetPictrueRealSize(513);
            SeekBarOpenCurtain.Gravity = Gravity.CenterHorizontal;
            SeekBarOpenCurtain.IsProgressTextShow = false;
            SeekBarOpenCurtain.Progress = (device as Rollershade).WcdCurrentPositionLiftPercentage;
@@ -280,7 +326,16 @@
            {
                btnProgress.X = progressX + SeekBarOpenCurtain.NowProgressX - Application.GetMinReal(5);
                btnProgress.Text = value + "%";
                nowProgressValue = value;
                if (Common.Config.Instance.Home.IsVirtually == false)
                {
                    nowProgressValue = value;
                }
                else
                {
                    //如果住宅为虚拟住宅,直接修改缓存
                    (device as Rollershade).WcdCurrentPositionLiftPercentage = value;
                }
            };
            //开一个线程,监视是否滑动的滑动条,每秒检测一次