new SCPI command to switch between linear/log sweeps in VNA mode

This commit is contained in:
Jan Käberich 2024-09-16 20:22:25 +02:00
parent b09ea7da44
commit 009de1af17
3 changed files with 19 additions and 0 deletions

View file

@ -417,6 +417,10 @@ These commands change or query VNA settings. Although most of them are available
\event{Sets the stop power of the power sweep}{VNA:POWer:STOP}{<stop power>, in dBm}
\query{Queries the currently selected stop power}{VNA:POWer:STOP?}{None}{stop power in dBm}
\subsubsection{VNA:SWEEPTYPE}
\event{Selects between linear and logarithmic sweeps}{VNA:SWEEPTYPE}{<type>, either ``LIN'' or ``LOG''}
\query{Queries the currently selected sweep type}{VNA:SWEEPTYPE?}{None}{``LIN'' or ``LOG''}
\subsubsection{VNA:ACQuisition:RUN}
\event{Puts the VNA into run mode (sweep active)}{VNA:ACQuisition:RUN}{None}
\query{Queries whether the VNA is in run mode}{VNA:ACQuisition:RUN?}{None}{TRUE or FALSE}

View file

@ -1456,6 +1456,21 @@ void VNA::SetupSCPI()
}, [=](QStringList) -> QString {
return QString::number(settings.Power.stop);
}));
SCPINode::add(new SCPICommand("SWEEPTYPE", [=](QStringList params) -> QString {
if(params.size() >= 1) {
if(params[0] == "LIN") {
SetLogSweep(false);
return SCPI::getResultName(SCPI::Result::Empty);
} else if(params[0] == "LOG") {
SetLogSweep(true);
return SCPI::getResultName(SCPI::Result::Empty);
}
}
// either no parameter or invalid
return SCPI::getResultName(SCPI::Result::Error);
}, [=](QStringList) -> QString {
return settings.Freq.logSweep ? "LOG" : "LIN";
}));
auto scpi_acq = new SCPINode("ACQuisition");
SCPINode::add(scpi_acq);
scpi_acq->add(new SCPICommand("RUN", [=](QStringList) -> QString {