Yeah, it violates the DRY principle and isn't nice OOP-wise
but it'll do for now. The entire group of Trace/Signal classes
needs to be reworked anyway to support device-independent
signal types anyway (think math traces and such).
Soeren Apel [Wed, 15 Mar 2017 18:22:17 +0000 (19:22 +0100)]
Use presence of logic/analog data as indicator of channel type
However, don't do this for the StoreSession. Reason is that we
only want to save the original data and not treat any converted
data as its own channel.
Uwe Hermann [Thu, 16 Mar 2017 22:29:24 +0000 (23:29 +0100)]
Increase session saving chunk size for much better performance.
Increasing the StoreSession chunk size from 1Msamples to 10Msamples
leads to massively faster session saving due to reduced overhead.
In some cases a 2x (or more) speed-up has been observed. A further increase
to, say, 100Msamples shows no further noticeable improvements.
This also has the additional benefit of generating fewer entries/files
within the sigrok session (*.sr) output/ZIP files, which can potentially
be beneficial for very long captures.
V1 will construct a temporary std::string from the string literal "foo",
another copy of that temporary object will be constructed and placed
into the vector 'v', then the temporary object's destructor will be called.
V2 will simply create a std::string directly in the vector 'v', i.e.
there's only one construction (not 2) and no destructor needs to be called.
Using make_shared() over manual construction has multiple advantages:
- It's shorter to write and easier to read.
V1: auto sb = shared_ptr<Foo>(new Foo());
V2: auto sb = make_shared<Foo>();
- The type "Foo" is repeated less often (less code duplication, lower
risk of forgetting to update one of the "Foo"s upon copy-paste etc.)
- Manual construction leads to two individual allocations (actual data and
the control block of the shared_ptr). Using make_shared() will only lead
to one allocation, which has performance, cache-locality and memory
consumption benefits.
- It's exception-safe, whereas manual construction is not necessarily:
Uwe Hermann [Mon, 6 Mar 2017 07:41:42 +0000 (08:41 +0100)]
Increase decoding chunk size for much better performance.
Increasing the (max) decoding chunk size from 4ksamples to 10Msamples
leads to massively faster protocol decoding due to reduced overhead
related to srd_session_send() and other functions invoked internally.
In some cases a 2x (or more) speed-up has been observed.
Bring back sticky scroll and coloured background shortcuts.
Converted the actions to QShortcut. We do not use the actions anywhere
else in the code and they were not being triggered using the setShortcut
setting. Additionally expanded the view background color to be a
toggleable attribute.
Ctrl-Q is commonly used to close the application, and Ctrl-W usually is
used to close the current tab. According to the Qt::Modifier
documentation this setup should work seamlessly on Mac OS where Meta is
usually used in place of Ctrl.
This is a proposed solution to reenable the <Space> shortcut for
Run/Stop. It seems that setShortcut on QToolButton is not working, but
it seems that adding QShortcut works as a workaround.
Soeren Apel [Sat, 18 Feb 2017 07:21:00 +0000 (08:21 +0100)]
Segment: Move definition of MaxChunkSize
This fixes a compile error with clang:
pv/data/segment.cpp.o: In function `unsigned long const& std::min<unsigned long>(unsigned long const&, unsigned long const&)':
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_algobase.h:200: undefined reference to `pv::data::Segment::MaxChunkSize'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Uwe Hermann [Fri, 17 Feb 2017 08:27:20 +0000 (09:27 +0100)]
pulseview_cross.nsi.in: Use Python 3.4 (Windows XP support).
The last Python version to officially support Windows XP was 3.4.x.
We'll keep the Windows installers at that version for the time being,
until Windows XP support is no longer feasible (e.g. because important
sigrok requirements such as Qt, glib, or libusb drop XP suppport).
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.