压力监视等待初版

This commit is contained in:
2026-09-14 17:08:21 +08:00
parent 96c5fab758
commit 0bc587e989
5 changed files with 95 additions and 14 deletions
+19 -13
View File
@@ -129,6 +129,8 @@ void MainWidget::init()
airPushTimer = new QTimer(this);
connect(airPushTimer, SIGNAL(timeout()), this, SLOT(airPushingProcess()));
m_pressureMonitor = new PressureMonitor();
timerPowerOff = new QTimer(this);
connect(timerPowerOff,SIGNAL(timeout()),this,SLOT(sendPowerOffCmd()));
@@ -1221,18 +1223,6 @@ void MainWidget::airPushingProcess()
sysPara->saveParaToFile();
}
// 延迟 半秒后才开回收槽,正式结束排气阶段
if(sysPara->status.airPushingOnTime >= sysPara->para.airPushDurationSec * 1000 + 500){
//qDebug()<< "start stop";
reclaimTanOpen();
sysPara->status.airPushingDone = 1;
sysPara->status.airPushing = 0;
sysPara->status.airPushingOnTime = 0;
airPushTimer->stop();
setRunStatus(tr("喷嘴开启中"));
return;
}
if(sysPara->status.airPushingOnTime >= sysPara->para.airPushDurationSec * 1000){
sysPara->devOp->controlViscosityPump(false);
sysPara->devOp->controlCycleValve(false);
@@ -1240,6 +1230,21 @@ void MainWidget::airPushingProcess()
if(!sysPara->devOp->isReclaimPumpOpen())
sysPara->devOp->controlReclaimPump(true, false);
// 切换回自动模式
sysPara->status.isPumpValveControledByHand = false;
setRunStatus(tr("等待压力稳定..."));
// 调用压力检测器,监测压力持续3秒波动范围不超过标定值的+-10%
if(m_pressureMonitor->tick((float)sysPara->status.PRESSURE, (float)sysPara->para.pressure)) {
reclaimTanOpen();
sysPara->status.airPushingDone = 1;
sysPara->status.airPushing = 0;
sysPara->status.airPushingOnTime = 0;
airPushTimer->stop();
m_pressureMonitor->reset();
setRunStatus(tr("喷嘴开启中"));
}
return;
}
}
@@ -1431,6 +1436,7 @@ void MainWidget::on_m_RightBtn_clicked()
sysPara->status.airPushingOnTime = 0;
airPushTimer->start(100); // 100ms
m_pressureMonitor->reset();
}
}
else {
@@ -2698,4 +2704,4 @@ void MainWidget::UpdateUIVersion(){
QString Mac = QString::number(sysPara->status.machineMac);
LogInfo::setRunStatusText(QString("Mac:%1").arg(Mac));
LogInfo::showVerionInformation(Mac,VernonBach,fpgaVersion,STM32Ver);
}
}