コード例 #1
0
        public SyncStatusMode SendStatus()
        {
            SyncStatusMode currentStatus = new SyncStatusMode();

            if (this.isDone)
            {
                currentStatus.CleanSteps = CleanSteps.Done;
            }
            else
            {
                if (!this.isPause)
                {
                    if (this.isAuto)
                    {
                        this.Clean(this.isSingleStep);
                    }
                    else
                    {
                        this.ManualClean(this.isForward);
                    }
                }

                currentStatus.IsError       = false;
                currentStatus.ErrorMsg      = string.Empty;
                currentStatus.CurrentRailID = this.id;
                currentStatus.ProgressRate  = this.progress;
                currentStatus.CleanSteps    = (CleanSteps)this.currentStep;
            }

            return(currentStatus);
        }
コード例 #2
0
        public void GetStatus()
        {
            do
            {
                status = MachinePortal.GetStatus();
                this.UpdateUIDelegate(status);
                Thread.Sleep(1000);
            }while (status.CleanSteps != CleanSteps.Done);

            this.TaskCallBack();
        }
コード例 #3
0
ファイル: AutoCleanFrm.cs プロジェクト: v-chfeng/WinCleaner
        private void UpdateProcessUI(SyncStatusMode status)
        {
            CheckForIllegalCrossThreadCalls = false;

            //if (InvokeRequired)
            //{
            //    this.BeginInvoke(new AsynUpdateUI(this.Update), status);
            //}
            //else
            //{
            this.Update(status);
            //}
        }
コード例 #4
0
        private void UpdateProcessUI(SyncStatusMode status)
        {
            CheckForIllegalCrossThreadCalls = false;

            if (InvokeRequired)
            {
                this.Invoke(new AsynUpdateUI(this.Update), status);
            }
            else
            {
                this.Update(status);
            }
        }
コード例 #5
0
        /// <summary>
        /// 更新界面
        /// </summary>
        /// <param name="status"></param>
        private void Update(SyncStatusMode status)
        {
            CheckForIllegalCrossThreadCalls = false;

            if (status.IsError)
            {
                MessageBox.Show(status.ErrorMsg);
            }
            else
            {
                this.UpdateUpArrowLocation(status.ProgressRate);

                if (status.CleanSteps == CleanSteps.Done)
                {
                    MessageBox.Show("到达终点,清理停止!");
                    this.PauseManual();
                }
                //this.railsControler.SetRailProgress(status.CleanSteps);
            }
        }
コード例 #6
0
ファイル: AutoCleanFrm.cs プロジェクト: v-chfeng/WinCleaner
        private void Update(SyncStatusMode status)
        {
            CheckForIllegalCrossThreadCalls = false;

            if (status.IsError)
            {
                MessageBox.Show(status.ErrorMsg);
            }
            else
            {
                //过滤掉非法数据
                float progress = status.ProgressRate > 100 ? 100 : status.ProgressRate < 0 ? 0 : status.ProgressRate;

                switch (status.CleanSteps)
                {
                case CleanSteps.CleanRail:
                    this.CleanRailStepRate = progress;     // AutoCleanFrm.RailLength;
                    this.CurrentCleanStep  = CleanSteps.CleanRail;
                    this.GunDongFont.Text  = this.GetGunDongText(status.CurrentRailID, this.CurrentStatus);
                    break;

                case CleanSteps.DropAlcohol:
                    this.CleanRailStepRate = 100;
                    this.timerThread1.Abort();
                    if (this.CurrentCleanStep != CleanSteps.DropAlcohol)
                    {
                        this.timerThread2.Start(new TimeSpan(0, 0, 0));
                    }
                    this.CoveredWithGreaseStepRate = progress;    // AutoCleanFrm.RailLength;
                    this.CurrentCleanStep          = CleanSteps.DropAlcohol;
                    this.GunDongFont.Text          = this.GetGunDongText(status.CurrentRailID, this.CurrentStatus);
                    break;

                case CleanSteps.CoveredWithGrease:
                    this.CleanRailStepRate = 100;
                    this.timerThread1.Abort();
                    this.CoveredWithGreaseStepRate = 100;
                    this.timerThread2.Abort();
                    if (this.CurrentCleanStep != CleanSteps.CoveredWithGrease)
                    {
                        this.timerThread3.Start(new TimeSpan(0, 0, 0));
                    }
                    this.DropAlcoholStepRate = progress;     // AutoCleanFrm.RailLength;
                    this.CurrentCleanStep    = CleanSteps.CoveredWithGrease;
                    this.GunDongFont.Text    = this.GetGunDongText(status.CurrentRailID, this.CurrentStatus);
                    break;

                case CleanSteps.Done:
                    this.CleanRailStepRate = 100;
                    this.timerThread1.Abort();
                    this.CoveredWithGreaseStepRate = 100;
                    this.timerThread2.Abort();
                    this.DropAlcoholStepRate = 100;
                    this.timerThread3.Abort();
                    this.CurrentCleanStep = CleanSteps.Done;
                    int    num   = (int)this.railsControler.WorkingNum;
                    string numZh = this.ConvertNumToChinese(num);
                    this.startBtn.BackgroundImage = global::CleanSys.Properties.Resources.NewStartBtn;
                    MessageBox.Show($"{numZh}轨道清理完毕!");
                    this.GunDongFont.Text = this.GetGunDongText(status.CurrentRailID, this.CurrentStatus);
                    break;
                }

                this.UpdateUpArrowLocation(progress);
                this.railsControler.SetRailProgress(status.CleanSteps);
            }
        }