diff --git a/Documentation/UserManual/ProgrammingGuide.pdf b/Documentation/UserManual/ProgrammingGuide.pdf index e13bded..af8a6f5 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 d0faf8d..67ca553 100644 --- a/Documentation/UserManual/ProgrammingGuide.tex +++ b/Documentation/UserManual/ProgrammingGuide.tex @@ -346,8 +346,26 @@ These commands change or query VNA settings. Although most of them are available \query{Queries the currently selected number of points}{VNA:ACQuisition:POINTS?}{None}{points} \subsubsection{VNA:ACQuisition:AVG} -\event{Sets the number of sweeps over which a moving average is calculated}{VNA:ACQuisition:AVG}{} -\query{Queries the currently configured number of sweeps}{VNA:ACQuisition:AVG?}{None}{sweeps} +\event{Sets the number of sweeps over which a moving average is calculated}{VNA:ACQuisition:AVG}{} +\query{Queries the currently configured number of sweeps}{VNA:ACQuisition:AVG?}{None}{} + +\subsubsection{VNA:ACQuisition:AVGLEVel} +\query{Queries the number of sweeps that have been acquired by the average function.}{VNA:ACQuisition:AVGLVLel?}{None}{} + resets to zero whenever a setting is changed. It is incremented at the end of each sweep, but will not go above the number of configured sweeps for the averaging. + +Example (assuming = 3): +\begin{longtable}{p{.2\textwidth} | p{.2\textwidth} } +\textbf{\# of active sweep} & \textbf{}\\ +\hline +1 & 0\\ +2 & 1\\ +3 & 2\\ +4 & 3\\ +5 & 3\\ +\end{longtable} + +\subsubsection{VNA:ACQuisition:FINished} +\query{Queries whether the average filter has reached a steady state (that is = )}{VNA:ACQuisition:FINished?}{None}{TRUE or FALSE} \subsubsection{VNA:STIMulus:LVL} \event{Sets the output power of the stimulus signal}{VNA:STIMulus:LVL}{, in dBm} @@ -513,6 +531,24 @@ These commands change or query spectrum analyzer settings. Although most of them \event{Sets the number of sweeps over which a moving average is calculated}{SA:ACQuisition:AVG}{} \query{Queries the currently configured number of sweeps}{SA:ACQuisition:AVG?}{None}{sweeps} +\subsubsection{SA:ACQuisition:AVGLEVel} +\query{Queries the number of sweeps that have been acquired by the average function.}{SA:ACQuisition:AVGLVLel?}{None}{} + resets to zero whenever a setting is changed. It is incremented at the end of each sweep, but will not go above the number of configured sweeps for the averaging. + +Example (assuming = 3): +\begin{longtable}{p{.2\textwidth} | p{.2\textwidth} } +\textbf{\# of active sweep} & \textbf{}\\ +\hline +1 & 0\\ +2 & 1\\ +3 & 2\\ +4 & 3\\ +5 & 3\\ +\end{longtable} + +\subsubsection{SA:ACQuisition:FINished} +\query{Queries whether the average filter has reached a steady state (that is = )}{SA:ACQuisition:FINished?}{None}{TRUE or FALSE} + \subsubsection{SA:ACQuisition:SIGid} \event{Enables/disables signal identification}{SA:ACQuisition:SIGid}{, option are TRUE, FALSE, 1 or 0} \query{Queries whether signal identification is enabled}{SA:ACQuisition:SIGid?}{None}{TRUE or FALSE} diff --git a/Software/PC_Application/SpectrumAnalyzer/spectrumanalyzer.cpp b/Software/PC_Application/SpectrumAnalyzer/spectrumanalyzer.cpp index 7748c43..10fab4c 100644 --- a/Software/PC_Application/SpectrumAnalyzer/spectrumanalyzer.cpp +++ b/Software/PC_Application/SpectrumAnalyzer/spectrumanalyzer.cpp @@ -784,6 +784,12 @@ void SpectrumAnalyzer::SetupSCPI() }, [=](QStringList) -> QString { return QString::number(averages); })); + scpi_acq->add(new SCPICommand("AVGLEVel", nullptr, [=](QStringList) -> QString { + return QString::number(average.getLevel()); + })); + scpi_acq->add(new SCPICommand("FINished", nullptr, [=](QStringList) -> QString { + return average.getLevel() == averages ? "TRUE" : "FALSE"; + })); scpi_acq->add(new SCPICommand("SIGid", [=](QStringList params) -> QString { if (params.size() != 1) { return "ERROR"; diff --git a/Software/PC_Application/VNA/vna.cpp b/Software/PC_Application/VNA/vna.cpp index 753d5b8..9de5c4c 100644 --- a/Software/PC_Application/VNA/vna.cpp +++ b/Software/PC_Application/VNA/vna.cpp @@ -968,6 +968,12 @@ void VNA::SetupSCPI() }, [=](QStringList) -> QString { return QString::number(averages); })); + scpi_acq->add(new SCPICommand("AVGLEVel", nullptr, [=](QStringList) -> QString { + return QString::number(average.getLevel()); + })); + scpi_acq->add(new SCPICommand("FINished", nullptr, [=](QStringList) -> QString { + return average.getLevel() == averages ? "TRUE" : "FALSE"; + })); auto scpi_stim = new SCPINode("STIMulus"); SCPINode::add(scpi_stim); scpi_stim->add(new SCPICommand("LVL", [=](QStringList params) -> QString { diff --git a/Software/PC_Application/scpi.cpp b/Software/PC_Application/scpi.cpp index 50b4dd7..2f3fa70 100644 --- a/Software/PC_Application/scpi.cpp +++ b/Software/PC_Application/scpi.cpp @@ -26,7 +26,7 @@ bool SCPI::match(QString s1, QString s2) QString SCPI::alternateName(QString name) { - while(name[name.size()-1].isLower()) { + while(name.size() > 0 && name[name.size()-1].isLower()) { name.chop(1); } return name;