From eb5d824e02002b46e41757394ddd4d9b7f2e6bd8 Mon Sep 17 00:00:00 2001 From: Byons Date: Mon, 7 Sep 2026 17:31:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E6=BB=9A=E6=97=A7=E7=9A=84=E6=9C=80?= =?UTF-8?q?=E5=A4=A7=E9=80=9F=E5=BA=A6=E8=AE=A1=E7=AE=97=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mainwindow.cpp | 20 +++++++------------- mainwindow.h | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) 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();