pulseview.git
2 years agoMerge DecoderStack into DecodeSignal
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

2 years agoRework decode sample count getters
Soeren Apel [Fri, 14 Apr 2017 11:10:14 +0000 (13:10 +0200)]
Rework decode sample count getters

2 years agoRemove DecodeStack dependency from decode binding wrapper
Soeren Apel [Thu, 13 Apr 2017 16:02:20 +0000 (18:02 +0200)]
Remove DecodeStack dependency from decode binding wrapper

2 years agoMove more functionality into DecodeSignal
Soeren Apel [Wed, 12 Apr 2017 20:06:29 +0000 (22:06 +0200)]
Move more functionality into DecodeSignal

2 years agoRework decode channel auto-assignment
Soeren Apel [Tue, 13 Jun 2017 19:32:04 +0000 (21:32 +0200)]
Rework decode channel auto-assignment

2 years agoRe-use DecodeTrace::ChannelSelector as DecodeChannel
Soeren Apel [Tue, 4 Jul 2017 20:17:22 +0000 (22:17 +0200)]
Re-use DecodeTrace::ChannelSelector as DecodeChannel

2 years agoShift more methods to DecodeSignal
Soeren Apel [Sat, 8 Apr 2017 10:51:13 +0000 (12:51 +0200)]
Shift more methods to DecodeSignal

2 years agoIntroduce DecodeSignal class
Soeren Apel [Fri, 7 Apr 2017 20:18:38 +0000 (22:18 +0200)]
Introduce DecodeSignal class

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.

2 years agoRevert 33d5aa61e77e61f700a8 to re-enable A2L conversion
Soeren Apel [Mon, 12 Jun 2017 05:06:43 +0000 (07:06 +0200)]
Revert 33d5aa61e77e61f700a8 to re-enable A2L conversion

3 years agoINSTALL: Bump requirement to libsigrokcxx >= 0.6.0.
Uwe Hermann [Mon, 26 Jun 2017 20:46:23 +0000 (22:46 +0200)]
INSTALL: Bump requirement to libsigrokcxx >= 0.6.0.

PulseView now uses APIs that are only available in
libsigrokcxx >= 0.6.0.

3 years agoMinor Doxygen comment cosmetics.
Uwe Hermann [Mon, 26 Jun 2017 20:06:23 +0000 (22:06 +0200)]
Minor Doxygen comment cosmetics.

3 years agodoc: Update pulseview(1) manpage, add --driver option (-d)
Gerhard Sittig [Wed, 7 Jun 2017 19:50:41 +0000 (21:50 +0200)]
doc: Update pulseview(1) manpage, add --driver option (-d)

3 years agomain window: Prefer the user specified device in new sessions
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).

3 years agodevice manager: Add support for -d cmdline option (driver scan options)
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:

  $ pulseview -d ols:conn=/dev/ttyACM0
  $ pulseview -d fx2lafw
  $ pulseview -d demo:logic_channels=32:analog_channels=8

This fixes bug #953.

3 years agodevice manager: Move filter for supported devices to the scan routine
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.

3 years agosession: Add support for input format options (-I cmdline parameter)
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:

  $ pulseview -I csv:header:first-channel=2 -i filename.csv

This fixes bug #951.

3 years agoutil: Introduce string tokenize helper routine
Gerhard Sittig [Sun, 25 Jun 2017 11:13:01 +0000 (13:13 +0200)]
util: Introduce string tokenize helper routine

Introduce a helper routine which splits a string into tokens that were
separated by a delimiter.

3 years agoFix #982 by correcting the bounding rect for the message
Soeren Apel [Wed, 14 Jun 2017 16:38:13 +0000 (18:38 +0200)]
Fix #982 by correcting the bounding rect for the message

3 years agoCMakeLists.txt: Bump package version to 0.5.0.
Uwe Hermann [Thu, 15 Jun 2017 14:16:58 +0000 (16:16 +0200)]
CMakeLists.txt: Bump package version to 0.5.0.

0.5.0 will be the next major release. Bump now, so that
there is no confusion of tarball 0.4.0 and 0.5.0-git snapshots.

