mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-01-06 16:49:59 +01:00
prevent race condition when aborting calibration measurement
This commit is contained in:
parent
28150307ca
commit
86fbe929d4
|
|
@ -607,6 +607,7 @@ void LibreCALDialog::startCalibration()
|
|||
connect(cal, &Calibration::measurementsUpdated, this, startNextCalibrationStep, Qt::QueuedConnection);
|
||||
connect(cal, &Calibration::measurementsAborted, this, [=](){
|
||||
enableUI();
|
||||
ui->lCalibrationStatus->setText("Ready to start");
|
||||
});
|
||||
|
||||
startNextCalibrationStep();
|
||||
|
|
|
|||
|
|
@ -168,7 +168,11 @@ VNA::VNA(AppWindow *window, QString name)
|
|||
|
||||
// A modal QProgressDialog calls processEvents() in setValue(). Needs to use a queued connection to update the progress
|
||||
// value from within the NewDatapoint slot to prevent possible re-entrancy.
|
||||
connect(this, &VNA::calibrationMeasurementPercentage, calDialog, &QProgressDialog::setValue, Qt::QueuedConnection);
|
||||
connect(this, &VNA::calibrationMeasurementPercentage, calDialog, [=](int percent) {
|
||||
if(calMeasuring || percent == 100) {
|
||||
calDialog->setValue(percent);
|
||||
}
|
||||
}, Qt::QueuedConnection);
|
||||
|
||||
connect(calDialog, &QProgressDialog::canceled, this, [=]() {
|
||||
// the user aborted the calibration measurement
|
||||
|
|
|
|||
Loading…
Reference in a new issue