improve handling of SCPI commands received with short/no time between

This commit is contained in:
Jan Käberich 2024-12-02 10:46:28 +01:00
parent 57e6812cf8
commit 82e215881a
5 changed files with 8 additions and 3 deletions

View file

@ -32,8 +32,6 @@ class TestBase(unittest.TestCase):
if self.vna.query(":DEV:CONN?") == "Not connected":
self.tearDown()
raise AssertionError("Not connected")
# Tests occasionally fail without this timeout - give GUI a little bit more time to properly start
time.sleep(1)
def tearDown(self):
self.gui.send_signal(SIGINT)

View file

@ -78,6 +78,9 @@ Application
/LibreVNA-GUI/users*appdatalocaltemp*
/LibreVNA/build
# qmake.stash
LibreVNA-GUI/.qmake.stash

View file

@ -342,6 +342,7 @@ void SpectrumAnalyzer::deactivate()
{
setOperationPending(false);
StoreSweepSettings();
configurationTimer.stop();
Mode::deactivate();
}
@ -874,6 +875,7 @@ void SpectrumAnalyzer::Stop()
void SpectrumAnalyzer::ConfigureDevice()
{
configurationTimer.stop();
if(running) {
changingSettings = true;

View file

@ -738,6 +738,7 @@ void VNA::deactivate()
{
setOperationPending(false);
StoreSweepSettings();
configurationTimer.stop();
Mode::deactivate();
}
@ -1839,6 +1840,7 @@ void VNA::Stop()
void VNA::ConfigureDevice(bool resetTraces, std::function<void(bool)> cb)
{
configurationTimer.stop();
if(running) {
if (resetTraces) {
ResetLiveTraces();

View file

@ -1020,7 +1020,7 @@ void AppWindow::SetupSCPI()
void AppWindow::StartTCPServer(int port)
{
server = new TCPServer(port);
connect(server, &TCPServer::received, &scpi, &SCPI::input);
connect(server, &TCPServer::received, &scpi, &SCPI::input, Qt::QueuedConnection);
connect(&scpi, &SCPI::output, server, &TCPServer::send);
}