options to load calibration/setup files via command line
This commit is contained in:
parent
855d67d028
commit
6e07be0af5
@ -117,13 +117,7 @@ VNA::VNA(AppWindow *window)
|
|||||||
saveCal->setEnabled(false);
|
saveCal->setEnabled(false);
|
||||||
|
|
||||||
connect(calLoad, &QAction::triggered, [=](){
|
connect(calLoad, &QAction::triggered, [=](){
|
||||||
cal.openFromFile();
|
LoadCalibration("");
|
||||||
if(cal.getType() == Calibration::Type::None) {
|
|
||||||
DisableCalibration();
|
|
||||||
} else {
|
|
||||||
ApplyCalibration(cal.getType());
|
|
||||||
}
|
|
||||||
calEdited = false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(saveCal, &QAction::triggered, [=](){
|
connect(saveCal, &QAction::triggered, [=](){
|
||||||
@ -1544,3 +1538,16 @@ void VNA::UpdateStatusbar()
|
|||||||
setStatusbarMessage("Calibration: -");
|
setStatusbarMessage("Calibration: -");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool VNA::LoadCalibration(QString filename)
|
||||||
|
{
|
||||||
|
cal.openFromFile(filename);
|
||||||
|
calEdited = false;
|
||||||
|
if(cal.getType() == Calibration::Type::None) {
|
||||||
|
DisableCalibration();
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
ApplyCalibration(cal.getType());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -59,6 +59,9 @@ public:
|
|||||||
bool excitingPort2;
|
bool excitingPort2;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
bool LoadCalibration(QString filename);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void NewDatapoint(Protocol::Datapoint d);
|
void NewDatapoint(Protocol::Datapoint d);
|
||||||
void StartImpedanceMatching();
|
void StartImpedanceMatching();
|
||||||
|
@ -86,6 +86,8 @@ AppWindow::AppWindow(QWidget *parent)
|
|||||||
parser.addOption(QCommandLineOption({"p","port"}, "Specify port to listen for SCPI commands", "port"));
|
parser.addOption(QCommandLineOption({"p","port"}, "Specify port to listen for SCPI commands", "port"));
|
||||||
parser.addOption(QCommandLineOption({"d","device"}, "Only allow connections to the specified device", "device"));
|
parser.addOption(QCommandLineOption({"d","device"}, "Only allow connections to the specified device", "device"));
|
||||||
parser.addOption(QCommandLineOption("no-gui", "Disables the graphical interface"));
|
parser.addOption(QCommandLineOption("no-gui", "Disables the graphical interface"));
|
||||||
|
parser.addOption(QCommandLineOption("cal", "Calibration file to load on startup", "cal"));
|
||||||
|
parser.addOption(QCommandLineOption("setup", "Setup file to load on startup", "setup"));
|
||||||
|
|
||||||
parser.process(QCoreApplication::arguments());
|
parser.process(QCoreApplication::arguments());
|
||||||
|
|
||||||
@ -245,6 +247,12 @@ AppWindow::AppWindow(QWidget *parent)
|
|||||||
// at least one device available
|
// at least one device available
|
||||||
ConnectToDevice();
|
ConnectToDevice();
|
||||||
}
|
}
|
||||||
|
if(parser.isSet("setup")) {
|
||||||
|
LoadSetup(parser.value("setup"));
|
||||||
|
}
|
||||||
|
if(parser.isSet("cal")) {
|
||||||
|
vna->LoadCalibration(parser.value("cal"));
|
||||||
|
}
|
||||||
if(!parser.isSet("no-gui")) {
|
if(!parser.isSet("no-gui")) {
|
||||||
InformationBox::setGUI(true);
|
InformationBox::setGUI(true);
|
||||||
resize(1280, 800);
|
resize(1280, 800);
|
||||||
|
Loading…
Reference in New Issue
Block a user