diff --git a/Documentation/UserManual/ProgrammingGuide.pdf b/Documentation/UserManual/ProgrammingGuide.pdf index 33ccde2..6123e79 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 dc4c4bb..bd44ead 100644 --- a/Documentation/UserManual/ProgrammingGuide.tex +++ b/Documentation/UserManual/ProgrammingGuide.tex @@ -387,6 +387,22 @@ S11,S12,S21,S22 -0.0458452,-0.028729 \end{example} +\subsubsection{VNA:TRACe:MAXFrequency} +\query{Returns the highest frequency contained in the trace}{VNA:TRACe:MAXFrequency?}{, either by name or by index}{maximum frequency in Hz} + +\subsubsection{VNA:TRACe:MINFrequency} +\query{Returns the lowest frequency contained in the trace}{VNA:TRACe:MINFrequency?}{, either by name or by index}{maximum frequency in Hz} + +\subsubsection{VNA:TRACe:MAXAmplitude} +\query{Returns the datapoint with the highest amplitude in the trace}{VNA:TRACe:MAXAmplitude?}{, either by name or by index}{,, of the highest amplitude point} +\begin{example} +:VNA:TRAC:MAXA? S21 +5.66406e+9,-6.21766e-5,-0.000795846 +\end{example} + +\subsubsection{VNA:TRACe:MINAmplitude} +\query{Returns the datapoint with the lowest amplitude in the trace}{VNA:TRACe:MINAmplitude?}{, either by name or by index}{,, of the lowest amplitude point} + \subsubsection{VNA:TRACe:NEW} \event{Creates a new trace}{VNA:TRACe:NEW}{} @@ -564,6 +580,23 @@ Port1,Port2 \end{example} \footnotesize{Note: although the imaginary part is always zero, it is still included in the response}\\ +\subsubsection{SA:TRACe:MAXFrequency} +\query{Returns the highest frequency contained in the trace}{SA:TRACe:MAXFrequency?}{, either by name or by index}{maximum frequency in Hz} + +\subsubsection{SA:TRACe:MINFrequency} +\query{Returns the lowest frequency contained in the trace}{SA:TRACe:MINFrequency?}{, either by name or by index}{maximum frequency in Hz} + +\subsubsection{SA:TRACe:MAXAmplitude} +\query{Returns the datapoint with the highest amplitude in the trace}{SA:TRACe:MAXAmplitude?}{, either by name or by index}{,, of the highest amplitude point} +\begin{example} +:SA:TRAC:MAXA? Port1 +9.63e+8,4.05022e-5,0 +\end{example} +\footnotesize{Note: although the imaginary part is always zero, it is still included in the response}\\ + +\subsubsection{SA:TRACe:MINAmplitude} +\query{Returns the datapoint with the lowest amplitude in the trace}{SA:TRACe:MINAmplitude?}{, either by name or by index}{,, of the lowest amplitude point} + \subsubsection{SA:TRACe:NEW} \event{Creates a new trace}{SA:TRACe:NEW}{} diff --git a/Software/PC_Application/Traces/tracewidget.cpp b/Software/PC_Application/Traces/tracewidget.cpp index 3cd251b..b7ee867 100644 --- a/Software/PC_Application/Traces/tracewidget.cpp +++ b/Software/PC_Application/Traces/tracewidget.cpp @@ -202,6 +202,36 @@ void TraceWidget::SetupSCPI() } } })); + add(new SCPICommand("MAXFrequency", nullptr, [=](QStringList params) -> QString { + auto t = findTrace(params); + if(!t) { + return "ERROR"; + } + return QString::number(t->maxX()); + })); + add(new SCPICommand("MINFrequency", nullptr, [=](QStringList params) -> QString { + auto t = findTrace(params); + if(!t) { + return "ERROR"; + } + return QString::number(t->minX()); + })); + add(new SCPICommand("MAXAmplitude", nullptr, [=](QStringList params) -> QString { + auto t = findTrace(params); + if(!t) { + return "ERROR"; + } + auto d = t->interpolatedSample(t->findExtremumFreq(true)); + return QString::number(d.x)+","+QString::number(d.y.real())+","+QString::number(d.y.imag()); + })); + add(new SCPICommand("MINAmplitude", nullptr, [=](QStringList params) -> QString { + auto t = findTrace(params); + if(!t) { + return "ERROR"; + } + auto d = t->interpolatedSample(t->findExtremumFreq(false)); + return QString::number(d.x)+","+QString::number(d.y.real())+","+QString::number(d.y.imag()); + })); add(new SCPICommand("NEW", [=](QStringList params) -> QString { if(params.size() != 1) { return "ERROR";