void PrintManager::togglePause() { if (PrintManager::single::instance().state() == PRINTING) { pausePrint(); } else if (PrintManager::single::instance().state() == PAUSED) { resumePrint(); } return; }
void B9Terminal::getKey(int iKey) { if(!m_bPrimaryScreen)return; // Ignore keystrokes from the print window unless we're using the primary monitor if(isVisible()&&isEnabled()) { // We must be "calibrating" If we get any keypress we should close the projector window if(pProjector!=NULL) pProjector->hide(); } switch(iKey){ case 112: // 'p' Pause/Resume emit pausePrint(); break; case 65: // Capital 'A' to abort if(!isEnabled()){ m_pPReleaseCycleTimer->stop(); emit signalAbortPrint("User Directed Abort."); } break; default: break; } }
void B9Terminal::getKey(int iKey) { if(!m_bPrimaryScreen)return; // 忽略从打印窗口击键除非我们正在使用主监视器 if(isVisible()&&isEnabled()) { // 我们必须“校准”。如果我们得到任何按键,我们应该关闭投影机窗口 if(pProjector!=NULL) pProjector->hide(); } switch(iKey){ case 112: // 按下'P' 暂停/恢复 emit pausePrint(); break; case 65: // 按下 'A'中止 if(!isEnabled()){ m_pPReleaseCycleTimer->stop(); emit signalAbortPrint("User Directed Abort."); } break; default: break; } }
B9Print::B9Print(B9Terminal *pTerm, QWidget *parent) : QDialog(parent), ui(new Ui::B9Print) { m_pTerminal = pTerm; if(m_pTerminal == NULL) qFatal("FATAL Call to B9Creator with null B9Terminal Pointer"); ui->setupUi(this); //清除旧信息 ui->lineEditSerialStatus->setText(""); ui->lineEditProjectorOutput->setText(""); m_iTbase = m_iTover = 0; m_iTattach = 0; m_iNumAttach = 1; m_iXOff = m_iYOff =0; m_iPrintState = PRINT_NO; m_iPaused = PAUSE_NO; m_bAbort = false; m_sAbortMessage = "Unknown Abort"; m_iCurLayerNumber = 0; m_dLayerThickness = 0.0; m_iLastLayer = 0; connect(m_pTerminal, SIGNAL(updateConnectionStatus(QString)), this, SLOT(on_updateConnectionStatus(QString))); connect(m_pTerminal, SIGNAL(updateProjectorOutput(QString)), this, SLOT(on_updateProjectorOutput(QString))); connect(m_pTerminal, SIGNAL(updateProjectorStatus(QString)), this, SLOT(on_updateProjectorStatus(QString))); connect(m_pTerminal, SIGNAL(updateProjector(B9PrinterStatus::ProjectorStatus)), this, SLOT(on_updateProjector(B9PrinterStatus::ProjectorStatus))); connect(m_pTerminal, SIGNAL(signalAbortPrint(QString)), this, SLOT(on_pushButtonAbort_clicked(QString))); connect(m_pTerminal, SIGNAL(PrintReleaseCycleFinished()), this, SLOT(exposeTBaseLayer())); connect(m_pTerminal, SIGNAL(pausePrint()), this, SLOT(on_pushButtonPauseResume_clicked())); connect(m_pTerminal, SIGNAL(sendStatusMsg(QString)),this, SLOT(setProjMessage(QString))); QString sTime = QDateTime::currentDateTime().toString("hh:mm"); ui->lcdNumberTime->setDigitCount(9); ui->lcdNumberTime->display(sTime); }