diff --git a/mainwindow.cpp b/mainwindow.cpp index 196e951..d054b99 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -708,12 +708,12 @@ bool MainWindow::updatePhaseIndicatorLight(){ return sysPara->status.lastPhaseFault; } -double MainWindow::getMaxSpeedCalcPara(){ +int MainWindow::getMaxSpeedCalcPara(){ sysPara->para.printRowDelay = sysPara->para.currPrintMode; if(sysPara->status.isPrinting == false) sysPara->status.pixNumPerCol = sysPara->status.currPrintRow; - // else - // sysPara->status.currPrintRow = sysPara->status.pixNumPerCol; + else + sysPara->status.currPrintRow = sysPara->status.pixNumPerCol; sysPara->para.pixNumPerCol = sysPara->status.pixNumPerCol; sysPara->para.reducedPixelNum = sysPara->para.reducedPixelNumRatio*sysPara->para.pixNumPerCol/100; @@ -726,15 +726,9 @@ double MainWindow::getMaxSpeedCalcPara(){ int dotNum = sysPara->para.divideRatio?(FPGA_SYS_HZ/(sysPara->para.divideRatio*2)):0;// 1s时间内墨点数 (即晶振频率 64000) int colNum = dotNumPerCol?dotNum/dotNumPerCol:0; // 第列可用墨点数 = 1s时间内墨点数/ 列需要墨点数 - double pulseNum = colNum*sysPara->para.synNumPerCol/(1<<8); //synNumPerCol是被放大后的值 + int pulseNum = colNum*sysPara->para.synNumPerCol/(1<<8); //synNumPerCol是被放大后的值 - if(sysPara->para.divideRatio == 0 || sysPara->para.synPulseNumPerMm == 0) - return 600.0f; - - double freq = (FPGA_SYS_HZ/(sysPara->para.divideRatio*2)); - double ddotNumPerCol = sysPara->status.currPrintRow - (sysPara->status.currPrintRow * sysPara->para.reducedPixelNumRatio / 100.0); - pulseNum = sysPara->para.printColDelay / sysPara->para.synPulseNumPerMm / 1000.0 * freq / ddotNumPerCol * 60.0; - return qBound(0.0, pulseNum, 600.0); + return pulseNum; } static int reclaimTankDelay = 0; @@ -800,8 +794,8 @@ void MainWindow::updateSysStatusToUI(){ //100ms } else { - double speed = getMaxSpeedCalcPara();//No67 - maxMM = int(speed * 1000.0); + int pulsePS = getMaxSpeedCalcPara();//No67 + maxMM = (pulsePS/sysPara->para.synPulseNumPerMm) * 60;// 列的最大间距 } ui->labelSynRate->setText(tr("%1.%2[%3.%4]米/分").arg(mm/1000).arg(mm%1000,3,10,QLatin1Char('0')) .arg(maxMM/1000).arg(maxMM%1000,3,10,QLatin1Char('0'))); diff --git a/mainwindow.h b/mainwindow.h index 0ed259b..7397adc 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -63,7 +63,7 @@ public: void enableReclaimCtrlButton(bool enable); void resetReclaimCtrlButtonText(); void enablePushButtonStart(bool enable); - double getMaxSpeedCalcPara(); + int getMaxSpeedCalcPara(); void PreviewPressed(); int getCurrPrintStatus();