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.
Uwe Hermann [Sun, 1 Apr 2018 17:26:16 +0000 (19:26 +0200)]
CMakeLists.txt: Set CMake policy CMP0054 to NEW.
This prevents the following warnings upon a second cmake run:
CMake Warning (dev) at /usr/share/cmake-3.10/Modules/CMakePushCheckState.cmake:65 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Quoted variables like "HAVE_CXX_ATOMICS_WITHOUT_LIB" will no longer be
dereferenced when the policy is set to NEW. Since the policy is not set
the OLD behavior will be used.
Call Stack (most recent call first):
CMakeLists.txt:123 (cmake_push_check_state)
CMakeLists.txt:139 (check_working_cxx_atomics)
This warning is for project developers. Use -Wno-dev to suppress it.
Gerhard Sittig [Tue, 2 Jan 2018 19:03:56 +0000 (20:03 +0100)]
DecodeSignal: Reset and re-use existing decoder sessions
Instead of destroying and re-creating decoder sessions, re-use
previously created sessions by just terminating their current work and
resetting internal state.
This implementation most proboably is incomplete in respect of changes
to the stack hierarchy or individual decoders' properties. This needs
more attention. When the stack is kept but its configuration has changed,
the involved properties need to get "somehow applied to" the stack's
instances before re-using it with new input data will yield correct results.
Dan Horák [Fri, 23 Mar 2018 20:33:18 +0000 (21:33 +0100)]
fix catching polymorphic types by value
Compiling with GCC 8 produces a new warning about catching polymorphic
types by value. Proper way is to use references instead.
/home/sharkcz/projects/pulseview/main.cpp: In function ‘int main(int, char**)’:
/home/sharkcz/projects/pulseview/main.cpp:229:22: error: catching polymorphic type ‘class std::exception’ by value [-Werror=catch-value=]
} catch (exception e) {
^
cc1plus: all warnings being treated as errors
Soeren Apel [Thu, 8 Mar 2018 23:28:42 +0000 (00:28 +0100)]
Fix #1125 by adding a missing typecast
Without this typecast, the return type of get_sample_count() is
a uint64_t, which doesn't go well when it's 0 and we subtract 1
from it. Assigning the result of this underflow to an int64_t
doesn't help, it's too late.
Soeren Apel [Mon, 12 Mar 2018 14:58:06 +0000 (15:58 +0100)]
SignalBase: Speed up conversion and prevent leaving samples unconverted
Unconverted samples can happen due to a race condition: being notified
of new samples coming in is ignored when the thread is already executing.
If these notifications however were the last ones sent out because the
segment was completed right after, the currently ongoing conversion
will finish but not be restarted with the final sample range.