Merge remote-tracking branch 'origin/trace_math'

This commit is contained in:
Zoran Kostic 2020-12-07 00:52:56 +01:00
commit d5aca3d5e1
4 changed files with 61 additions and 2 deletions

View file

@ -287,7 +287,8 @@ VNA::VNA(AppWindow *window)
// Calibration toolbar (and populate calibration menu)
auto tb_cal = new QToolBar("Calibration");
tb_cal->addWidget(new QLabel("Calibration:"));
QLabel *cbEnableCal_label = new QLabel("Calibration:"); // correct object type
tb_cal->addWidget(cbEnableCal_label);
auto cbEnableCal = new QCheckBox;
tb_cal->addWidget(cbEnableCal);
auto cbType = new QComboBox();
@ -326,6 +327,8 @@ VNA::VNA(AppWindow *window)
cbEnableCal->blockSignals(true);
calDisable->setChecked(true);
cbEnableCal->setCheckState(Qt::CheckState::Unchecked);
cbEnableCal_label->setStyleSheet("background-color: yellow"); // visually indicate loss of calibration
cbEnableCal_label->setToolTip("none"); // cal. file unknown at this moment
cbType->blockSignals(false);
cbEnableCal->blockSignals(false);
calImportTerms->setEnabled(false);
@ -343,6 +346,8 @@ VNA::VNA(AppWindow *window)
}
}
cbEnableCal->setCheckState(Qt::CheckState::Checked);
cbEnableCal_label->setStyleSheet(""); // restore default look of widget
cbEnableCal_label->setToolTip(cal.getCurrentCalibrationFile()); // on hover, show name of active cal. file
cbType->blockSignals(false);
cbEnableCal->blockSignals(false);
calImportTerms->setEnabled(true);
@ -427,7 +432,12 @@ void VNA::initializeDevice()
if(cal.openFromFile(filename)) {
ApplyCalibration(cal.getType());
portExtension.setCalkit(&cal.getCalibrationKit());
qDebug() << "Calibration successful from " << filename;
} else {
qDebug() << "Calibration not successfull from: " << filename;
}
} else {
qDebug() << "Calibration file not found: " << filename;
}
removeDefaultCal->setEnabled(true);
} else {