Soeren Apel [Sun, 21 May 2017 22:24:10 +0000 (00:24 +0200)]
DecodeSignal: Adjust the DecodeChunkLength
The initial 4096 was too low, though it did make the UI
quite responsive. In 9cc264 it was increased to 10*1024*1024
to speed up decoding but that makes the UI stall very badly
under certain circumstances (e.g. when changing the baud rate
for UART by entering digits).
The reason is that every time a decoder property is changed,
the decode is restarted. Restarting the decode means that
the currently running processes need to shut down, so
they're told to do so and the GUI thread waits for them
to finish.
However, the srd_session_send() call is blocking, meaning
that libsrd will happily block the PV GUI thread until it's
done processing the current chunk of data.
For this reason, DecodeChunkLength can't be too high and
256*1024 looks like a reasonable compromise for now.
Before, we'd redraw the decode trace every n annotations that
came in. However, that causes a lot of unnecessary redraws
when we're zoomed out relatively far and makes the UI less
responsive in return.
Instead, use a one-shot timer with a fixed delay to redraw
the trace after data has been processed. This way, there is
an upper bound to how often we redraw the trace while at the
same time providing a fixed interval at which we update,
regardless of how many annotations came in, making the
trace fill up continuously.
With that in place, we can also remove annotation_count_
and inc_annotation_count().
Soeren Apel [Wed, 17 May 2017 06:31:07 +0000 (08:31 +0200)]
DecodeSignal: Rework samplerate handling
Before, running an acquisition, then changing the
samplerate and then running the acquisition again
would result in the wrong (i.e. previous) samplerate
to be used for SRD. This patch fixes this.
Soeren Apel [Thu, 11 May 2017 07:15:55 +0000 (09:15 +0200)]
DecodeSignal: Change srd session handling
Before, we would hold onto the global srd mutex until all data
was processed and then destroy the srd session, making it
necessary to re-create the srd session (and thus run all data
through the PD again) when new data comes in.
This patch changes this so that we keep the srd session around
when we wait for input data, allowing us to re-use the existing
session when new data comes in. Also, this enables us to
release the global srd mutex when waiting, which wasn't
possible before.
Soeren Apel [Wed, 14 Jun 2017 06:30:43 +0000 (08:30 +0200)]
Merge DecoderStack into DecodeSignal
Several changes make up this commit, which unfortunately
can't be separated:
1) Move decoder stack management from DecoderStack to
DecodeSignal, thereby making DecoderStack unnecessary
2) Change the decoder stack from std::list to an
std::vector for direct decoder access
3) Introduce logic_mux_thread which will take care
of muxing the individual SignalBases' logic data into
(cached) logic data that libsigrokdecode expects.
This is necessary as we can no longer do simple bit
mapping within a single logic data segment's logic
data as we now may feed from multiple logic data
segments at once
4) Refactored the creation of decode traces, making
it more streamlined and flexible while simplifying
the class interface
5) Refactored the auto-assignment of channels
6) Refactored is_decode_signal()
7) Reworked decode signal save/restore, allowing
proper handling and with the decoder stack now
being part of the signal, easier save/restore of
the stack and its settings
For starters, we equip it with some basic wrappers
around the decode stack, rework the annotation signal
a little and use the new DecodeSignal in favor of the
SignalBase class.
Gerhard Sittig [Sun, 25 Jun 2017 18:11:39 +0000 (20:11 +0200)]
main window: Prefer the user specified device in new sessions
Prefer the device that was found with user provided scan options when a
-d command line option was specified. Stick with the previous selection
of "genuine" devices before demo otherwise (when nothing was found, or
when -d was not specified).
Gerhard Sittig [Sun, 25 Jun 2017 17:56:33 +0000 (19:56 +0200)]
device manager: Add support for -d cmdline option (driver scan options)
The previous implementation had support to auto-detect devices and to
connect to and pick devices by filling in dialogs, optionally providing
scan options that did not apply to auto-detection. This commit extends
the existing support by introducing a -d command line option similar to
sigrok-cli.
In the absence of the -d command line option, behaviour is identical to
the previous implementation. When -d is provided, the specified driver
is excluded from the auto-detection phase, and another scan is executed
afterwards where the user specified scan options take effect. This shall
result in least interaction and highest reliability of device detection,
while flexibility is increased.
Here are examples of what the -d command line option can do:
Gerhard Sittig [Sun, 11 Jun 2017 09:10:33 +0000 (11:10 +0200)]
device manager: Move filter for supported devices to the scan routine
Move the check for supported monotonic rate devices from the call site
into the actual scan routine.
The scan routine already used to (store and) return a variable length
set of found devices including none, and call sites can cope with this
situation. Pending extensions may call the scan routine several times,
and callers shall not duplicate the extra test condition. While we
expect the specific test for what's supported to change in the future.
Gerhard Sittig [Sun, 25 Jun 2017 17:40:14 +0000 (19:40 +0200)]
session: Add support for input format options (-I cmdline parameter)
The previous implementation supported the selection of an input format
by means of the -I command line option. This commit extends the feature
by adding support for colon separated input format options similar to
sigrok-cli.
This allows users to open files from the command line which previously
became only available after filling in dialogs, and resulted in errors
in the absence of options. Here is an example of how to use the option:
Uwe Hermann [Sun, 11 Jun 2017 18:05:50 +0000 (20:05 +0200)]
Rename sigrok-logo-notext.png to pulseview.png.
This is more specific and prevents any potential issues e.g. when
multiple distro packages might ship with a generic file like
sigrok-logo-notext.png that's supposed to be installed in the same place.
Soeren Apel [Fri, 9 Jun 2017 20:44:38 +0000 (22:44 +0200)]
View: Improve 2a9fcd621 by using settings_restored_
The timer is no longer needed as the introduction of
settings_restored_ allows us to determine whether we
should resize the trace label header to its proper
width when the show event is received.
This is because the show event is received only after
all widget resizing took place. This means that the
header pane sizes will be reliable at this point,
making this solution much cleaner than relying on
a timer repeatedly calling expand_header_to_fit().
Soeren Apel [Wed, 7 Jun 2017 16:18:24 +0000 (18:18 +0200)]
Fix #970 by making sure the session state handler can be called
Before, the session did call Session::stop_capture() and fired
the signal to notify of its capture state change. However, the
Session object was deleted before the next run of the Qt event
loop. As the Qt event loop dismisses signals originating from
deleted objects, the connected event handler
MainWindow::on_capture_state_changed() was never called.
To remedy this, we call Session::stop_capture() before the
destruction of the object and force a run of the event loop
immediately afterwards. This way, the event handler is called
and the run/stop button updated properly.
Soeren Apel [Tue, 6 Jun 2017 14:16:11 +0000 (16:16 +0200)]
Update cli usage hint and remove unnecessary description text
I don't know any cli tool that shows a description text
on the same line as the usage and sigrok-cli doesn't do it
either, so it shouldn't be there.
As I don't see any other place where it would make sense,
I remove it completely.
Uwe Hermann [Thu, 11 May 2017 20:58:58 +0000 (22:58 +0200)]
Allow users to set initial pin states for decoders.
This uses the new srd_inst_initial_pins_set_all() libsigrokdecode API
which allows frontends to set the assumed initial pins (i.e., the assumed
state of the pins before the first sample of a capture) to user-specified
values.
The assumed initial pins can be either low, or high, or "use same value
as the first sample of the capture".
Soeren Apel [Sun, 4 Jun 2017 20:11:59 +0000 (22:11 +0200)]
View: Optimize header pane sizing
Before, the header pane didn't resize to accomodate all signals
when a new session was created and a driver selected (e.g. demo).
To fix this, the header pane autosizing was put in a method of
its own and is now called when new signals are added.
Also, the name of header_fully_visible() needed adjustment
because it also returned true when it *wasn't* 100% visible
due to the margin of error that we permit. It's now called
header_was_shrunk() and its return value logic inverted.
Uwe Hermann [Sun, 4 Jun 2017 18:52:11 +0000 (20:52 +0200)]
Installer: Add "PulseView" to uninstaller/Zadig links.
Windows 10 merges all links of the same vendor ("sigrok" here) into one
section in the Start menu. If PulseView and sigrok-cli are installed,
there will be two "Uninstall" links and the user will not know which one
uninstalls which program.
Soeren Apel [Sat, 3 Jun 2017 20:44:28 +0000 (22:44 +0200)]
Don't use Q_EMIT, it's not needed anymore
The Q_EMIT macro (just like the regular Qt emit) is syntactic
sugar to let people who read the code know that a method call
placed somewhere is actually a signal.
We don't use Q_EMIT consistently throughout PV and I don't
think it's really needed anyway, so this patch removes the
few remaining instances.
Soeren Apel [Thu, 1 Jun 2017 19:16:27 +0000 (21:16 +0200)]
Remove Header::BaselineOffset and move arrows as needed instead
The baseline offset was used to keep 5px of distance between
the tip of the arrow and the scroll area. This way, the shadow
that is drawn around the arrow when it's selected won't get
cropped.
However, we can do this differently: instead of always keeping
the empty space around, we make the arrows align at the edge
of the widget space as they should and when they're selected,
we push them aside to the left so the shadow can still be
painted without cropping.
Logically, one would assume that the arrow's label also should
be moving left but I decided against it because this way it
looks as if the arrow didn't actually move, keeping all arrow
labels lined up.
Uwe Hermann [Thu, 1 Jun 2017 18:58:16 +0000 (20:58 +0200)]
desktop file: Add additional Development category.
Apparently, e.g. on KDE Plasma, having PulseView only in the Electronics
category (which seems to not necessarily exist) leads to PulseView
showing up in a "Lost&Found" category instead.
We're adding the Development category in addition to Electronics
(e.g. Kicad does the same) to have PulseView in Development if there's
no Electronics category.
Soeren Apel [Tue, 30 May 2017 06:07:50 +0000 (08:07 +0200)]
View: Adjust top margin when needed
When the view is big and the traces are vertically centered,
there will be blank space above and below the block of traces.
When the user then resizes the window and makes it smaller,
the white space stays, pushing traces out of the view that
could fit on-screen if the blank space was adjusted properly.
This is what we do with this patch.
If there is still enough space to make everything fit, we
center the traces vertically. If there's not enough space
to make everything fit, we make sure that the top traces
are shown.
Were okay but it showed that there was one case they didn't
cover: the first session receives a resize notification upon
startup whereas all other sessions don't. This means that
sessions restored from a previous run suddenly see the
size_finalized_ variable always staying at false - until the
user resizes the window.
While figuring out how to cover this case, I realized that
there is actually an easier way to perform all this:
instead of keeping an internal state of when and how we
received useless and useful resize notifications, we just
act upon the "show" event, which always comes after all
the widget resizing has been performed. This way, we can
remove the size_finalized_ variable completely and as it
is definitely always received when a session is shown,
we always end up in a sane and correct state.
Note: to reproduce, open up a 2nd session and use demo.
Then, when using the group handle to move the analog traces
upwards, you'll notice that the logic traces will move down
at the same time. This is because size_finalized_ is false
and the view will always center the traces vertically.
Sylvain Munaut [Sun, 28 May 2017 14:53:27 +0000 (16:53 +0200)]
viewport: Allow smoother zoom using vertical scroll events
The zoom supports 'double' as input type but since delta() and 120 are
integer, this wasn't used and any event with a delta lower than 120 was
ignored.
With this mod, the zoom level changes are _much_ smoother on trackpads