mirror of
https://github.com/jankae/LibreVNA.git
synced 2025-12-06 07:12:10 +01:00
prevent the combination of log sweep and start frequency = 0
This commit is contained in:
parent
0f9510e7a0
commit
3aac724298
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue