Very small files would cause inspectrum to crash with a SIGFPE. In the
end, this is caused by input that let's `samplesPerColumn == 0`. Make
sure this value is at least `1` and it doesn't crash anymore.
Signed-off-by: Johannes Demel <johannes.demel@dedrone.com>
Sometimes, we want to load a data file found under the `core:dataset`
key. In these cases, we need to read the dataset key and overwrite the
respective variable.
Further, we'd need to check if the corresponding `sigmf-data` file
exists, because it is supposed to take precedence over the dataset file.
The dataset file is all called a Non-Conforming-Datafile (NCD).
Signed-off-by: Johannes Demel <johannes.demel@dedrone.com>
This handles the tooltips displaying the comments of overlapping
annotations, as long as only one of the annotations that contain
the mouse cursor has a tooltip.
Before, SpectrogramPlot::getAnnotationComment() would return the
comment of the first annotation that contains the mouse cursor,
even if such a comment is an empty QString. The empty QString
would cause that no tooltip is displayed. Now
SpectrogramPlot::getAnnotationComment() only returns non-empty
comments. Therefore, if only one annotation with a comment contains
the mouse cursor, the tooltip for that comment will be displayed.
This still does not handle the case when multiple annotations with
comments contain the mouse cursor, since it is not clear what is
best to do in this case. For now,
SpectrogramPlot::getAnnotationComment() simply returns one of the
applicable comments.
Signed-off-by: Daniel Estévez <daniel@destevez.net>
Currently, SpectrogramPlot::getLine() uses the sample parameter to
determine the index of the first sample that is used to calculate
the FFT for a particular spectrogram line. Since the FFT is in some
sense an average of fftSize samples, this causes features (such as
the start and end of packet bursts) to appear somewhat sooner in
the spectrogram compared to their actual locations in the IQ file.
This improves the time alignment of the spectrogram plot by making
sample refer to the middle sample of the FFT (so the samples used
to compute the FFT start at sample - fftSize / 2.
For the beginning of the file we need to make an exception, because
if we try to fetch samples before the beginning of the file, then
inputSource->getSamples() returns nullptr. SpectrogramPlot::getLine()
handles this gracefully, but an ugly red bar appears at the beginning
of the file when the FFT size and zoom are large. To solve this, we
cheat and force the FFT to start at the beginning of the file. To
be more precise we could pad the beginning with zeros instead.
Signed-off-by: Daniel Estévez <daniel@destevez.net>
Previously, the format specifiers were only included in the source
repository README and the source code; this change adds the specifiers
to the program help text as well.
I looked at the QCommandLineOption API and there does not seem to be a
way to specify a subset of allowed strings such that they are
automatically included in the help text by QCommandLineParser - the
canonical way is just to include the options in the matching help text
as I have done in this commit.
When the mouse is moved over a SigMF annotation rectangle on the
waterfall, a tooltip showing the annotation comment is displayed
(if the annotation has a comment field).
This feature can be enabled/disabled with a checkbox, in the same
way as annotations. If annotations are disabled, the annotation comments
checkbox is grayed out and the tooltips are not shown.
Signed-off-by: Daniel Estévez <daniel@destevez.net>
The sample indices of a SigMF annotation include a global recording
offset. Remove it to correctly handle annotations in recordings with
non-zero offset.