mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-04 22:17:31 +00:00
SCPI commands for saving/loading calibration files
This commit is contained in:
parent
e4106fe3a2
commit
09366d73cc
15 changed files with 110 additions and 36 deletions
|
|
@ -41,12 +41,10 @@ private:
|
|||
|
||||
// status variables for automatic measurements
|
||||
Calkit *kit;
|
||||
// bool measuring;
|
||||
bool isPort1;
|
||||
bool isOpen;
|
||||
bool isIdeal;
|
||||
// std::vector<Protocol::Datapoint> measurements;
|
||||
QMessageBox *msgBox;
|
||||
|
||||
Ui::PortExtensionEditDialog *ui;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ private:
|
|||
std::vector<Point> points;
|
||||
bool measuring2xthru;
|
||||
bool measuringDUT;
|
||||
QMessageBox *msgBox;
|
||||
Ui::TwoThruDialog *ui;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1062,7 +1062,7 @@ void VNA::ApplyCalibration(Calibration::Type type)
|
|||
DisableCalibration(true);
|
||||
}
|
||||
} catch (runtime_error e) {
|
||||
QMessageBox::critical(window, "Calibration failure", e.what());
|
||||
InformationBox::ShowError("Calibration failure", e.what());
|
||||
DisableCalibration(true);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1325,6 +1325,35 @@ void VNA::SetupSCPI()
|
|||
scpi_cal->add(new SCPICommand("BUSy", nullptr, [=](QStringList) -> QString {
|
||||
return CalibrationMeasurementActive() ? "TRUE" : "FALSE";
|
||||
}));
|
||||
scpi_cal->add(new SCPICommand("SAVE", [=](QStringList params) -> QString {
|
||||
if(params.size() != 1 || !calValid) {
|
||||
// no filename given or no calibration active
|
||||
return "ERROR";
|
||||
}
|
||||
if(!cal.saveToFile(params[0])) {
|
||||
// some error when writing the calibration file
|
||||
return "ERROR";
|
||||
}
|
||||
calEdited = false;
|
||||
return "";
|
||||
}, nullptr));
|
||||
scpi_cal->add(new SCPICommand("LOAD", nullptr, [=](QStringList params) -> QString {
|
||||
if(params.size() != 1) {
|
||||
// no filename given or no calibration active
|
||||
return "FALSE";
|
||||
}
|
||||
if(!cal.openFromFile(params[0])) {
|
||||
// some error when loading the calibration file
|
||||
return "FALSE";
|
||||
}
|
||||
if(cal.getType() == Calibration::Type::None) {
|
||||
DisableCalibration();
|
||||
} else {
|
||||
ApplyCalibration(cal.getType());
|
||||
}
|
||||
calEdited = false;
|
||||
return "TRUE";
|
||||
}));
|
||||
}
|
||||
|
||||
void VNA::ConstrainAndUpdateFrequencies()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue