diff --git a/Documentation/UserManual/ProgrammingGuide.pdf b/Documentation/UserManual/ProgrammingGuide.pdf index 9ed0646..6875fc2 100644 Binary files a/Documentation/UserManual/ProgrammingGuide.pdf and b/Documentation/UserManual/ProgrammingGuide.pdf differ diff --git a/Documentation/UserManual/ProgrammingGuide.tex b/Documentation/UserManual/ProgrammingGuide.tex index ecc0fcf..9ff63db 100644 --- a/Documentation/UserManual/ProgrammingGuide.tex +++ b/Documentation/UserManual/ProgrammingGuide.tex @@ -601,6 +601,9 @@ If no de-embedding is configured for the selected trace, enabling the de-embeddi \hspace{1cm}LOAD\\ \hspace{1cm}THROUGH\\ \hspace{1cm}ISOLATION\\ +\hspace{1cm}SLIDINGLOAD\\ +\hspace{1cm}REFLECT\\ +\hspace{1cm}LINE\\ {[]}, calibration kit standard name, optional\\} \subsubsection{VNA:CALibration:TYPE} @@ -609,7 +612,10 @@ If no de-embedding is configured for the selected trace, enabling the de-embeddi \hspace{1cm}SHORT\\ \hspace{1cm}LOAD\\ \hspace{1cm}THROUGH\\ -\hspace{1cm}ISOLATION\\} +\hspace{1cm}ISOLATION\\ +\hspace{1cm}SLIDINGLOAD\\ +\hspace{1cm}REFLECT\\ +\hspace{1cm}LINE\\} \subsubsection{VNA:CALibration:PORT} \event{Sets the port for the specified measurement}{VNA:CALibration:PORT}{ } @@ -637,6 +643,23 @@ Important points when saving/loading calibration files through SCPI commands: \subsubsection{VNA:CALibration:LOAD} \query{Loads a calibration file}{VNA:CALibration:LOAD?}{}{TRUE or FALSE} +\subsubsection{VNA:CALibration:KIT:MANufacturer} +\event{Sets the manufacturer name of the calibration kit}{VNA:CALibration:KIT:MANufacturer}{} +\query{Returns the manufacturer name of the calibration kit}{VNA:CALibration:KIT:MANufacturer?}{None}{} + +\subsubsection{VNA:CALibration:KIT:SERial} +\event{Sets the serial number of the calibration kit}{VNA:CALibration:KIT:SERial}{} +\query{Returns the serial number of the calibration kit}{VNA:CALibration:KIT:SERial?}{None}{} + +\subsubsection{VNA:CALibration:KIT:DESCription} +\event{Sets the description of the calibration kit}{VNA:CALibration:KIT:DESCription}{} +\query{Returns the description of the calibration kit}{VNA:CALibration:KIT:DESCription?}{None}{} + +\subsubsection{VNA:CALibration:KIT:FILEname} +\query{Returns the filename of the calibration kit}{VNA:CALibration:KIT:FILEname?}{None}{} + +The filename is only available if the calibration kit was loaded from a dedicated file. If it was loaded as part of a calibration file or has not been loaded since the GUI started, no filename will be returned. + \subsubsection{VNA:CALibration:KIT:SAVE} \event{Saves the active calibration kit to a file}{VNA:CALibration:KIT:SAVE}{} Important points when saving/loading calibration kit files through SCPI commands: diff --git a/Software/PC_Application/LibreVNA-GUI/Calibration/calkit.cpp b/Software/PC_Application/LibreVNA-GUI/Calibration/calkit.cpp index 52ae267..70fec89 100644 --- a/Software/PC_Application/LibreVNA-GUI/Calibration/calkit.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Calibration/calkit.cpp @@ -19,10 +19,44 @@ Calkit::Calkit() : SCPINode("KIT") { // set default values + filename = ""; for(auto e : descr) { e.var.setValue(e.def); } + add(new SCPICommand("MANufacturer", [=](QStringList params) -> QString { + if(params.size() != 1 ) { + // no new value given + return SCPI::getResultName(SCPI::Result::Error); + } + manufacturer = params[0]; + return SCPI::getResultName(SCPI::Result::Empty); + }, [=](QStringList) -> QString { + return manufacturer; + }, false)); + add(new SCPICommand("SERial", [=](QStringList params) -> QString { + if(params.size() != 1 ) { + // no new value given + return SCPI::getResultName(SCPI::Result::Error); + } + serialnumber = params[0]; + return SCPI::getResultName(SCPI::Result::Empty); + }, [=](QStringList) -> QString { + return serialnumber; + }, false)); + add(new SCPICommand("DESCription", [=](QStringList params) -> QString { + if(params.size() != 1 ) { + // no new value given + return SCPI::getResultName(SCPI::Result::Error); + } + description = params[0]; + return SCPI::getResultName(SCPI::Result::Empty); + }, [=](QStringList) -> QString { + return description; + }, false)); + add(new SCPICommand("FILEname", nullptr, [=](QStringList) -> QString { + return filename; + })); add(new SCPICommand("SAVE", [=](QStringList params) -> QString { if(params.size() != 1 ) { // no filename given or no calibration active @@ -57,6 +91,7 @@ void Calkit::toFile(QString filename) file.open(filename.toStdString()); file << setw(4) << toJSON() << endl; file.close(); + this->filename = filename; } static QString readLine(ifstream &file) { @@ -83,6 +118,7 @@ Calkit Calkit::fromFile(QString filename) throw runtime_error("JSON parsing error: " + string(e.what())); } c.clearStandards(); + c.filename = ""; if(j.contains("standards")) { qDebug() << "new JSON format detected"; c.fromJSON(j); @@ -345,6 +381,7 @@ Calkit Calkit::fromFile(QString filename) } file.close(); + c.filename = filename; return c; } @@ -411,6 +448,7 @@ nlohmann::json Calkit::toJSON() void Calkit::fromJSON(nlohmann::json j) { clearStandards(); + filename = ""; Savable::parseJSON(j, descr); for(auto js : j["standards"]) { if(!js.contains("type") || !js.contains("params")) { diff --git a/Software/PC_Application/LibreVNA-GUI/Calibration/calkit.h b/Software/PC_Application/LibreVNA-GUI/Calibration/calkit.h index 71ccdac..1999aee 100644 --- a/Software/PC_Application/LibreVNA-GUI/Calibration/calkit.h +++ b/Software/PC_Application/LibreVNA-GUI/Calibration/calkit.h @@ -26,6 +26,7 @@ public: this->serialnumber = other.serialnumber; this->description = other.description; this->standards = other.standards; + this->filename = other.filename; return *this; } @@ -58,6 +59,7 @@ public: private: void clearStandards(); QString manufacturer, serialnumber, description; + QString filename; std::vector standards; const std::vector descr = {{