Tom Feist [Sun, 9 Nov 2014 22:54:53 +0000 (22:54 +0000)]
Change Glib::Variant<uint64_t> to Glib::Variant<guint64>.
This is needed on OSX/x86_64 where one is a typedef to unsigned long and the
other to unsigned long long. Both are the same size, but they are still
considered different types for the purposes of template instantiation, so the
specialisations which are defined for Glib::Variant<guint64> are not found if
Glib::Variant<uint64_t> is used.
Soeren Apel [Fri, 7 Nov 2014 16:11:30 +0000 (17:11 +0100)]
Fix bug #285 by handling device display names through DeviceManager
Currently, DeviceManager::device_description() is used to determine
how a device should appear in the device selector combobox. This is
problematic because bug #285 requests that a device should show
the extra information only when multiple such devices are present.
Without having access to all devices attached to a particular driver,
this cannot be solved.
This patch makes it possible by creating each device's display name
in the DeviceManager class and storing it there. This way, they
can be constructed while having access to all devices and
transparently queried by anyone who needs them.
Uwe Hermann [Sat, 8 Nov 2014 14:31:30 +0000 (15:31 +0100)]
CMakeLists.txt: Fix CMAKE_MODULE_PATH related issue.
Append to CMAKE_MODULE_PATH instead of overwriting it, in case it is
non-empty initially (which can happen e.g. if -DCMAKE_TOOLCHAIN_FILE is
used and the specified toolchain file sets CMAKE_MODULE_PATH).
Also, append to CMAKE_MODULE_PATH _after_ running "project(pulseview)",
since the latter would apparently reset CMAKE_MODULE_PATH again.
This should fix a MinGW-w64 build issue we're currently seeing:
CMake Error at CMakeLists.txt:105 (include):
include could not find load file:
Angus Gratton [Tue, 7 Oct 2014 22:35:23 +0000 (09:35 +1100)]
Fix double-free issue in File::create
Triggered when opening a file from the command line.
During startup Sigsession::set_default_device calls Device::use which
loads a global _sr_session, then as part of file loading the
File::create method is called which treats _sr_session as a temp
variable (loaded then immediately released), finally a Device::release
releases the (differently allocated) global _sr_session again causing
the double free.
Given File::create is only using the sigrok session temporarily within
its function scope, this change gives it its own temporary session
instance.
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;