Commit Graph

1844 Commits

Author SHA1 Message Date
Cenkron b732b48faf win32: Use -mwindows only for non-Debug targets.
Direct cmake to apply the -mwindows linker switch based on a cmake
command line argument rather than by using a patch file. The command
line argument is -DCMAKE_BUILD_TYPE=xxxxx and applies the linker switch
only to WIN32 builds that are not Debug.
2018-01-13 18:42:36 +01:00
Gerhard Sittig c5f9553c0b DecodeSignal: Void a session pointer after destroy() call
Fixup an error path when starting a created decoder session fails.
2018-01-11 21:42:45 +01:00
Gerhard Sittig ed6f8680ba main.cpp: check log level range before using its value
(Silently) ignore invalid -l loglevel specs. This avoids a crash
reported in bug #1071.
2018-01-10 19:19:35 +01:00
Soeren Apel 83c59147c7 Fix unit tests 2018-01-10 00:40:44 +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 c6e0990ea7 Add segment display mode icons 2018-01-10 00:34:39 +01:00
Soeren Apel 9009d9b5ca Session: Make get_segment_count() consider all segments
Also changes the type for the getters to uint32_t.
2018-01-10 00:34:39 +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 85a702806a Add segment_id to all segment classes 2018-01-10 00:34:39 +01:00
Soeren Apel 4d08da71e2 LogicSegment: Don't use new/delete in get_unpacked_sample() 2018-01-10 00:34:39 +01:00
Soeren Apel 4cc0df94c1 LogicSegment: Limit end in get_subsampled_edges() if needed
This is necessary because there is a race condition between
adding samples and trace repainting.
2018-01-10 00:34:38 +01:00
Soeren Apel 2b3dda54bb SignalBase: Don't terminate conversion when there's no data
Instead of terminating, we wait instead.
We do this because SignalBase::on_samples_added() somehow doesn't
reliably see that there's no conversion thread active anymore.
conversion_thread_.joinable() returns true when the thread was
already terminated for whatever reason, resulting in on_samples_added()
trying to notify a non-existant thread.
2018-01-10 00:33:54 +01:00
Soeren Apel 558ad6ceb9 Implement Trace::ShowLastCompleteSegmentOnly display mode 2018-01-05 22:50:35 +01:00
Soeren Apel 65efd0258b DecodeSignal: Restructure metadata handling
Instead of handling the metadata separately from the mux/decode segments,
it's much neater to handle both together. Doing this also allows us to
remove the need for query_input_metadata() since we're taking the metadata
from the muxed logic segments.
2018-01-05 22:50:31 +01:00
Soeren Apel 63253d7271 SignalBase: Implement multi-segment conversion 2018-01-05 22:50:26 +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 ed535cd705 DecodeSignal: Mux all segments 2018-01-05 22:48:45 +01:00
Soeren Apel 72435789a0 Prepare multi-segment protocol decoding ability 2017-12-27 18:40:19 +01:00
Soeren Apel ba5f21864c DecodeSignal: Allow muxed logic data to be cached 2017-12-27 18:40:19 +01:00
Soeren Apel f2f4845f15 DecodeSignal: Rename some items 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 aa8da126bb Don't set SR_CONF_LIMIT_FRAMES to 1 2017-12-27 18:40:19 +01:00
probonopd 7c64a694ae Make it pass desktop-file-validate
https://travis-ci.org/AppImage/appimage.github.io/builds/306921880#L695
2017-12-17 21:54:30 +01:00
Soeren Apel aa71890d74 DecodeSignal: Make sure bit IDs are always up-to-date
https://www.youtube.com/watch?v=mw6Bd6Hv168 shows what
happens when this isn't done.
2017-12-13 14:03:59 +01:00
Philipp Marek a00f8221dc Session: Fix mismatched delete operator.
Mismatched free() / delete / delete []
   at 0x4C2D31B: operator delete(void*) (vg_replace_malloc.c:576)
   by 0x1C76D0: operator() (unique_ptr.h:78)
   by 0x1C76D0: ~unique_ptr (unique_ptr.h:268)
   by 0x1C76D0: pv::data::AnalogSegment::append_interleaved_samples(float const*, unsigned long, unsigned long) (analogsegment.cpp:78)
