Fix tests

This commit is contained in:
Jan Käberich 2024-12-02 12:10:13 +01:00
parent 82e215881a
commit b95e966041
4 changed files with 11 additions and 6 deletions

View file

@ -23,7 +23,7 @@ class TestBase(unittest.TestCase):
time.sleep(1)
self.vna = libreVNA('localhost', 19544)
self.vna = libreVNA('localhost', 19544, timeout=4)
try:
self.vna.cmd("*CLS;:DEV:CONN")
except Exception as e:

View file

@ -537,10 +537,9 @@ void AppWindow::SetupSCPI()
}, nullptr, false));
scpi_dev->add(new SCPICommand("LIST", nullptr, [=](QStringList) -> QString {
QString ret;
for(auto driver : DeviceDriver::getDrivers()) {
for(auto d : driver->GetAvailableDevices()) {
ret += d + ",";
}
UpdateDeviceList();
for(auto entry : deviceList) {
ret += entry.serial + ",";
}
// remove last comma
ret.chop(1);

View file

@ -11,6 +11,7 @@ SCPI::SCPI() :
OCAS = false;
SESR = 0x00;
ESE = 0xFF;
processing = false;
add(new SCPICommand("*CLS", [=](QStringList) {
SESR = 0x00;
@ -178,11 +179,14 @@ QString SCPI::getResultName(SCPI::Result r)
void SCPI::input(QString line)
{
cmdQueue.append(line);
process();
if(!processing) {
process();
}
}
void SCPI::process()
{
processing = true;
while(!WAIexecuting && !cmdQueue.isEmpty()) {
auto cmd = cmdQueue.front();
cmdQueue.pop_front();
@ -214,6 +218,7 @@ void SCPI::process()
}
}
}
processing = false;
}
void SCPI::someOperationCompleted()

View file

@ -121,6 +121,7 @@ private:
bool WAIexecuting;
QList<QString> cmdQueue;
bool processing;
};
#endif // SCPI_H