| | |
| | | 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);
|
| | | };
|
| | |
| | | btnStop.Y = btnOpen.Y;
|
| | | btnStop.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //如果住宅为虚拟住宅,则此功能无效
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | return;
|
| | | }
|
| | | //发送窗帘命令
|
| | | this.SetCurtainCommand(2);
|
| | | };
|
| | |
| | | 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);
|
| | | };
|
| | |
| | | //卷帘控件
|
| | | 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);
|
| | |
| | | //变更进度百分比的显示
|
| | | 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)
|
| | |
| | | //开合帘控件
|
| | | 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;
|
| | |
| | | {
|
| | | 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;
|
| | | }
|
| | | };
|
| | |
|
| | | //开一个线程,监视是否滑动的滑动条,每秒检测一次
|