Commit Graph

88 Commits

Author SHA1 Message Date
Soeren Apel 7f894d958e Fix #1132 by passing segment IDs, not segment instances
Passing segment instances fails because this creates a race condition.
When a long conversion is taking place, the SignalBase::samples_added
signal is called often but since it's in a separate thread, the calls
are queued and aren't executed immediately. Now if the conversion is
restarted - for example as a result of a changed conversion threshold -
then the segments holding the converted data are destroyed, rendering
the pointers submitted as parameters to samples_added invalid.

Once the signal queue is processed, those invalid pointers will be
accessed and PV segfaults.

Since the signal queue can neither be emptied nor flushed, this
leaves only two sensible choices:
1) Signal samples_added less often, thereby reducing the chance of
signals being queued
2) Supply the segment ID instead of the segment instance as that's
essentially the only thing we currently care about - in fact, the
only user of samples_added (ViewBase::on_samples_added) uses the
instance to query only this

As #1 is only a band-aid and not a waterproof solution, I chose
to go with #2.
2018-03-05 23:45:46 +01:00
Martin Errenst 57c04e781e fix PulseView compilation with ENABLE_DECODE set to OFF 2018-02-10 21:09:00 +01:00
Cenkron 5408524db0 Ruler tick legends don't partly disappear when scrolled off the ends 2018-02-08 10:47:28 +01:00
Soeren Apel d0c0573b3e Rework the callback mechanism for the global settings
Up to now, registered callbacks could not be unregistered
because std::function does not permit comparing for equality.

Using an interface class removes the need for std::function,
making the mechanism a little less elegant but at least fully
functional.
2018-02-07 19:41:56 +01:00
Soeren Apel 451dc5f33f View: Fully integrate the "zero trigger time" setting 2018-02-07 19:41:56 +01:00
Soeren Apel 7ea2a4ff07 Session/View: Save triggers in a list and use it 2018-02-07 19:41:56 +01:00
Cenkron 4a07615736 Change the number of minor ticks to be either 4 or 5
Depends on the current tick interval size, in the sense of the 1, 2, 5
sequence. It was originally always 4.
2018-02-07 19:41:56 +01:00
Cenkron ffc00fdd59 Provide a settings checkbox for showing zero at the trigger 2018-02-07 19:41:51 +01:00
Soeren Apel 89914a8657 Add segment display mode UI controls and some related changes 2018-01-10 00:40:44 +01:00
Soeren Apel 8c33974131 Supply the segment ID when adding samples to optimize trace painting
Use case is as follows:
- Capture 20+ segments with ~500kS each
- Afterwards, enable conversion for a channel

Without this change, the converted logic will be repainted
20++ times because we are only told that new samples were
added but not which segment.

