Fix a signed/unsigned arithmetic issue in ValueDialZ::keyPressEvent()
reported by cppcheck.
The digit editing code used quint64 intermediates together with a signed
sign value:
int sign = m_value < 0 ? -1 : 1;
setValue(sign * v);
When editing negative values, the signed -1 was converted to an unsigned
value before multiplication, causing the result to wrap instead of
producing a negative value.
Use qint64 intermediates for the digit manipulation and apply the existing
sign explicitly when updating the value. This preserves correct behavior
when editing negative values and avoids the unintended unsigned conversion.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Cppcheck reported that setAlpha() could call log() with an argument of
zero when alpha is clamped to 0.0f, resulting in an invalid-domain
mathematical operation.
Initialize tau to 0.0f and only compute the logarithm when alpha is
strictly positive. This preserves the existing behavior while avoiding
the invalid log(0) call.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
cppcheck identified that LogSlider::LogSlider() calls the derived
setRange(double, double) overload instead of QSlider::setRange(int, int)
due to C++ name hiding.
The constructor's call to:
setRange(0, 1000);
was therefore invoking the logarithmic range implementation with
min == 0.0, resulting in a call to log10(0). While most callers
immediately replace the initial state by calling LogSlider::setRange()
with a valid positive range, the constructor still performs an invalid
mathematical operation during initialization.
Explicitly qualify the call as QSlider::setRange(0, 1000) to initialize
the underlying slider without invoking the logarithmic overload. This
eliminates the invalid-domain call, avoids undefined behavior from
propagating exceptional floating-point values into the slider state, and
makes the constructor's intent explicit.
This change has no functional impact on normal operation, but removes a
latent initialization bug and prevents future regressions caused by
overload hiding.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Built-in devices were previously always selectable regardless of
their claimed state. The "show devices in use" change
https://github.com/f4exb/sdrangel/commit/964bc0994d1e5c54ef8b08eb9102e0ee4f7d744e
inadvertently disabled all claimed devices in the selection dialog,
preventing multiple instances of FileInput, RemoteTCPInput, AudioInput,
TestSource and other built-in sources from being opened. :(
Only claimed physical devices are now disabled and marked
"[in use]". Built-in devices remain selectable as before.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Previously, devices claimed by another device set were omitted from the
device selection lists. Display these devices as disabled and marked
"[in use]" instead of hiding them.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Added optional scrollbar to be able to scroll back through waterfall.
When scrolling is enabled:
Can adjust power scale for complete waterfall, not just future spectra.
Waterfall time axis can use local time or UTC.
Waterfall not lost when resizing window.
Can now zoom when device is stopped.
Added Min averaging type.
Added button to load spectrum from .csv file.
Add button to save spectrum/waterfall to .png or jpg.
Changed show all controls button to a combobox with choices of Min/Std/All (Minimum/Standard/All).
Changed some buttons in spectrum GUI from QPushButton to QToolButton so their size matches the others.
Fix spectrum from displaying a mixture of old and new spectrums (m_currentSpectrum was a pointer to SpectrumVis buffer).
Added M1 and M2 memories to allow display of reference spectra.
Added math operations to allow spectrum to be difference of current spectrum and either memory or a moving average.
Fixed measurement counts, so they are performed once per spectrum, not on displayed spectra.
Added spectrum mask measurement, to check when a spectrum exceeds mask held in M1 or M2.
Optionally display power/frequency under cursor in status line.
Optionally display peak power/frequency in status line.
Fix incorrect nyquist sample replication, when zoom used.
Fix cursor not changing from resize to pointer when moving over spectrum measurements window.
Add spectrum colour setting.