void BackWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { if (e.ProgressPercentage == ProcessCmd.CutSopCmd) { if (ParentForm != null) { Common.ProgressWorkingChanged -= new ProgressChangedEventHandler(BackWorker_ProgressChanged); ParentForm.PopChildForm(this); } } }
private void PauseManager_NextClick(object sender, EventArgs e)//继续开始划切 { if (ParentForm != null) { ParentForm.PopChildForm(); Globals.Paused = false; //取消系统暂停功能 if (Globals.Cutting) { Common.SetSystemWorkMode(SysFunState.Cutting);//继续开始划切 可以进行断点续划 } } }
private void BackWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { switch (e.ProgressPercentage) { case ProcessCmd.CutLineCmd: { ProcessCutLineStep(e.UserState as CutLine); } break; case ProcessCmd.CutSegStartCmd: //划切当前步距值 { CutSegment seg = e.UserState as CutSegment; if (seg != null) { LoadChannelData(seg); } } break; case ProcessCmd.CutSegEndCmd: //当前步距划切结束 { CutSegment seg = e.UserState as CutSegment; if (seg != null) { cutLeaveLines.Text = seg.WaitCutNum.ToString(); //剩余刀数更新 cutProcess.StringFormat = string.Format(userFormat, seg.Lines.Count, seg.Lines.Count) + sysFormat; cutProcess.Value = 100; } } break; case ProcessCmd.CutChStartCmd: //划切当前通道 { CutChannel ch = e.UserState as CutChannel; if (ch != null) { RotateImageAngle(ch.AlignT + ch.TPosAdj); if (ch.Chip != null) { chipName.Text = ch.Chip.Name; } else { chipName.Text = "Chip1"; } curName.Text = ch.Name; LoadChannelData(ch, true); } } break; case ProcessCmd.CutChEndCmd: //当前通道划切结束 { CutChannel ch = e.UserState as CutChannel; if (ch != null) { cutLeaveLines.Text = ch.WaitCutNum.ToString(); //剩余刀数更新 cutProcess.StringFormat = string.Format(userFormat, ch.Lines.Count, ch.Lines.Count) + sysFormat; cutProcess.Value = 100; //划切进度更新 } } break; case ProcessCmd.CutPieceCmd: //暂时保留 { // } break; case ProcessCmd.CutGroupCmd: //开始进行划切 { } break; case ProcessCmd.CutPauseCmd: { watch.Stop(); if (ParentForm != null) { ParentForm.PushChildForm(new CutPauseManager()); //进入暂停界面 } } break; case ProcessCmd.CutSopCmd: { if (ParentForm != null) { ParentForm.PopChildForm(this); } } break; default: break; } }