Commit Graph

64 Commits

Author SHA1 Message Date
Gerhard Sittig 1d6e35dcef main: introduce -D cmdline option, don't auto-scan for devices
Add a -D command line option which skips auto-detection of devices upon
startup. This can speedup program startup for setups with known devices,
and allows to skip the scan for troubled drivers which might break the
startup phase.

This -D option can be combined with -d specs, either presence or absence
of -d is acceptable when -D is specified. Users still can interactively
scan for and use devices after program startup.

This resolves bug #1116.
2018-01-26 17:35:31 +01:00
Gerhard Sittig ed6f8680ba main.cpp: check log level range before using its value
(Silently) ignore invalid -l loglevel specs. This avoids a crash
reported in bug #1071.
2018-01-10 19:19:35 +01:00
Soeren Apel 419ec4e11e Make sigrok::Context semi-global and use libsigrok A2L methods 2017-07-06 00:37:08 +02:00
Gerhard Sittig 58d8e4c6c5 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.
2017-06-27 13:20:06 +02:00
Soeren Apel 3ed18835d8 Main(Window): Let the UI and sessions be restored after w.show() 2017-06-09 21:57:21 +02:00
Soeren Apel 41e2ade4fc 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.
2017-06-06 16:17:26 +02:00
Soeren Apel ed77633334 Replace non-ASCII characters 2017-06-06 16:17:26 +02:00
Soeren Apel 156f06e95f Fix #862 by implementing -c / --clean 2017-06-06 16:17:26 +02:00
Uwe Hermann 0bd39c0c6f Log settings location when using "-l 5".
This can have various types (e.g. a file or a registry entry) and it can
be in various locations on different OSes, so having this as part of the
log output is pretty useful.
2017-05-09 22:08:59 +02:00
Uwe Hermann c063290ac7 Random simplifications, cosmetics/whitespace/consistency fixes. 2017-03-23 19:42:18 +01:00
Uwe Hermann 15a69e5484 main.cpp: Minor consistency fixes found by clang-tidy. 2017-03-18 20:01:54 +01:00
Uwe Hermann 6f925ba9d6 Don't use std:: in the code directly (where possible).
Use "using std::foo" to make the actual code itself a lot more readable.

There are some exceptions where we usually cannot do this, e.g. std::thread
often conflicts with "thread" from Qt or Boost.
2017-03-18 20:00:51 +01:00
Uwe Hermann 09f55d9665 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):

  set QT_SCALE_FACTOR=2
  pulseview.exe
2017-01-29 19:48:42 +01:00
Gerhard Sittig efdec55aec license: remove FSF postal address from boiler plate license text
Remove the FSF postal address as it might change (it did in the past).
Reference the gnu.org website instead which is more stable.
2017-01-07 16:11:15 +01:00
Uwe Hermann f74015db20 Use nullptr in some more places.
This patch was generated using clang-tidy:

  clang-tidy -checks="-*,modernize-use-nullptr" -fix
2016-02-13 20:41:33 +01:00
Uwe Hermann 39ccf9c39e Fix a bunch of random typos. 2016-01-03 20:40:27 +01:00
Uwe Hermann 2ad82c2e40 Various minor whitespace and consistency fixes. 2015-12-26 15:10:01 +01:00
Daniel Elstner dddff2e7c6 android: Read firmware resources from assets
Set up a resource reader to load firmware resources as assets
bundled with the APK.
2015-09-28 17:29:48 +02:00
Uwe Hermann 3e5bc2687f Restore the default of "pulseview foo.sr" opening the file.
This used to work in e.g. the 0.2.0 release and is much more convenient
than having to supply "-i" for every file. It also allows for (easier, at
least) association of the .sr extension with PulseView on most OSes.
2015-08-21 17:14:12 +02:00
Uwe Hermann f329055303 Minor whitespace fixes. 2015-07-25 18:05:11 +02:00
Joel Holdsworth e3c79b07a0 Support specifying input formats on the command line
Also removes the signal dispatch that was previously used to delay
the file loading until after the constructor.
2015-06-11 20:38:48 +02:00
Joel Holdsworth 4c60462b00 Replaced NULL with nullptr 2015-06-11 20:38:48 +02:00
Joel Holdsworth aa90e86b1c Reordered argument handling 2015-06-11 20:38:48 +02:00
Uwe Hermann fe3a1c2184 Update for libsigrokcxx rename. 2015-01-17 20:49:44 +01:00
Uwe Hermann 360ab9be5d Minor whitespace fixes. 2014-11-29 13:15:57 +01:00
Joel Holdsworth 2acdb232d6 Renamed C++ headers to .hpp 2014-11-22 14:32:09 +00:00
Martin Ling e8d009288d Use libsigrok C++ bindings (patch version 7). 2014-10-15 01:04:55 +01:00
Martin Ling dac1bb9752 Subclass QApplication to catch exceptions in handlers. 2014-09-10 18:26:43 +02:00
Marcus Comstedt aff5174622 Android: Use environment setup from library instead 2014-08-26 22:45:41 +02:00
Marcus Comstedt 9137928c9a Install logging callbacks for Android 2014-08-26 22:45:41 +02:00
Marcus Comstedt d528d3d185 Update #include directives to work with Qt5 as well as Qt4 2014-06-05 21:32:56 +01:00
Jens Steinhauser c4c986eb87 main: Use only the domain, not the whole URL. 2014-05-24 18:04:06 +02:00
Uwe Hermann 11a04e2a8e Fix SVG icons not being displayed on Windows.
On Windows (where we use a static Qt) we need to include plugins
(in this case "qsvg" a.k.a. libqsvg.a from plugins/imageformats/),
otherwise SVGs (such as various icons in PulseView) cannot be displayed.
For this we need to use Q_IMPORT_PLUGIN(qsvg) in the code, pass the
QT_STATICPLUGIN flag to the compiler, and link against "-lqsvg".

