mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-01-09 10:10:00 +01:00
fix for future qt versions: keep one instance of the calibation progressbar
This commit is contained in:
parent
e2bbd6fad3
commit
57e6812cf8
1
Software/PC_Application/.gitignore
vendored
1
Software/PC_Application/.gitignore
vendored
|
|
@ -76,6 +76,7 @@ Application
|
|||
/LibreVNA-GUI/LibreVNA-GUI
|
||||
/LibreVNA-Test/LibreVNA-Test
|
||||
/LibreVNA-GUI/users*appdatalocaltemp*
|
||||
/LibreVNA/build
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
QMAKE_CXX.QT_COMPILER_STDCXX = 201402L
|
||||
QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 8
|
||||
QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 1
|
||||
QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0
|
||||
QMAKE_CXX.COMPILER_MACROS = \
|
||||
QT_COMPILER_STDCXX \
|
||||
QMAKE_GCC_MAJOR_VERSION \
|
||||
QMAKE_GCC_MINOR_VERSION \
|
||||
QMAKE_GCC_PATCH_VERSION
|
||||
QMAKE_CXX.INCDIRS = \
|
||||
C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++ \
|
||||
C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32 \
|
||||
C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/backward \
|
||||
C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include \
|
||||
C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed \
|
||||
C:/Qt/Tools/mingw810_64/x86_64-w64-mingw32/include
|
||||
QMAKE_CXX.LIBDIRS = \
|
||||
C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0 \
|
||||
C:/Qt/Tools/mingw810_64/lib/gcc \
|
||||
C:/Qt/Tools/mingw810_64/x86_64-w64-mingw32/lib \
|
||||
C:/Qt/Tools/mingw810_64/lib
|
||||
|
|
@ -158,6 +158,26 @@ VNA::VNA(AppWindow *window, QString name)
|
|||
|
||||
cal.getKit().setIdealDefault();
|
||||
|
||||
calDialog = new QProgressDialog();
|
||||
calDialog->setCancelButtonText("Abort");
|
||||
calDialog->setWindowTitle("Taking calibration measurement...");
|
||||
calDialog->setValue(0);
|
||||
calDialog->setWindowModality(Qt::ApplicationModal);
|
||||
calDialog->reset();
|
||||
calDialog->setMinimumDuration(0);
|
||||
|
||||
// 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(calDialog, &QProgressDialog::canceled, this, [=]() {
|
||||
// the user aborted the calibration measurement
|
||||
calMeasuring = false;
|
||||
cal.clearMeasurements(calMeasurements);
|
||||
cal.measurementsAbort();
|
||||
// delete calDialog;
|
||||
});
|
||||
|
||||
// portExtension.setCalkit(&cal.getCalibrationKit());
|
||||
|
||||
// De-embedding menu
|
||||
|
|
@ -960,8 +980,6 @@ void VNA::NewDatapoint(DeviceDriver::VNAMeasurement m)
|
|||
cal.addMeasurements(calMeasurements, m_avg);
|
||||
if(m_avg.pointNum == settings.npoints - 1) {
|
||||
calMeasuring = false;
|
||||
calDialog->deleteLater();
|
||||
calDialog = nullptr;
|
||||
cal.measurementsComplete();
|
||||
}
|
||||
}
|
||||
|
|
@ -1346,25 +1364,8 @@ void VNA::StartCalibrationMeasurements(std::set<CalibrationMeasurement::Base*> m
|
|||
} else {
|
||||
text.append("multiple calibration standards.");
|
||||
}
|
||||
calDialog = new QProgressDialog();
|
||||
calDialog->setLabelText(text);
|
||||
calDialog->setCancelButtonText("Abort");
|
||||
calDialog->setWindowTitle("Taking calibration measurement...");
|
||||
calDialog->setValue(0);
|
||||
calDialog->setWindowModality(Qt::ApplicationModal);
|
||||
// always show the dialog
|
||||
calDialog->setMinimumDuration(0);
|
||||
// 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(calDialog, &QProgressDialog::canceled, this, [=]() {
|
||||
// the user aborted the calibration measurement
|
||||
calMeasuring = false;
|
||||
cal.clearMeasurements(calMeasurements);
|
||||
cal.measurementsAbort();
|
||||
delete calDialog;
|
||||
}, Qt::UniqueConnection);
|
||||
// Trigger sweep to start from beginning
|
||||
running = true;
|
||||
ConfigureDevice(true, [=](bool){
|
||||
|
|
|
|||
Loading…
Reference in a new issue