mirror of
https://github.com/jankae/LibreVNA.git
synced 2025-12-06 07:12:10 +01:00
Fix tests
This commit is contained in:
parent
82e215881a
commit
b95e966041
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@ private:
|
|||
bool WAIexecuting;
|
||||
|
||||
QList<QString> cmdQueue;
|
||||
bool processing;
|
||||
};
|
||||
|
||||
#endif // SCPI_H
|
||||
|
|
|
|||
Loading…
Reference in a new issue