This, in turn, requires that we also link against the similarly named QtSvg
component/lib (${QT_QTSVG_LIBRARY} a.k.a libQtSvg.a).

See also: https://qt-project.org/doc/qt-4.8/plugins-howto.html#static-plugins

This fixes bug #239.
2014-01-09 01:07:32 +01:00
Joel Holdsworth 269528f55e Made decode an optional feature disabled by default. 2013-12-28 22:31:11 +01:00
Joel Holdsworth 0de8fb27ab Make sigrokdecode a non-optional dependancy 2013-09-22 23:15:05 +01:00
Uwe Hermann aaabd61b12 Adapt to new <libsigrokdecode/libsigrokdecode.h> header. 2013-05-03 20:54:27 +02:00
Joel Holdsworth 107ca6d350 Added DeviceManager
This class now manages the application device list, scanning for
devices, and releasing them when they are no longer needed.

This fixes bug #108.
2013-04-27 22:00:32 +01:00
Joel Holdsworth 140181a460 Made UNIX signals an optional feature 2013-04-18 21:17:47 +01:00
Joel Holdsworth d52d8455db Added ENABLE_SIGROKDECODE option, disabled for now 2013-04-18 20:26:51 +01:00
Joel Holdsworth 708605aa2c Adjusted SignalHandler style to match the rest of PulseView 2013-03-31 10:45:44 +01:00
Joel Holdsworth 7a255aa9c5 Integrated signal handler from qpdfview 2013-03-31 10:31:51 +01:00
Joel Holdsworth 9b5099b654 Added loglevel command line option 2013-03-24 17:19:00 +00:00
Matt Ranostay 815b3f2661 bugfix: Resolved -Werror message in main.cpp
pulseview/main.cpp: In function ‘int main(int, char**)’:
pulseview/main.cpp:91:13: error: comparison is always false due to limited range of data type [-Werror=type-limits]

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
2013-03-09 11:43:04 +01:00
Joel Holdsworth 1d478458c2 Added open file command line argument 2013-03-03 17:18:20 +01:00
Uwe Hermann e82fd481f7 Remove unneeded 'extern "C"'.
System headers, glib headers, and libsigrok/libsigrokdecode headers all
use 'extern "C"' already, so there's no need to explicitly add these
in PulseView (for these cases).

Thanks R. Diez <rdiezmail-comparevcd@yahoo.de> for the patch!
2013-02-20 12:02:15 +01:00
Uwe Hermann 9fd5bb6e64 Print --help/--version output to stdout (not stderr).
Thanks R. Diez <rdiezmail-comparevcd@yahoo.de> for the patch!

This is not a feasible practice for CLI tools where the output might
be piped into other tools (and you don't want to pipe help messages or
other non-data). However, for the PulseView GUI this is acceptable since
it's not meant to be used that way.
2013-02-20 11:39:38 +01:00
Uwe Hermann eec29dcdee Cosmetics, typos. 2013-02-20 10:36:46 +01:00
Alexandru Gagniuc 9d544917dc main: quit on SIGINT
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-02-20 10:36:46 +01:00
Alexandru Gagniuc 31e6731d97 main: Add signal handler for SIGINT
Add a SIGINT handler as requested here:
http://www.airwebreathe.org.uk/projects/index.php?title=PulseView#Make_PulseView_respond_properly_to_SIGINT

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-02-20 10:36:46 +01:00
Uwe Hermann 333d5bbc0a Some smaller whitespace fixes. 2012-12-12 22:19:22 +01:00