3 years agoHACKING: Prefer git pull requests over mailing list patches.
Uwe Hermann [Tue, 13 Jun 2017 15:05:55 +0000 (17:05 +0200)]
HACKING: Prefer git pull requests over mailing list patches.

Also, drop the reference to gitorious.org (no longer available).

3 years agoHACKING: Update URL to Linux kernel coding style. pulseview-unreleased
Uwe Hermann [Tue, 13 Jun 2017 14:49:11 +0000 (16:49 +0200)]
HACKING: Update URL to Linux kernel coding style.

3 years agoNEWS: Add list of user-visible changes so far.
Uwe Hermann [Sun, 11 Jun 2017 13:33:50 +0000 (15:33 +0200)]
NEWS: Add list of user-visible changes so far.

3 years agoView: Prevent header from being resized when view is resized
Soeren Apel [Mon, 12 Jun 2017 16:21:34 +0000 (18:21 +0200)]
View: Prevent header from being resized when view is resized

3 years agoCMakeLists.txt: Install the PulseView icons.
Uwe Hermann [Sun, 11 Jun 2017 18:38:10 +0000 (20:38 +0200)]
CMakeLists.txt: Install the PulseView icons.

3 years agoCMakeLists.txt: Install the AppData/AppStream file.
Uwe Hermann [Sun, 11 Jun 2017 18:26:57 +0000 (20:26 +0200)]
CMakeLists.txt: Install the AppData/AppStream file.

3 years agoCMakeLists.txt: Install the desktop file.
Uwe Hermann [Sun, 11 Jun 2017 18:25:01 +0000 (20:25 +0200)]
CMakeLists.txt: Install the desktop file.

3 years agoRename sigrok-logo-notext.ico to pulseview.ico.
Uwe Hermann [Sun, 11 Jun 2017 18:08:17 +0000 (20:08 +0200)]
Rename sigrok-logo-notext.ico to pulseview.ico.

3 years agoRename sigrok-logo-notext.svg to pulseview.svg.
Uwe Hermann [Sun, 11 Jun 2017 18:07:15 +0000 (20:07 +0200)]
Rename sigrok-logo-notext.svg to pulseview.svg.

3 years agoRename sigrok-logo-notext.png to pulseview.png.
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.

3 years agocontrib/sigrok_mimeinfo.xml: Drop, moved to libsigrok.
Uwe Hermann [Sun, 11 Jun 2017 17:53:14 +0000 (19:53 +0200)]
contrib/sigrok_mimeinfo.xml: Drop, moved to libsigrok.

3 years agoAdjust trace view namespace
Soeren Apel [Sat, 10 Jun 2017 13:37:45 +0000 (15:37 +0200)]
Adjust trace view namespace

3 years agoMove trace view files
Soeren Apel [Sat, 10 Jun 2017 13:37:28 +0000 (15:37 +0200)]
Move trace view files

3 years agoDeviceManager: Don't perform scans with DMM drivers
Soeren Apel [Fri, 9 Jun 2017 22:57:48 +0000 (00:57 +0200)]
DeviceManager: Don't perform scans with DMM drivers

3 years agoView: Improve 2a9fcd621 by using settings_restored_
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().

3 years agoSettings: Add method to set settings defaults
Soeren Apel [Fri, 9 Jun 2017 20:06:02 +0000 (22:06 +0200)]
Settings: Add method to set settings defaults

3 years agoMain(Window): Let the UI and sessions be restored after w.show()
Soeren Apel [Fri, 9 Jun 2017 19:57:21 +0000 (21:57 +0200)]
Main(Window): Let the UI and sessions be restored after w.show()

3 years agoView: Set scroll_needs_defaults_ to true by default
Soeren Apel [Fri, 9 Jun 2017 15:49:58 +0000 (17:49 +0200)]
View: Set scroll_needs_defaults_ to true by default

3 years agoSettings: Refactor out a checkbox creator method
Soeren Apel [Thu, 8 Jun 2017 20:09:02 +0000 (22:09 +0200)]
Settings: Refactor out a checkbox creator method

3 years agoSettings: Only show initial pin config UI elements if enabled
Soeren Apel [Thu, 8 Jun 2017 20:08:19 +0000 (22:08 +0200)]
Settings: Only show initial pin config UI elements if enabled

