예제 #1
0
 public ManualCleanFrm()
 {
     InitializeComponent();
     this.saveSpendTimeDic = new Dictionary <CleanSteps, TimeSpan>();
     getter = new DataStatusSyncer();
     getter.UpdateUIDelegate += this.UpdateProcessUI;
     getter.TaskCallBack     += this.DoneClean;
     this.isWorking           = false;
     this.cleanStep           = CleanSteps.UnSupported;
 }
예제 #2
0
 public AutoCleanFrm()
 {
     InitializeComponent();
     this.saveSpendTimeDic = new Dictionary <CleanSteps, TimeSpan>();
     getter = new DataStatusSyncer();
     getter.UpdateUIDelegate   += this.UpdateProcessUI;
     getter.TaskCallBack       += this.DoneClean;
     this.GunDongFont.Text      = "等待清理";
     this.GunDongTimer.Interval = 100;
     this.GunDongTimer.Enabled  = true;
     this.CurrentStatus         = "ready";
 }
예제 #3
0
        private void AutoClean_Click(object sender, EventArgs e)
        {
            if (this.isWorking == false)
            {
                // 发送 自动清理请求 到 清理机器
                bool isSuccess = MachineSender.SendCMD(MachineSender.Command_Start);
                if (isSuccess)
                {
                    this.isWorking = true;

                    this.InitProcessBar();

                    this.currentMachineNum = 1;
                    this.currentStepNum    = 1;
                    this.eightAngle1.ImgOne.BackgroundImage = ((System.Drawing.Image)(Resources.ResourceManager.GetObject(this.angleOne + this.stepOneRed)));

                    this.timerThread1 = new Thread(new ParameterizedThreadStart(this.Thread1_Tick));
                    this.timerThread2 = new Thread(new ParameterizedThreadStart(this.Thread2_Tick));
                    this.timerThread3 = new Thread(new ParameterizedThreadStart(this.Thread3_Tick));
                    this.timerThread1.IsBackground = true;
                    this.timerThread2.IsBackground = true;
                    this.timerThread3.IsBackground = true;

                    this.timerThread1.Start(DateTime.Now);

                    DataStatusSyncer getter = new DataStatusSyncer();
                    getter.UpdateUIDelegate += this.Update;
                    getter.TaskCallBack     += this.DoneClean;
                    this.thread              = new Thread(getter.GetStatus);
                    this.thread.IsBackground = true;
                    this.thread.Start();
                }
            }
            else
            {
                MessageBox.Show("正在清理,请稍后再试");
            }
        }