Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jankae committed Dec 2, 2024
1 parent 82e2158 commit b95e966
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Software/Integrationtests/tests/TestBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def setUp(self):

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:
Expand Down
7 changes: 3 additions & 4 deletions Software/PC_Application/LibreVNA-GUI/appwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 6 additions & 1 deletion Software/PC_Application/LibreVNA-GUI/scpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SCPI::SCPI() :
OCAS = false;
SESR = 0x00;
ESE = 0xFF;
processing = false;

add(new SCPICommand("*CLS", [=](QStringList) {
SESR = 0x00;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -214,6 +218,7 @@ void SCPI::process()
}
}
}
processing = false;
}

void SCPI::someOperationCompleted()
Expand Down
1 change: 1 addition & 0 deletions Software/PC_Application/LibreVNA-GUI/scpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public slots:
bool WAIexecuting;

QList<QString> cmdQueue;
bool processing;
};

#endif // SCPI_H

0 comments on commit b95e966

Please sign in to comment.