3 years agoSettings: Add decoder settings page
Soeren Apel [Thu, 8 Jun 2017 14:02:04 +0000 (16:02 +0200)]
Settings: Add decoder settings page

3 years agoDecodeTrace: Change initial pin config description from ? to X
Soeren Apel [Thu, 8 Jun 2017 12:57:54 +0000 (14:57 +0200)]
DecodeTrace: Change initial pin config description from ? to X

3 years agoFix #970 by making sure the session state handler can be called
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.

3 years agoFix #775 by catching and handling the thrown exception
Soeren Apel [Tue, 6 Jun 2017 17:46:00 +0000 (19:46 +0200)]
Fix #775 by catching and handling the thrown exception

3 years agoMainWindow: Don't try to close a session when there is none
Soeren Apel [Tue, 6 Jun 2017 17:28:07 +0000 (19:28 +0200)]
MainWindow: Don't try to close a session when there is none

3 years agoView: Introduce settings_restored_
Soeren Apel [Tue, 6 Jun 2017 13:57:27 +0000 (15:57 +0200)]
View: Introduce settings_restored_

This way, UI elements can decide whether they can change UI
settings or whether they are already using user-set values.

3 years agoUpdate man page
Soeren Apel [Tue, 6 Jun 2017 14:16:59 +0000 (16:16 +0200)]
Update man page

3 years agoUpdate cli usage hint and remove unnecessary description text
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.

3 years agoReplace non-ASCII characters
Soeren Apel [Tue, 6 Jun 2017 12:33:54 +0000 (14:33 +0200)]
Replace non-ASCII characters

3 years agoFix #862 by implementing -c / --clean
Soeren Apel [Tue, 6 Jun 2017 14:14:54 +0000 (16:14 +0200)]
Fix #862 by implementing -c / --clean

3 years agoFix #969 by scheduling another call after a small delay
Soeren Apel [Tue, 6 Jun 2017 10:07:25 +0000 (12:07 +0200)]
Fix #969 by scheduling another call after a small delay

3 years agoDrop some trailing whitespace.
Uwe Hermann [Tue, 6 Jun 2017 09:57:35 +0000 (11:57 +0200)]
Drop some trailing whitespace.

3 years agoFix sigrok spelling in two places.
Uwe Hermann [Tue, 6 Jun 2017 08:24:30 +0000 (10:24 +0200)]
Fix sigrok spelling in two places.

3 years agopermit file names not containing dots on import
Sergey Alirzaev [Tue, 6 Jun 2017 01:23:24 +0000 (04:23 +0300)]
permit file names not containing dots on import

3 years agoAllow users to set initial pin states for decoders.
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".

3 years agoInstaller: Whitespace consistency fixes.
Uwe Hermann [Mon, 5 Jun 2017 16:10:34 +0000 (18:10 +0200)]
Installer: Whitespace consistency fixes.

3 years agoDevice: Minor whitespace change
Soeren Apel [Mon, 5 Jun 2017 12:10:08 +0000 (14:10 +0200)]
Device: Minor whitespace change

3 years agoDevice: Make capability listing more robust
Soeren Apel [Mon, 5 Jun 2017 12:09:38 +0000 (14:09 +0200)]
Device: Make capability listing more robust

3 years agoInstaller: Rename Examples.lnk
Soeren Apel [Sun, 4 Jun 2017 20:32:18 +0000 (22:32 +0200)]
Installer: Rename Examples.lnk

3 years agoInstaller: Remove examples start menu entry when uninstalling
Soeren Apel [Sun, 4 Jun 2017 20:21:04 +0000 (22:21 +0200)]
Installer: Remove examples start menu entry when uninstalling

3 years agoView: Optimize header pane sizing
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.

3 years agoInstaller: Add "PulseView" to uninstaller/Zadig links.
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.

3 years agoInstaller: Place set of example .sr files in separate section
Soeren Apel [Sun, 4 Jun 2017 18:40:04 +0000 (20:40 +0200)]
Installer: Place set of example .sr files in separate section