With this change, the logic trace is only painted when we
see that samples were added to the segment we're showing.
2018-01-10 00:34:39 +01:00
Soeren Apel 558ad6ceb9 Implement Trace::ShowLastCompleteSegmentOnly display mode 2018-01-05 22:50:35 +01:00
Soeren Apel 8a603e135f Finalize segment decoding 2018-01-05 22:50:21 +01:00
Soeren Apel 3734c4645f View: Fixes related to multi-segment display 2018-01-05 22:49:17 +01:00
Soeren Apel 72435789a0 Prepare multi-segment protocol decoding ability 2017-12-27 18:40:19 +01:00
Soeren Apel 5ecf957f9f Begin PD multisegment support 2017-12-27 18:40:19 +01:00
Soeren Apel 2749b858a7 Move current_segment_ to Trace 2017-12-27 18:40:19 +01:00
Soeren Apel 341d9a7975 Flesh out segment display mode handling 2017-12-27 18:40:19 +01:00
Soeren Apel 7daebd054e Implement segment display mode handling and update notifications 2017-12-27 18:40:19 +01:00
Soeren Apel 4e86ec7042 Rework new segment notification mechanism 2017-10-29 23:38:06 +01:00
Soeren Apel 60c426a05d TraceView: Properly handle the header resizing events 2017-09-22 21:13:48 +02:00
Soeren Apel 9510aea0fc TraceView: Make header resize state determination reliable 2017-09-22 21:13:48 +02:00
Soeren Apel 572c3bb71a View: Move comment to where it belongs 2017-09-22 21:13:48 +02:00
Soeren Apel 00c518d66a Adjust trace view header width when signal names change
This change is primarily needed because before, newly
created decode signals had a name assigned to them at time
of the constructor call. This changed, and now the name
is empty upon creation, breaking the previously working
header size adjustment.
2017-09-22 21:13:48 +02:00
Soeren Apel eee3eab962 DecodeTrace: Reset cached trace properties when decoder stack resets 2017-09-22 21:13:48 +02:00
Soeren Apel 526c8c00a6 Implement showing only the selected segment 2017-09-22 20:58:16 +02:00
Soeren Apel 7f9654641c Add segment selector UI + helpers 2017-09-22 20:58:16 +02:00
Soeren Apel 03d2a4f8ca AnalogSignal: Prevent threshold bg from spilling beyond extents 2017-08-21 19:58:49 +02:00
Soeren Apel d37ff80d1d Implement "show conversion thresholds as dots" mode 2017-08-20 16:18:57 +02:00
Soeren Apel 90ee1ed9a9 Convert threshold display setting to a multi-value choice 2017-08-20 16:18:50 +02:00
Soeren Apel 78bf7ce5aa AnalogSignal: Make threshold neutral area darker 2017-08-17 08:30:29 +02:00
Soeren Apel 2601ce965f AnalogSignal: Use setting change handler for threshold display 2017-08-08 19:40:11 +02:00
Soeren Apel 1d150cd6ea AnalogSignal: Draw analog thresholds differently
Instead of using a patterned region on top of the trace,
show the thresholds by using different background colors
for the individual areas: green/grey/red.
2017-08-07 21:41:11 +02:00
Soeren Apel bca3faab89 View: Update ruler after restoring session
If we don't do this, the ruler is out-of-sync with the rest
of the view until the session is loaded and goes into stopped
state. At that point, the ruler is updated, which is too late.
2017-08-05 22:38:45 +02:00
Soeren Apel c6d9cf6582 Use min/max notification for autoranging of analog signals 2017-08-03 13:16:21 +02:00
Soeren Apel 932bc2461d Move delayed conversion starter to SignalBase
This way, we can use the same mechanism for changing
min/max as well, preventing multiple successive starts
of the conversion algorithm.
Preventing this is necessary because it makes the UI
stop updating for a significant amount of time, which
we obviously don't want.
2017-08-03 13:16:21 +02:00
Soeren Apel f0f9c8566b Use identifiers for fixed conversion preset values 2017-08-03 13:06:27 +02:00
Uwe Hermann f529583485 Fix some random clang-tidy warnings. 2017-08-02 10:52:52 +02:00
Soeren Apel 561ba3ae05 Trace view: Make the zero line for analog traces thicker
This is to make it stand out more and make it easily
distinguishable.
2017-08-01 14:42:20 +02:00
Soeren Apel 4433246b9e Implement graphical display of A2L thresholds 2017-08-01 14:42:20 +02:00
Soeren Apel b9cdbe03be Typo fix: treshold -> threshold 2017-08-01 14:42:20 +02:00
Soeren Apel c6b017fb7a AnalogSignal: Reword "traces to show" option 2017-08-01 14:42:20 +02:00
Soeren Apel 2b6e7a7213 AnalogSignal: Use pv::data::SignalBase namespace 2017-08-01 14:42:20 +02:00
Soeren Apel 52c900ac86 Implement A2L presets and custom threshold handling 2017-08-01 14:42:20 +02:00
Soeren Apel 06b6ce2669 Use getter for the conversion type instead of a local copy
Don't ask me why I used a local copy in the first place,
even I can't figure it out :)
2017-07-25 16:09:08 +02:00
Soeren Apel 1373fec592 Trace View: Add doxygen comments to some classes 2017-07-23 22:17:16 +02:00
Soeren Apel 873e80357d Improve hover point signaling
Two issues here:
1) it's bad style to have an event handler for an event
that was triggered in the same class
2) supplying the current hover point along with the event
is a sensible thing to do
2017-07-23 09:35:25 +02:00
Soeren Apel 2d458a761b Remove signal scale handle
It will be replaced by a different mechanism.
2017-07-22 21:42:50 +02:00
Soeren Apel 963be49714 TriggerMarker: Don't return "valid" drag point coordinates 2017-07-22 21:42:50 +02:00
Soeren Apel a3d5a7c768 Rename ViewItem::point() to ViewItem::drag_point() for clarity 2017-07-22 21:42:50 +02:00
Soeren Apel a2b2b65ebc LogicSignal: Make trace height adjustable 2017-07-16 22:37:12 +02:00