Soeren Apel [Sun, 21 Oct 2018 19:22:01 +0000 (21:22 +0200)]
Fix clazy warnings regarding range-for references
The warnings that are fixed are of this type:
warning: Missing reference in range-for with non trivial type (std::__cxx11::string) [-Wclazy-range-loop]
Jon Burgess [Sun, 14 Oct 2018 22:52:24 +0000 (23:52 +0100)]
Fix memory leak in DecoderMenu
==214004== 1,536 (16 direct, 1,520 indirect) bytes in 1 blocks are definitely lost in loss record 6,288 of 6,442
==214004== at 0x4C2EE0B: malloc (vg_replace_malloc.c:299)
==214004== by 0x67D8435: g_malloc (in /usr/lib64/libglib-2.0.so.0.5600.3)
==214004== by 0x67F0056: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.5600.3)
==214004== by 0x67F14FA: g_slist_copy_deep (in /usr/lib64/libglib-2.0.so.0.5600.3)
==214004== by 0x5584FC: pv::widgets::DecoderMenu::DecoderMenu(QWidget*, bool) (decodermenu.cpp:33)
==214004==
Soeren Apel [Wed, 3 Oct 2018 19:52:00 +0000 (21:52 +0200)]
Fix #1292/1294 by snapping to any edge when not hovering over a signal
1292: TimeItem instances now snap to any edge when not hovering over a
signal, including the ruler itself. Hence, there is always an area
where one can hover without selecting a signal, even if the entire
view is full of signals.
Cursors also show the desired behavior: the left edge snaps while
the right does not. Hence, the width is kept constant. If the user
wants to snap the right edge to a signal edge, this can be achieved
by dragging the right edge separately.
1294: TimeItem instances now snap to any edge - before, they were snapping
only to edges when hovering over a signal.
Gerhard Sittig [Tue, 18 Sep 2018 16:34:42 +0000 (18:34 +0200)]
Logging: avoid "cb was NULL" warning message during logging shutdown
Commit 4b9234088f56 introduced the fetch and restore of the libraries'
default log routines in addition to the registration of a Pulseview
application's log routine. Some code paths in main() could result in
unexpected "cb was NULL" messages on stderr, when logging::init() did
not execute but the destructor tried to restore a handler which was not
fetched before. Silence the error message.
Gerhard Sittig [Mon, 20 Aug 2018 16:57:25 +0000 (18:57 +0200)]
Android: implement chained log callbacks (buffer and terminal output)
Query the libraries' default log handlers before registering the
application's own handler. Queue log messages in the application's
internal buffer _and_ hand them to the default handlers which send
the text to stdout as well.
Gerhard Sittig [Wed, 15 Aug 2018 21:48:52 +0000 (23:48 +0200)]
Logging: obsolete -s, log to internal buffer as well as stdout
Query the sr and srd libraries' current log routines before registering
PV's own log callback which queues messages in an internal buffer. This
allows duplication of messages to the internal buffer _and_ stdout, and
thus obsoletes the -s option.
"sr: hwdriver: Option 'external_clock' not available for this device instance."
Avoid this message by checking if the EXTERNAL_CLOCK property is actually
supplied by the driver.
The regression was that when clicking+dragging on a trace in the
trace view area, the individual trace was moving, not the view area
itself. This was unintended.
Soeren Apel [Mon, 6 Aug 2018 19:25:59 +0000 (21:25 +0200)]
Implement annotation export for all rows
Needed parts are:
1) Annotations must have a reference to the row they belong to
2) DecodeSignal must offer a method to return annotations for all rows
3) Annotations must become comparable to allow for sorting
4) DecodeTrace must handle the different annotation export cases
Fix #1204 by making sure the lazy event handler is fired
The QTimer reference says about QTimer::start():
> Starts or restarts the timer with the timeout specified in interval.
> If the timer is already running, it will be stopped and restarted.
> If singleShot is true, the timer will be activated only once.
This suggests that the timer is reset when start() is called even
when it is in single shot mode. However, this is actually not the case
and start() doesn't appear to be doing anything if it has already
been started. While this works in most cases, it causes issues when
the timer is supposed to be reset and timeout at the specified time
since view items are still in flux.
Gerhard Sittig [Sat, 18 Aug 2018 15:47:03 +0000 (17:47 +0200)]
about: move Pulseview version information into the text box
Move the application's version information out of the caption and into
the text box. So that it resides with the libraries' version information,
and is accessible via clipboard for reports.
This addresses part of bug #1213, and fixes all of #1264.
Uwe Hermann [Sun, 19 Aug 2018 15:36:04 +0000 (17:36 +0200)]
CMakeLists.txt: Set DISABLE_WERROR to TRUE by default.
There's various compile problems that can result from building with
-Werror on by default, which are outside of our control (e.g. that need
to be fixed in external libraries), for example #1144 or 1145.
Uwe Hermann [Tue, 24 Jul 2018 20:07:25 +0000 (22:07 +0200)]
HardwareDevice: Only show non-empty device name components.
Fields such as vendor, version, serial number etc. are not always
provided by drivers. Avoid printing them, since it causes stray
whitespace to be added to the displayed strings.
Brian Starkey [Sat, 21 Jul 2018 17:08:45 +0000 (18:08 +0100)]
Fix the build - catch exceptions by reference
Fix the following build errors seen with gcc 8.1.1:
error: catching polymorphic type ‘class std::out_of_range’ by value
error: catching polymorphic type ‘class boost::archive::archive_exception’ by value
Make sure PD row colors remain constant by adding a row index
Without this change, PD row colors depend on the visible rows,
not a constant ID. This means that rows that collapse change the
colors of all rows coming after them.
Soeren Apel [Fri, 18 May 2018 20:16:00 +0000 (22:16 +0200)]
DecodeSignal: Add and use inclusive/exclusive sample count variant
This is needed because the annotation cache must be operating on the
number of decoded samples WITHOUT the ones being currently processed,
otherwise it'll refuse to refresh the cache, even if more annotations
arrive - it uses the sample count to determine the cache state.
However, the bar showing the undecoded area must operate on the number
of samples WITH the ones being currently processed so that annotations
aren't overlapping with it.
Adding the parameter to DecodeSignal::get_decoded_sample_count() allows
for both.
Gerhard Sittig [Tue, 3 Jul 2018 14:46:57 +0000 (16:46 +0200)]
cmake: help users by pointing out libsigrok build depencendies
It appears that users have trouble to relate failed PulseView builds to
missing dependencies during libsigrok configuration. Although the error
occurs early and is stated in the build output, it only gets noticed
late and users forgot about the earlier step, or never bothered to check.
Explicitly test for the availability of the C++ bindings, and print a
message that points to libsigrok's(!) configuration phase. Another
check for the full set of libraries will fail in fatal ways as before.
An unfortunate implementation detail of the cmake check leaves all parts
of the lookup result empty when either(!) of the tested libs is missing.
So we cannot tell with certainty which test failed when the test result
is negative while a list of libraries was passed to the test. That's why
the "soft" individual test with QUIET and without REQUIRED is the least
intrusive adjustment to existing CMake rules, where other locations
depend on the PKGDEPS_* variables.
Gerhard Sittig [Wed, 6 Jun 2018 16:50:26 +0000 (18:50 +0200)]
main.cpp: straighten the getopt/optind adjustment before openfiles
The pulseview(1) application accepts input file specs either as argument
to the -i option, or as positional arguments after the command line options.
Simplify the logic which collects remaining non-option command line words
after getopt(3) is done. As a byproduct the application code no longer
manipulates a variable that is owned by an external library.
Gerhard Sittig [Sun, 17 Jun 2018 16:45:47 +0000 (18:45 +0200)]
analogsignal.cpp: Fix std::isnan() related compile issue on some systems
Re-do for recent source what commit f9abacf20c85 did to solve bug #531.
Explicitly use std::isnan() in checks. Avoid the 'using' directive since
not all platforms that are supported by sigrok do support it.
pv/views/trace/analogsignal.cpp:54:12: error: 'isnan' is already declared in this scope