| | |
| | | //Log出力
|
| | | string msg = "当前激活的界面[" + UserCenterResourse.NowActionFormID + "]";
|
| | | HdlLogLogic.Current.WriteLog(ex, msg);
|
| | | //出现未知错误
|
| | | this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError));
|
| | | //电机数据异常,请重置电机
|
| | | this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uCurtainDataIsErrorPleaseResetCurtain));
|
| | | try
|
| | | {
|
| | | this.listView.RemoveAll();
|
| | |
| | | btnProgress1.Text = progressValue + "%";
|
| | | frameBack.AddChidren(btnProgress1);
|
| | | //进度条
|
| | | this.openSeekBar = new SeekBarControl(965);
|
| | | this.openSeekBar = new SeekBarControl(965);
|
| | | openSeekBar.Y = btnProgressView.Bottom + Application.GetRealHeight(46);
|
| | | openSeekBar.ProgressBarColor = 0xff288bfd;
|
| | | openSeekBar.Progress = progressValue;
|
| | |
| | | }
|
| | | oldProValue = nowValue;
|
| | | checking = true;
|
| | | if (curtainData.DeleteOpenLimit == true)
|
| | | {
|
| | | //重置开限位点
|
| | | var result = await HdlDeviceCurtainLogic.Current.DeleteCurtainLimitPoint(curtainDevice, Rollershade.LimiType.UpLimit);
|
| | | if (result == false)
|
| | | {
|
| | | checking = false;
|
| | | continue;
|
| | | }
|
| | | curtainData.DeleteOpenLimit = false;
|
| | | }
|
| | |
|
| | | //将窗帘调整到指定百分比
|
| | | this.sendDiv = 1;
|
| | | curtainDevice.WcdGoToTiltValue(nowValue);
|
| | |
| | | string msg = Language.StringByID(R.MyInternationalizationString.uCommitCurtainOpenLimitMsg);
|
| | | this.ShowMassage(ShowMsgType.Confirm, msg, async () =>
|
| | | {
|
| | | decimal openValue = ((decimal)curtainData.OpenLimitPersent / 100) * curtainData.CurtainLength;
|
| | | decimal closeValue = ((decimal)curtainData.CloseLimitPersent / 100) * curtainData.CurtainLength;
|
| | | if (openValue < 0) { openValue = 0; }
|
| | | if (closeValue < 0) { closeValue = curtainData.CurtainLength; }
|
| | | //执行确认及覆盖上限位点
|
| | | var result = await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.UpLimit,
|
| | | curtainData.OpenLimitPersent, curtainData.CloseLimitPersent);
|
| | | (int)openValue, (int)closeValue);
|
| | | if (result == true)
|
| | | {
|
| | | curtainData.DeleteOpenLimit = true;
|
| | | this.receiveOpenlimit = false;
|
| | | }
|
| | | });
|
| | |
| | | btnProgress1.Text = progressValue + "%";
|
| | | frameBack.AddChidren(btnProgress1);
|
| | | //进度条
|
| | | this.closeSeekBar = new SeekBarControl(965);
|
| | | this.closeSeekBar = new SeekBarControl(965);
|
| | | closeSeekBar.Y = btnProgressView.Bottom + Application.GetRealHeight(46);
|
| | | closeSeekBar.ProgressBarColor = 0xff288bfd;
|
| | | closeSeekBar.Progress = progressValue;
|
| | |
| | | frameBack.AddChidren(btnPlus);
|
| | | btnPlus.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | if (closeSeekBar.Progress >=100)
|
| | | if (closeSeekBar.Progress >= 100)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | }
|
| | | checking = true;
|
| | | oldProValue = nowValue;
|
| | | if (curtainData.DeleteCloseLimit == true)
|
| | | {
|
| | | //重置合限位点
|
| | | var result = await HdlDeviceCurtainLogic.Current.DeleteCurtainLimitPoint(curtainDevice, Rollershade.LimiType.DownLimit);
|
| | | if (result == false)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | curtainData.DeleteCloseLimit = false;
|
| | | }
|
| | |
|
| | | //将窗帘调整到指定百分比
|
| | | this.sendDiv = 2;
|
| | | curtainDevice.WcdGoToTiltValue(nowValue);
|
| | |
| | | string msg = Language.StringByID(R.MyInternationalizationString.uCommitCurtainCloseLimitMsg);
|
| | | this.ShowMassage(ShowMsgType.Confirm, msg, async () =>
|
| | | {
|
| | | //执行确认及覆盖合限位点
|
| | | decimal openValue = ((decimal)curtainData.OpenLimitPersent / 100) * curtainData.CurtainLength;
|
| | | decimal closeValue = ((decimal)curtainData.CloseLimitPersent / 100) * curtainData.CurtainLength;
|
| | | if (openValue < 0) { openValue = 0; }
|
| | | if (closeValue < 0) { closeValue = curtainData.CurtainLength; }
|
| | | //执行确认及覆盖上限位点
|
| | | var result = await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.DownLimit,
|
| | | curtainData.OpenLimitPersent, curtainData.CloseLimitPersent);
|
| | | (int)openValue, (int)closeValue);
|
| | |
|
| | | if (result == true)
|
| | | {
|
| | | curtainData.DeleteCloseLimit = true;
|
| | | this.receiveCloseLimit = false;
|
| | | }
|
| | | });
|
| | |
| | | //方向备份
|
| | | await HdlDeviceCurtainLogic.Current.BackupCurtainDirection(curtainDevice, curtainData.Direction);
|
| | | //限位备份
|
| | | int uplimit= (int)(curtainData.OpenLimitValue / (curtainData.CurtainLength * 1.0) * 100);
|
| | | int uplimit = (int)(curtainData.OpenLimitValue / (curtainData.CurtainLength * 1.0) * 100);
|
| | | int downlimit = (int)(curtainData.CloseLimitValue / (curtainData.CurtainLength * 1.0) * 100);
|
| | | await HdlDeviceCurtainLogic.Current.BackupCurtainLimitPoint(curtainDevice, uplimit, downlimit);
|
| | | });
|
| | |
| | | /// false:电机方向正向;true:电机方向反向
|
| | | /// </summary>
|
| | | public bool Direction = false;
|
| | | /// <summary>
|
| | | /// 是否重置开限位点
|
| | | /// </summary>
|
| | | public bool DeleteOpenLimit = true;
|
| | | /// <summary>
|
| | | /// 是否重置合限位点
|
| | | /// </summary>
|
| | | public bool DeleteCloseLimit = true;
|
| | | /// <summary>
|
| | | /// 开限位的值
|
| | | /// </summary>
|