3 years agoInstaller: Update icon cache also after uninstallation
Soeren Apel [Sun, 4 Jun 2017 17:27:26 +0000 (19:27 +0200)]
Installer: Update icon cache also after uninstallation

3 years agoInstaller: Force icon cache refresh
Soeren Apel [Sun, 4 Jun 2017 17:28:26 +0000 (19:28 +0200)]
Installer: Force icon cache refresh

3 years agoFix #964 by adding an option to register the .sr extension with PV
Soeren Apel [Sat, 3 Jun 2017 20:47:10 +0000 (22:47 +0200)]
Fix #964 by adding an option to register the .sr extension with PV

3 years agoDon't use Q_EMIT, it's not needed anymore
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.

3 years agoView: Limit header pane width
Soeren Apel [Thu, 1 Jun 2017 20:42:20 +0000 (22:42 +0200)]
View: Limit header pane width

3 years agoView: Save/restore splitter state
Soeren Apel [Thu, 1 Jun 2017 19:51:34 +0000 (21:51 +0200)]
View: Save/restore splitter state

3 years agoRemove Header::BaselineOffset and move arrows as needed instead
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.

3 years agoFix #957 and #874 by implementing the pane splitter
Soeren Apel [Thu, 1 Jun 2017 20:21:57 +0000 (22:21 +0200)]
Fix #957 and #874 by implementing the pane splitter

3 years agoAdd a MIME info file for sigrok session files.
Uwe Hermann [Thu, 1 Jun 2017 21:32:10 +0000 (23:32 +0200)]
Add a MIME info file for sigrok session files.

File template by Stefan Brüns, thanks!

This fixes bug #857.

3 years agoorg.sigrok.PulseView.appdata.xml: Add CC0-1.0 license comment.
Uwe Hermann [Thu, 1 Jun 2017 21:48:17 +0000 (23:48 +0200)]
org.sigrok.PulseView.appdata.xml: Add CC0-1.0 license comment.

3 years agoorg.sigrok.PulseView.appdata.xml: Drop <project_group> tag.
Uwe Hermann [Thu, 1 Jun 2017 21:29:29 +0000 (23:29 +0200)]
org.sigrok.PulseView.appdata.xml: Drop <project_group> tag.

This currently causes issues with e.g. appstream-util validation:

  $ appstream-util validate-relax org.sigrok.PulseView.appdata.xml
  org.sigrok.PulseView.appdata.xml: FAILED:
  • tag-invalid           : <project_group> is not valid
  Validation of files failed

This is considered an appstream/tool bug, but for now we drop the tag in
order it to avoid issues.

https://github.com/hughsie/appstream-glib/issues/140

3 years agoorg.sigrok.PulseView.appdata.xml: Add <suggests> tags.
Uwe Hermann [Thu, 1 Jun 2017 21:41:00 +0000 (23:41 +0200)]
org.sigrok.PulseView.appdata.xml: Add <suggests> tags.

3 years agoorg.sigrok.PulseView.appdata.xml: Add <mimetype> tag.
Uwe Hermann [Thu, 1 Jun 2017 21:38:56 +0000 (23:38 +0200)]
org.sigrok.PulseView.appdata.xml: Add <mimetype> tag.

3 years agoorg.sigrok.PulseView.appdata.xml: Add <launchable> tag.
Uwe Hermann [Thu, 1 Jun 2017 21:37:03 +0000 (23:37 +0200)]
org.sigrok.PulseView.appdata.xml: Add <launchable> tag.

3 years agodesktop file: Add CC0-1.0 license comment.
Uwe Hermann [Thu, 1 Jun 2017 21:48:12 +0000 (23:48 +0200)]
desktop file: Add CC0-1.0 license comment.

3 years agodesktop file: Add additional Development category.
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.

3 years agodesktop file: Add MimeType field.
Uwe Hermann [Thu, 1 Jun 2017 18:50:28 +0000 (20:50 +0200)]
desktop file: Add MimeType field.

This fixes bug #858.

3 years agodesktop file: Rename to org.sigrok.PulseView.desktop.
Uwe Hermann [Wed, 31 May 2017 22:55:27 +0000 (00:55 +0200)]
desktop file: Rename to org.sigrok.PulseView.desktop.

