From 73ba0f969247eeaaafbe7eca2d0da0b45078bb08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Fri, 12 Apr 2024 12:23:00 +0200 Subject: [PATCH] do not set operation pending if no device connected --- .../LibreVNA-GUI/SpectrumAnalyzer/spectrumanalyzer.cpp | 8 ++++++-- Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Software/PC_Application/LibreVNA-GUI/SpectrumAnalyzer/spectrumanalyzer.cpp b/Software/PC_Application/LibreVNA-GUI/SpectrumAnalyzer/spectrumanalyzer.cpp index 957ac6c..6b673e1 100644 --- a/Software/PC_Application/LibreVNA-GUI/SpectrumAnalyzer/spectrumanalyzer.cpp +++ b/Software/PC_Application/LibreVNA-GUI/SpectrumAnalyzer/spectrumanalyzer.cpp @@ -564,7 +564,9 @@ void SpectrumAnalyzer::NewDatapoint(DeviceDriver::SAMeasurement m) void SpectrumAnalyzer::SettingsChanged() { - setOperationPending(true); + if(window->getDevice()) { + setOperationPending(true); + } configurationTimer.start(100); ResetLiveTraces(); } @@ -893,7 +895,9 @@ void SpectrumAnalyzer::ConfigureDevice() void SpectrumAnalyzer::ResetLiveTraces() { - setOperationPending(true); + if(window->getDevice()) { + setOperationPending(true); + } average.reset(DeviceDriver::SApoints()); traceModel.clearLiveData(); UpdateAverageCount(); diff --git a/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp b/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp index 13006f4..6142979 100644 --- a/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp +++ b/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp @@ -983,7 +983,9 @@ void VNA::UpdateAverageCount() void VNA::SettingsChanged(bool resetTraces, int delay) { - setOperationPending(true); + if(window->getDevice()) { + setOperationPending(true); + } configurationTimer.start(delay); changingSettings = true; configurationTimerResetTraces = resetTraces; @@ -1859,7 +1861,9 @@ void VNA::ResetLiveTraces() traceModel.clearLiveData(); UpdateAverageCount(); UpdateCalWidget(); - setOperationPending(true); + if(window->getDevice()) { + setOperationPending(true); + } } bool VNA::LoadCalibration(QString filename)