Soeren Apel [Wed, 8 Feb 2017 19:33:48 +0000 (20:33 +0100)]
Free unused segment memory after acquisition
Segments allocate chunks of MaxChunkSize bytes each.
Most likely, the last allocated chunk isn't fully used,
so there's memory going to waste. This patch fixes this
by allocating a chunk of the required size that replaces
the last standard chunk.
Soeren Apel [Wed, 8 Feb 2017 17:30:41 +0000 (18:30 +0100)]
Switch segment storage from single vector to vector of arrays
Previously, PV would run out of storage space for the data
segments because data was stored in a vector. As a vector allows
contiguous access to the underlying data (much like an array),
it needs a contiguous section of memory. With incoming data and
constant resizing of the vector, the OS at some point can no
longer supply such a section of memory, causing PV to abort
acquisition.
This change fixes this by using several chunks that are never
grown in size. Instead, new chunks are allocated and added to
the vector as needed. This way, the OS will be able to provide
memory until it runs out of system memory.
Uwe Hermann [Sun, 29 Jan 2017 18:36:59 +0000 (19:36 +0100)]
Build fixes for Qt5 Windows/mingw/MXE support.
We currently need to (ab)use pkg-config to get all the required
Qt5 static linking dependencies right, since this doesn't yet
work properly in MXE's cmake.
We use ${PKGDEPS_STATIC_LDFLAGS} instead of ${PKGDEPS_STATIC_LIBRARIES}
to avoid some linker issues related to libbz2.
We need to add Qt5::QSvgPlugin, Qt5::QWindowsIntegrationPlugin,
Qt5PlatformSupport and all the Qt5 libs and their dependencies to
the link libraries list (for both PulseView and the unit tests).
In one of the source code files we need to explicitly list all
static Qt plugins via Q_IMPORT_PLUGIN to make static builds work,
which is currently QWindowsIntegrationPlugin and QSvgPlugin.
We're only focusing on having a working Qt5 build for Windows,
as we no longer need to or want to support Qt4 there.
Details:
https://github.com/mxe/mxe/issues/1642
Thanks to Tony Theodore for the help!
This should also fix bug #871, since we're now building with Qt >= 5.6
which has high-DPI support in general.
Tested via manual specification (might need further changes, though):
Soeren Apel [Fri, 13 Jan 2017 17:36:00 +0000 (18:36 +0100)]
TraceView: Center traces more than once
This is to make sure the traces are centered when the view is
first drawn but also properly centered when the final size is
known. This fixes a "jumping" display when opening a new trace
view in addition to an existing one.
Soeren Apel [Tue, 11 Oct 2016 13:55:55 +0000 (15:55 +0200)]
MainWindow: Don't use get_active_view() to determine active session
While it would be neat if it worked, it unfortunately doesn't as
the currently focused item may not be related to any view - e.g.
when one of the tabs of the QTabWidget was clicked.
For this reason, we store the last session the user interacted
with and treat it as the currently focused session.
Soeren Apel [Tue, 4 Oct 2016 17:32:58 +0000 (19:32 +0200)]
MainWindow: Use regular pointer for QDockWidgets
Using shared_ptrs conflicts with the Qt memory management,
so we can't use them if we don't have control over when
those objects are deleted by Qt. In this case, we need to
handle the dock widgets properly.
Gerhard Sittig [Thu, 13 Oct 2016 14:25:39 +0000 (16:25 +0200)]
cmake, INSTALL: Bump the Boost requirement to >= 1.55.
Support for serialization of multiprecision data (which is used for view
timestamps) was introduced in boost version 1.55. Since commit 3a21afa6
builds with versions up to and including 1.54 are reported to fail.
Bump the required version from 1.53 to 1.55. Rephrase the CMake logic
which searches for the Boost dependency. Create a list of libraries from
fixed and optional parts, which as a byproduct avoids long lines. Pass
that list of required libraries to one common find_package() call.
Soeren Apel [Sun, 28 Aug 2016 14:54:58 +0000 (16:54 +0200)]
MainWindow/MainBar: Fix signals
Before, QMetaObject::connectSlotsByName(this) was used to connect
the signals to the slots automagically. This is no longer feasible
for the MainBar as there are slots that can't be auto-assigned and
the MainWindow doesn't have any signals at the moment.
Soeren Apel [Sat, 27 Aug 2016 19:55:57 +0000 (21:55 +0200)]
Implement multi-session handling
This includes letting sessions restore their internal state on
their own and that there are unique names associated with each
session that the GUI can use when there is no data.
Soeren Apel [Fri, 26 Aug 2016 20:29:40 +0000 (22:29 +0200)]
Make the first view own the toolbar instead of the main window
Handling multiple sessions requires that every session can be
controlled individually. This means that either
a) there could be one toolbar that adjusts dynamically to the
session whose view currently has focus
or
b) every session has its own toolbar.
I opted for b) because it's more intuitive and more straightforward
to implement. So now every session has a main view (the first one
created) and a main bar that sits in the same dock widget.
The -Wl,--whole-archive in libsigrok that lead to this change no longer
exists, so this change can be reverted (since it also causes issues with
"make test").
Soeren Apel [Wed, 22 Jun 2016 16:02:34 +0000 (18:02 +0200)]
Fix #805 by resetting selected device on failure
It can happen that devices can be selected but not used
(permissions problems, connection issues, driver issues, etc.),
so in those cases we want to fail gracefully instead of
segfaulting.
The reason for the segfault is the device selector button
isn't reset in case the device couldn't be opened, causing
the rest of the application to try and work with a device
instance that is actually invalid.
Resetting the device selector when the device failed to
open not only fixes this but also makes the UI more
consistent with the internal state.
Samuel Martin [Thu, 26 May 2016 21:46:40 +0000 (23:46 +0200)]
cmake: add check for explicit linking against libatomic
To use atomics functions, some toolchains requires to explicitly add
-latomic to the linker flags (because they are not provided by libc,
but libatomic).
This change adds a helper function trying to build/link a test program
using atomics, then calls it to:
* first check if atomics are directly available in the libc;
* if not and libatomic has been found, then run the same test with
"-latomic" added to the linker flags.
The pulseview link library list is updated according to the results of
these tests.
Notes:
1- CMAKE_REQUIRED_* variables are only used in check functions. They
are not automatically forwarded to/handled by the target commands
(such as target_link_library), because the check functions are
implemented as macro in CMake code, whereas many target commands
are native.
2- Because of note #1, CMAKE_REQUIRED_LIBRARIES (or its value) must be
explicitly passed to the target_link_library command when this is
needed.
3- In this implementation, LIBATOMIC_LIBRARY is only set when it is
needed; so, unconditionally appending it to PULSEVIEW_LINK_LIBS
will produce the expected behavior.
Elias Oenal [Thu, 19 May 2016 18:34:45 +0000 (20:34 +0200)]
Trace: Make popup forms compatible with OSX
Qt behaves differently on OSX regarding widget lifetime it seems,
causing the addition of a stacked decoder to crash PV.
According to Elias, the object popup_form_ gets destroyed, yet
it still has the parent popup_ which in turn will destroy it
again at the end of its life. Either removing the parent, or the
preliminary destruction, fixes the crash.
Soeren Apel [Thu, 19 May 2016 18:29:37 +0000 (20:29 +0200)]
Session: Keep track of signal data locally
Currently, the Session class doesn't hold pointers to the signal
data itself but instead fetches the data on demand using the list
of signals it has. As the Session is providing the model in the
MVC paradigm, it owns the data and thus should keep track of it
directly. The signals are (in an ideal world) mere views on that
data, so querying them for the signal data isn't good style.