3 years agodesktop file: Minor rewording.
Uwe Hermann [Wed, 31 May 2017 22:25:29 +0000 (00:25 +0200)]
desktop file: Minor rewording.

3 years agoFix #859: Add Appdata definition for PulseView
Stefan Brüns [Sun, 28 May 2017 19:31:00 +0000 (21:31 +0200)]
Fix #859: Add Appdata definition for PulseView

To be visible in KDE's Discover and GNOME Software,
an appdata definition is required.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
3 years agoView: Adjust top margin when needed
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.

3 years agoTraceView: Improve the way we do the initial scrolling setup
Soeren Apel [Tue, 30 May 2017 06:01:25 +0000 (08:01 +0200)]
TraceView: Improve the way we do the initial scrolling setup

The two commits
ae5f66281c38a76dcb7011907d7a86a99b9dd4dd and
66e4eae9ce743016c3f6d4974bceb9b7fc0ae7d7

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.

3 years agoPaint sampling points on the actual trace, not the center line
Soeren Apel [Mon, 29 May 2017 18:50:16 +0000 (20:50 +0200)]
Paint sampling points on the actual trace, not the center line

3 years agoBump requirements to libsigrok/libsigrokdecode 0.5.0.
Uwe Hermann [Sun, 28 May 2017 16:29:10 +0000 (18:29 +0200)]
Bump requirements to libsigrok/libsigrokdecode 0.5.0.

We use various new API calls from the upcoming 0.5.0 releases and are
not compatible with the respective 0.4.x anymore.

3 years agoviewport: Allow smoother zoom using vertical scroll events
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

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
3 years agoAnalogSegment: Speed up processing of interleaved sample data
Soeren Apel [Sun, 28 May 2017 08:31:47 +0000 (10:31 +0200)]
AnalogSegment: Speed up processing of interleaved sample data

3 years agoAnalogSignal: Temporarily disable analog signal conversion
Soeren Apel [Sun, 28 May 2017 08:19:11 +0000 (10:19 +0200)]
AnalogSignal: Temporarily disable analog signal conversion

This feature isn't ready yet, so hide it for now.

3 years agoFix #958 by using new method that auto-converts analog samples
Soeren Apel [Sat, 27 May 2017 20:58:31 +0000 (22:58 +0200)]
Fix #958 by using new method that auto-converts analog samples

3 years agoSignalBase: Always hook into signal data, not just for analog
Soeren Apel [Sat, 27 May 2017 20:13:16 +0000 (22:13 +0200)]
SignalBase: Always hook into signal data, not just for analog

3 years agoDeviceManager: Show progress dialog while scanning for devices
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.

3 years agoSettings Dialog: Visually break up items in the about listing
Soeren Apel [Fri, 26 May 2017 20:42:38 +0000 (22:42 +0200)]
Settings Dialog: Visually break up items in the about listing

3 years agoRework signaling mechanism for trace repainting
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.

3 years agoAnalogSignal: Only report an extent change when there is one
Soeren Apel [Fri, 26 May 2017 09:34:31 +0000 (11:34 +0200)]
AnalogSignal: Only report an extent change when there is one

3 years agoSignalBase: Also emit data related signals
Soeren Apel [Fri, 26 May 2017 08:46:14 +0000 (10:46 +0200)]
SignalBase: Also emit data related signals

If we have a SignalBase instance we don't want to hook into
every single segment just to be notified when data changes.

3 years agoDisable context menus that could lead to users removing UI parts
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.

3 years agoFix #895 by adapting to Qt5 and cleaning up properly
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)"

Workaround here:
https://bugreports.qt.io/browse/QTBUG-47042

"As a workaround I added the line m_progressDlg->reset(); in the main
window constructor in order to get the same behavior as in former
versions."

3 years agoMainBar: Fix notification message
Soeren Apel [Wed, 24 May 2017 16:06:11 +0000 (18:06 +0200)]
MainBar: Fix notification message

3 years agoFix #942 by making sure we always have at least one positive div
Soeren Apel [Wed, 24 May 2017 11:45:04 +0000 (13:45 +0200)]
Fix #942 by making sure we always have at least one positive div