Add serial_num/connection_id handling and save/restore last device
This patch performs several correlated changes:
- Make use of sdi->serial_num and sdi->connection_id in
format_device_title()
- Add a Device::get_device_info() method that returns a map
with all device identification information that's available
- Add a DeviceManager::find_device_from_info() method which
returns the best match to a given set of device infos
- Add save/restore code to the MainWindow class that makes
use of the aforementioned maps to identify the currently
selected device.
Since the application metadata is set in application.c,
we should use it instead of providing it manually every
time we create a QSettings object.
As I understand it, subclassing QApplication in application.c
is only a workaround for bad Qt behavior. In the event
that it is removed, the application metadata should be moved
so that persistent storage still works.
Usage of std::thread requires linking with appropriate system thread library.
This fixes the following link error (on debian sid, gcc 4.9):
Linking CXX executable pulseview
/usr/bin/ld: CMakeFiles/pulseview.dir/pv/sigsession.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/pulseview.dir/build.make:2844: recipe for target 'pulseview' failed
Fix bug #326 by saving the main window state when closing and
restoring it on startup. The default window size is 1000x720 so
that the window can still be seen entirely when on a 1024x768 screen.
This wouldn't be the case with a default size of 1024x768.
Use a generic approach when adding the "close on enter" hook for popups
Implement a generic approach to the "close on enter" feature
in popups by installing the key event handler on the first editable
widget it finds in the popup.
Uwe Hermann [Wed, 27 Aug 2014 13:29:48 +0000 (15:29 +0200)]
Fix two errors with clang 3.6.
[...]/pv/view/viewport.cpp:202:6: error: using integer absolute value
function 'abs' when argument is of floating point
type [-Werror,-Wabsolute-value]
if (abs(w) >= 1.0) {
^
[...]/pv/view/viewport.cpp:202:6: note: use function 'std::abs' instead
if (abs(w) >= 1.0) {
^~~
std::abs
[...]/pv/widgets/sweeptimingwidget.cpp:172:33: error: absolute value
function 'abs' given an argument of type 'long' but has parameter of
type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
const int64_t this_variance = abs(
^
[...]/pv/widgets/sweeptimingwidget.cpp:172:33: note: use function
'std::abs' instead
const int64_t this_variance = abs(
^~~
std::abs
Marcus Comstedt [Sat, 19 Jul 2014 08:04:19 +0000 (10:04 +0200)]
View: Implement pinch-zoom
The special handling of a moveMoveEvent without a preceeding
mousePressEvent is a workaround for an issue where you won't get
an emulated mousePressEvent for the primary touch after a multitouch
gesture where you release the primary touch before the secondary touch.
Marcus Comstedt [Sat, 17 May 2014 10:37:15 +0000 (12:37 +0200)]
Declare a virtual destructor for SignalData
This fixes the following error:
error: deleting object of polymorphic class type 'pv::data::Analog'
which has non-virtual destructor might cause undefined behaviour
[-Werror=delete-non-virtual-dtor]
Marcus Comstedt [Sun, 29 Jun 2014 12:09:03 +0000 (14:09 +0200)]
Fix compilation on 32-bit systems
storesession.h was declaring fields as std::atomic<uint64_t>, a type
not avaiable on 32-bit systems. However, the values stored in these
fields were only used as input to QProgressDialog, which takes int,
not uint64_t. So the fields could just as well be std::atomic<int>.
Also, added code to scale the progress values down if they would not
fit in an int. (This would have been needed even if the fields were
to remain as uint64_t.)
Aurelien Jacobs [Tue, 3 Jun 2014 15:07:27 +0000 (17:07 +0200)]
property: add the necessary include file for std::function
This fixes the following error:
/home/aurel/devel/sigrok/pulseview/pv/prop/property.h:39:15: error: ‘function’ in namespace ‘std’ does not name a template type
typedef std::function<GVariant* ()> Getter;
Uwe Hermann [Sat, 5 Apr 2014 12:00:56 +0000 (14:00 +0200)]
Rename 'probe' to 'channel' (libsigrokdecode change).
Variables of type 'struct srd_channel *' are consistently named 'pdch' to
make them easily distinguishable from libsigrok's 'struct sr_channel *'
variables that are consistently named 'ch'.