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
Soeren Apel [Fri, 8 Jun 2018 07:09:09 +0000 (09:09 +0200)]
Disable unit tests by default
The rationale for this change is that except for developers, pretty
much everyone who builds from source does so because they want to
use the latest changes. However, only developers care about the results
of the unit tests, so this doubles the build time for users without
any real benefit.
Even worse, the unit tests are known to fail on several hosts for
reasons that are within the realm of the unit tests themselves, not
because of broken code. This confuses users and even prevents them
from installing PV for no good reason.
Since the unit tests do still run on Jenkins, there's little to no
coverage gap in my opinion.
Soeren Apel [Tue, 22 May 2018 07:24:13 +0000 (09:24 +0200)]
Session: Allow an SR_DF_META packet to override the samplerate
Otherwise, the sample rate determined by the read_config() call
in Session::sample_thread_proc() will be kept even if it's wrong
and the driver wants to submit the correct one.
Uwe Hermann [Mon, 21 May 2018 14:38:13 +0000 (16:38 +0200)]
tracegroup.cpp: Fix a potential unintended integer division.
Reported by Coverity (CID 279773):
Result is not floating-point (UNINTENDED_INTEGER_DIVISION)
integer_division: Dividing integer expressions -5 and 2, and then
converting the integer quotient to type double. Any remainder, or
fractional part of the quotient, is ignored.
Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression 1 << power
with type int (32 bits, signed) is evaluated using 32-bit arithmetic,
and then used in a context that expects an expression of type
uint64_t const (64 bits, unsigned).
Uwe Hermann [Sat, 19 May 2018 17:31:59 +0000 (19:31 +0200)]
logicsegment.cpp: Add missing config.h #include.
Without this #include, HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS was not
available and thus the faster path in LogicSegment::unpack_sample() and
LogicSegment::pack_sample() was never used.
Gerhard Sittig [Sat, 12 May 2018 06:31:52 +0000 (08:31 +0200)]
DecodeSignal: avoid specifying a zero samplerate to libsigrokdecode
When the sample rate is not known, avoid claiming the value would be
zero and calling setup routines in backend libraries. Although the call
is not strictly fatal, this simple check avoids potential log messages
at callee's for this unexpected condition.
Gerhard Sittig [Mon, 14 May 2018 18:25:41 +0000 (20:25 +0200)]
session: apply input format match to interactively loaded files, too
Move the format match logic from load_init_file() to load_file(), so
that it transparently takes effect on each "opened" file. Users still
can choose to "import" files and specify options when required. In the
case of lookup miss, sigrok session is assumed as before.
Gerhard Sittig [Sun, 13 May 2018 06:59:02 +0000 (08:59 +0200)]
session: add support to auto detect input format (for init file)
Extend the Session::load_init_file() method, to have the input format
automatically detected in the absence of an -I spec upon startup.
This fixes part of bug 1015. Input files specified at the command line
when pulseview gets invoked are handled. Files that interactively get
loaded while pulseview is running are not handled yet.
DecodeTrace: Use qreal instead of int for annotation drawing
This is to prevent "blinking" of annotations when they would merge into
blocks and break off of them again, noticeable when zooming in and out
using a track pad or touchscreen.
Issue #1: As decoding happens while the trace is drawn, the
annotations may actually overlap with the bar because the number
of decoded samples is outdated.
Issue #2: The bar is a little too low and off-center.
Uwe Hermann [Sat, 14 Apr 2018 20:23:52 +0000 (22:23 +0200)]
inputfile: Increase chunk size from 16KB to 4MB.
Use a 4MB chunk size for reading a file into memory. Larger values don't
seem to provide any substancial performance improvements, but can cause
UI lag and a visually "stuttering" display of the data currently loading.
Channels: Don't use flat buttons and add vertical spacer
With the buttons being flat, users may not recognize the labels as
buttons intuitively. Hence, make the buttons explicitly appear as
such. To make the dialog more aesthetically pleasing, we add some
vertical space between the check boxes and the buttons.