...
Address 0x1d123f70 is 0 bytes inside a block of size 312 alloc'd
   at 0x4C2C97F: operator new[](unsigned long) (vg_replace_malloc.c:423)
   by 0x1C765E: pv::data::AnalogSegment::append_interleaved_samples(float const*, unsigned long, unsigned long) (analogsegment.cpp:78)
   by 0x1AFDD5: pv::Session::feed_in_analog(std::shared_ptr<sigrok::Analog>) (session.cpp:1142)
2017-11-18 13:53:44 +01:00
Philipp Marek 09fa270252 .gitignore: Don't care about the doxygen-generated files. 2017-11-18 13:53:12 +01:00
Philipp Marek f9274b6890 Session: Fix mismatched delete operator.
Valgrind reported this here:

Mismatched free() / delete / delete []
   at 0x4C2D31B: operator delete(void*) (vg_replace_malloc.c:576)
   by 0x1C76D0: operator() (unique_ptr.h:78)
   by 0x1C76D0: ~unique_ptr (unique_ptr.h:268)
   by 0x1C76D0: pv::data::AnalogSegment::append_interleaved_samples(float const*, unsigned long, unsigned long) (analogsegment.cpp:78)
   by 0x1AFDD5: pv::Session::feed_in_analog(std::shared_ptr<sigrok::Analog>) (session.cpp:1142)
   by 0x1B043C: pv::Session::data_feed_in(std::shared_ptr<sigrok::Device>, std::shared_ptr<sigrok::Packet>) (session.cpp:1187)
...
 Address 0x1cbf6b90 is 0 bytes inside a block of size 940 alloc'd
   at 0x4C2C97F: operator new[](unsigned long) (vg_replace_malloc.c:423)
   by 0x1C765E: pv::data::AnalogSegment::append_interleaved_samples(float const*, unsigned long, unsigned long) (analogsegment.cpp:78)
   by 0x1AFDD5: pv::Session::feed_in_analog(std::shared_ptr<sigrok::Analog>) (session.cpp:1142)
2017-11-17 11:55:37 +01:00
Soeren Apel 4e86ec7042 Rework new segment notification mechanism 2017-10-29 23:38:06 +01:00
Soeren Apel bc93f1ef2f Append new segments to the end, not the beginning of the list 2017-10-27 18:44:51 +02:00
Soeren Apel b5940cf0ef Session: Query the device's sample rate when needed, not sooner 2017-10-09 17:47:19 +02:00
Soeren Apel b8132c767b DecodeSignal: Remove outdated code and comment 2017-09-23 08:33:16 +02:00
Soeren Apel 8d3c0f7a0b SignalBase: Make sure PDs are restarted when conv options change 2017-09-22 21:13:48 +02: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 4913560f88 DecodeSignal: Break up annotation storage to allow multiple segments 2017-09-22 21:13:47 +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
Uwe Hermann 1becee23bd rowdata: Use emplace_back() for Annotation objects.
This should eliminate one unnecessary allocation per annotation.
2017-09-22 12:03:14 +02:00
Soeren Apel 83b9c07b79 Rename DecodeSignal::segment_ to logic_mux_segment_ for clarity 2017-09-08 21:01:55 +02:00
Soeren Apel 6e7a4a0066 Fix #1024 by changing decode channel assigment to PDs
When assigning the decoder stack channels to the libsrd
instance's channels, channels that had no signal assigned
to them were still assigned anyway. This patch fixes this bug.

After doing this, another subtle bug became apparent:
The mapping between channels and bits in the data stream sent
to the PD was done via DecodeChannel->id. This is however
insufficient as the channels of the decoder stack have
IDs that may or may not match the ID needed for the data
stream. Example:

A PD has 4 channels: A, B, C and D. In PV, those channels
have the IDs 0, 1, 2 and 3. If the user only assigns A and D,
Decoder::create_decoder_inst() will use the IDs 0 and 3 as
the bit positions of those signals in the data stream sent
to libsrd. This is obviously wrong.

Hence, we now use a separate bit_id for this purpose.
2017-09-08 21:01:41 +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