HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-01-09 fa6bcb2e9907772480f99205f36ec2a1ce735a22
ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
@@ -116,8 +116,8 @@
                    //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();
@@ -242,7 +242,7 @@
            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;
@@ -352,17 +352,7 @@
                    }
                    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);
@@ -380,12 +370,15 @@
            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;
                }
            });
@@ -419,7 +412,7 @@
            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;
@@ -475,7 +468,7 @@
            frameBack.AddChidren(btnPlus);
            btnPlus.ButtonClickEvent += (sender, e) =>
            {
                if (closeSeekBar.Progress >=100)
                if (closeSeekBar.Progress >= 100)
                {
                    return;
                }
@@ -529,16 +522,7 @@
                    }
                    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);
@@ -556,12 +540,16 @@
            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;
                }
            });
@@ -726,7 +714,7 @@
                    //方向备份
                    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);
                });
@@ -806,14 +794,6 @@
            /// false:电机方向正向;true:电机方向反向
            /// </summary>
            public bool Direction = false;
            /// <summary>
            /// 是否重置开限位点
            /// </summary>
            public bool DeleteOpenLimit = true;
            /// <summary>
            /// 是否重置合限位点
            /// </summary>
            public bool DeleteCloseLimit = true;
            /// <summary>
            /// 开限位的值
            /// </summary>