View: Provide a clear setup path for the initial v_offset value
- View::update_scroll():
The range for the vertical scrollbar is only updated if there
are traces in the view.
- View::set_scroll_default():
This new function adjusts the vertical offset of the view so
that all traces are visible. Needs to be executed once after a
new device was selected.
- View::signals_changed():
We want to be able to clear stale items in-between devices, so
we no longer want to simply return when no device is selected.
This means we need to handle a missing device more gracefully.
Also, we now reset the vertical scroll bar when no device is
selected and call set_scroll_default() when needed.
TraceTreeItemOwner: Change behavior for empty containers
An empty TraceTreeItemOwner's v_extents are no longer
[INT_MAX, INT_MIN] but [0, 0] instead. As new items were added
relative to the view's own v_extents, items were added at
positions close to the over-/underflow margin. This messed up
the scrollbar among other things. Returning [0, 0] instead
allows for better handling of such cases.
Soeren Apel [Tue, 16 Feb 2016 20:15:03 +0000 (21:15 +0100)]
Use the 'default' keyword where applicable. This patch
was initially created using clang-tidy:
clang-tidy -checks="-*,moderize-use-default" -fix
However, the resulting patch only wanted to alter the
definitions in the .cpp file. I think it makes more
sense to remove the definitions completely and just
add "= default" to the declarations in the header file.
Soeren Apel [Tue, 9 Feb 2016 13:48:31 +0000 (14:48 +0100)]
Fix #181 by changing the global decode lock into an SRD lock
The global decode was insufficient insofar as it didn't
prevent a newly started decode thread from interjecting its
own decode operations. When this happens, something goes
haywire somewhere and Python crashes.
Until the underlying cause is fixed, this global SRD lock
forces one decoder thread to finish before another one can
start.
While this is a bit inconvenient for wanting to decode as
the acquisition is going on, it currently is the only
working option.
Soeren Apel [Tue, 9 Feb 2016 10:58:36 +0000 (11:58 +0100)]
DecoderStack: Make decoder sessions terminate after running
Currently, SRD sessions aren't terminating after all data
has been decoded, leaving the decode thread in a state
where it's waiting for more data.
This would be okay if an acquisition was still ongoing but
when the acquisition has been stopped, there will never be
more data. When a new acquisition is started, the previous
decode sessions will be terminated and then new ones will
be started. This is the reason why this behavior wasn't
an issue up until now.
However, the fix for #181 requires that the decode thread
terminates or else the global SRD lock will never be
released.
Soeren Apel [Sat, 6 Feb 2016 17:07:05 +0000 (18:07 +0100)]
MainWindow: Try to use any available device aside from demo
Currently, PV will only try to use the previously used device.
However, when first running PV, it will default to demo as
there is no previously used device. In this case, we still
want to use whatever device we can get our hands on so that
the user can start using PV immediately.
Soeren Apel [Thu, 4 Feb 2016 21:38:34 +0000 (22:38 +0100)]
DecodeTrace: Try to keep annotation labels within the view
Up until now, annotation labels were always drawn centered,
even if the annotation was very wide and mostly off-screen.
This resulted in annotation labels being out of view, even
if there would be enough space to draw it within the view.
This patch fixes this.
Soeren Apel [Wed, 30 Dec 2015 17:34:47 +0000 (18:34 +0100)]
DecodeTrace: Prevent trace height from jumping
In 506317984393a41000650ccca868f3dd66872a4f, the decode
trace height was made dependent on the number of currently
visible annotation rows.
This however has issues: when zooming in on an area where
there are no annotations, the height of the decode trace
collapses. With this patch, this can't happen anymore as
a new variable keeps track of the maximum number of
annotation rows ever encountered, keeping the decoder
trace height stable.
Soeren Apel [Wed, 30 Dec 2015 17:00:46 +0000 (18:00 +0100)]
DecodeTrace: Improve annotation block drawing
Instead of just drawing blocks using the color of the first
annotation in the block, draw a "special" annotation
with a dotted pattern.
The color of this annotation depends on the annotations
in that range: a color is used if they're all of the same
annotation class. If there's different kinds, gray is used.
Soeren Apel [Sat, 12 Dec 2015 14:01:03 +0000 (15:01 +0100)]
Session: Allow using sample rate from meta packet
Currently, PV only looks at the device config to determine the
sample rate. This breaks as input filters submit meta packets
containing the sample rate and provide no device config.
Example: load any file in PV using the raw binary input filter
and set the sample rate to anything but 0. PV will still show
'sa' as the time unit, indicating that it dismisses the sample
rate information sent in the meta packet.
This patch makes this work by using the sample rate if it
wasn't already set from the device config.
Tilman Sauerbeck [Mon, 23 Nov 2015 18:07:59 +0000 (19:07 +0100)]
LogicSignal: Put all trigger matches into a single trigger stage.
Previously each trigger match was assigned its own trigger stage,
which is problematic because devices may not support more than one
stage.
Ideally we would want the user to decide which matches go into
which stages, but that's a long way off and this change makes
things work just a little bit better for more devices.
This will be used in a follow-up changeset for the markers that
visualize the time of SR_DF_TRIGGER.
Note that this copies a little code from the TimeMarker class,
but that seemed a better idea than deriving from it and disabling
the popup and label-drawing code.
Soeren Apel [Thu, 5 Nov 2015 18:14:46 +0000 (19:14 +0100)]
StoreSession: Observe proper range order
When I wrote the original solution I wanted min() and abs()
to take care of this issue. However, I forgot that abs()
works on a difference of two uint64_t, so this subtraction
will underflow if the range is in the wrong order.
Converting them to int64_t isn't a good solution, so I'm now
using an ordinary condition instead.
Daniel Elstner [Mon, 2 Nov 2015 21:14:39 +0000 (22:14 +0100)]
build: Limit auto-versioning to git revision hash
When building from a git checkout and HEAD does not exactly match
a tag, append the shortened revision hash to the hardcoded version
string. Do not attempt to provide any information beyond that.
This brings the PulseView versioning in line with the other modules
in the sigrok stack.
Aurelien Jacobs [Sat, 24 Oct 2015 20:18:42 +0000 (22:18 +0200)]
avoid using deprecated std::autoptr
This fixes the following g++-5 warning:
pv/dialogs/about.hpp:51:7: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
std::auto_ptr<QTextDocument> supportedDoc;