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
Soeren Apel [Sat, 27 May 2017 14:31:15 +0000 (16:31 +0200)]
DeviceManager: Show progress dialog while scanning for devices
We don't want users to wonder why nothing happens when they
start PV and no window shows up. Providing this dialog lets
them know that PV is starting and doing something.
Soeren Apel [Fri, 26 May 2017 14:19:56 +0000 (16:19 +0200)]
Rework signaling mechanism for trace repainting
Before, analog traces would request a repaint of the entire
view when they receive data. To understand how bad this was,
consider 4 enabled analog channels during capture. Every time
one channel would receive a bunch of sample data, it would
force a repaint of the view, resulting in 4 unnecessary
repaints.
To fix this, the analog traces no longer request a repaint
on incoming sample data. Instead, the mechanism now is such
that the view "collates" repaint requests from all used
signalbases by means of a one-shot timer, i.e. any repaint
request is ignored if the timer is already running.
With the timer, we can also establish an upper bound on
how often the trace should update at most, currently 25Hz.
Since this functionality is very useful for any kind of
view, the existing one-shot timer was moved to the ViewBase
and then extended as explained.
Soeren Apel [Thu, 25 May 2017 12:30:46 +0000 (14:30 +0200)]
Disable context menus that could lead to users removing UI parts
If a user removes the main toolbar then there's no way to get it
back. We don't want that.
If a user removes a dock window's contents he can get it back
by using the same context menu but it's a useless feature for us
and potentially very confusing, so we disable this, too.
Soeren Apel [Wed, 24 May 2017 21:50:37 +0000 (23:50 +0200)]
Fix #895 by adapting to Qt5 and cleaning up properly
Relevant Qt commit:
https://codereview.qt-project.org/#/c/72637/
"QProgressDialog: don't require setValue(0) to be called."
"Fixed by starting the timer in the constructor (most code doesn't reuse
progress dialogs, so this fixes the most common case)"
This messes us up because we're (ab-)using the dialog
in a non-standard way.
https://bugreports.qt.io/browse/QTBUG-47042
"QProgressDialog is designed to show itself automatically, based
on an internal estimate for the duration of the operation and the
minimumDuration property. You never call show() or exec() on it
manually. You're also not supposed to keep it around when it's not
used. In 5.4, the only way to start the internal duration estimation
was to call setValue(0). But we noticed that many people didn't call
setValue(0)"
Soeren Apel [Wed, 24 May 2017 11:44:43 +0000 (13:44 +0200)]
Fix #940 by updating the div spin boxes when needed
Also, prevent the autoranging algo from changing the div
assigment when the user is in the process of changing it.
This way, we only change the div assignment during
acquisition, which is when we actually need this feature.
Uwe Hermann [Tue, 9 May 2017 20:08:59 +0000 (22:08 +0200)]
Log settings location when using "-l 5".
This can have various types (e.g. a file or a registry entry) and it can
be in various locations on different OSes, so having this as part of the
log output is pretty useful.
Soeren Apel [Mon, 1 May 2017 13:04:10 +0000 (15:04 +0200)]
Segment: Rework append_samples() so it can handle large input
Before, adding large blocks of samples didn't work if they
would fill the current chunk, fill a new one and still have
data left to add. Using an iterative approach fixes this and
also makes the function more elegant.