From 3aac724298b166d787537e9e098f85b0e7a5d9e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Tue, 2 Dec 2025 11:36:36 +0100 Subject: [PATCH] prevent the combination of log sweep and start frequency = 0 --- Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp b/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp index 92920fb..ad5ae06 100644 --- a/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp +++ b/Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp @@ -1256,6 +1256,7 @@ void VNA::SetLogSweep(bool log) { if(settings.Freq.logSweep != log) { settings.Freq.logSweep = log; + ConstrainAndUpdateFrequencies(); emit logSweepChanged(log); SettingsChanged(); } @@ -1646,6 +1647,12 @@ void VNA::SetupSCPI() void VNA::ConstrainAndUpdateFrequencies() { + if(settings.sweepType == SweepType::Frequency && settings.Freq.logSweep) { + if(settings.Freq.start <= 0) { + // start frequency must be positive, force it to 1 Hz + settings.Freq.start = 1.0; + } + } if(settings.Freq.stop > DeviceDriver::getInfo(window->getDevice()).Limits.VNA.maxFreq) { settings.Freq.stop = DeviceDriver::getInfo(window->getDevice()).Limits.VNA.maxFreq; }