Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
3d1f55cf
Commit
3d1f55cf
authored
Feb 19, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merged master, fixed local 3D init
parents
ad64e8a0
2a692725
Changes
132
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
132 changed files
with
785 additions
and
74456 deletions
+785
-74456
QGCExternalLibs.pri
QGCExternalLibs.pri
+303
-199
QGCInstaller.pri
QGCInstaller.pri
+28
-0
QGCSetup.pri
QGCSetup.pri
+5
-3
README.md
README.md
+86
-101
mac_create_dmg_shell.sh
deploy/mac_create_dmg_shell.sh
+3
-2
qgroundcontrol_installer.nsi
deploy/qgroundcontrol_installer.nsi
+2
-4
lks94projection.cpp
...pmapcontrol/src/internals/projections/lks94projection.cpp
+10
-0
mercatorprojectionyandex.cpp
...ol/src/internals/projections/mercatorprojectionyandex.cpp
+15
-0
qextserialenumerator.h
libs/qextserialport/qextserialenumerator.h
+0
-209
qextserialenumerator_osx.cpp
libs/qextserialport/qextserialenumerator_osx.cpp
+0
-288
qextserialenumerator_unix.cpp
libs/qextserialport/qextserialenumerator_unix.cpp
+0
-72
qextserialenumerator_win.cpp
libs/qextserialport/qextserialenumerator_win.cpp
+0
-222
qwt_plot_spectrogram.cpp
libs/qwt/qwt_plot_spectrogram.cpp
+13
-0
qwt_plot_zoomer.h
libs/qwt/qwt_plot_zoomer.h
+11
-0
qserialport.pri
libs/serialport/qserialport.pri
+1
-1
COPYING
libs/thirdParty/qserialport/COPYING
+0
-504
Doxyfile
libs/thirdParty/qserialport/Doxyfile
+0
-1272
INSTALL
libs/thirdParty/qserialport/INSTALL
+0
-46
LICENSE
libs/thirdParty/qserialport/LICENSE
+0
-509
Mainpage.dox
libs/thirdParty/qserialport/Mainpage.dox
+0
-67
README
libs/thirdParty/qserialport/README
+0
-37
TODO
libs/thirdParty/qserialport/TODO
+0
-11
app.pri
libs/thirdParty/qserialport/app.pri
+0
-43
base.pri
libs/thirdParty/qserialport/base.pri
+0
-40
echo_eventmode
libs/thirdParty/qserialport/bin/echo_eventmode
+0
-0
echo_pollingmode
libs/thirdParty/qserialport/bin/echo_pollingmode
+0
-0
serial2tcpbridge
libs/thirdParty/qserialport/bin/serial2tcpbridge
+0
-0
tranceiver
libs/thirdParty/qserialport/bin/tranceiver
+0
-0
conf.pri
libs/thirdParty/qserialport/conf.pri
+0
-7
confapp.pri
libs/thirdParty/qserialport/confapp.pri
+0
-24
configure
libs/thirdParty/qserialport/configure
+0
-1266
configure.exe
libs/thirdParty/qserialport/configure.exe
+0
-0
echo_eventmode.pro
...ty/qserialport/examples/echo_eventmode/echo_eventmode.pro
+0
-48
host.cpp
libs/thirdParty/qserialport/examples/echo_eventmode/host.cpp
+0
-75
host.h
libs/thirdParty/qserialport/examples/echo_eventmode/host.h
+0
-51
main.cpp
libs/thirdParty/qserialport/examples/echo_eventmode/main.cpp
+0
-94
echo_pollingmode.pro
...serialport/examples/echo_pollingmode/echo_pollingmode.pro
+0
-46
main.cpp
...thirdParty/qserialport/examples/echo_pollingmode/main.cpp
+0
-111
examples.pri
libs/thirdParty/qserialport/examples/examples.pri
+0
-30
examples.pro
libs/thirdParty/qserialport/examples/examples.pro
+0
-30
host.cpp
...thirdParty/qserialport/examples/serial2tcpbridge/host.cpp
+0
-102
host.h
libs/thirdParty/qserialport/examples/serial2tcpbridge/host.h
+0
-53
main.cpp
...thirdParty/qserialport/examples/serial2tcpbridge/main.cpp
+0
-117
process.cc
...irdParty/qserialport/examples/serial2tcpbridge/process.cc
+0
-622
proxy.cpp
...hirdParty/qserialport/examples/serial2tcpbridge/proxy.cpp
+0
-74
proxy.h
.../thirdParty/qserialport/examples/serial2tcpbridge/proxy.h
+0
-53
serial2tcpbridge.pro
...serialport/examples/serial2tcpbridge/serial2tcpbridge.pro
+0
-49
main.cpp
libs/thirdParty/qserialport/examples/tranceiver/main.cpp
+0
-149
receiver.cpp
libs/thirdParty/qserialport/examples/tranceiver/receiver.cpp
+0
-262
receiver.h
libs/thirdParty/qserialport/examples/tranceiver/receiver.h
+0
-79
tranceiver.pro
...thirdParty/qserialport/examples/tranceiver/tranceiver.pro
+0
-50
transmitter.cpp
...hirdParty/qserialport/examples/tranceiver/transmitter.cpp
+0
-248
transmitter.h
.../thirdParty/qserialport/examples/tranceiver/transmitter.h
+0
-93
inbiza-logo-250x92.png
libs/thirdParty/qserialport/images/inbiza-logo-250x92.png
+0
-0
QSerialPort
libs/thirdParty/qserialport/include/QtSerialPort/QSerialPort
+0
-3
qportsettings.h
...irdParty/qserialport/include/QtSerialPort/qportsettings.h
+0
-261
qserialport.h
...thirdParty/qserialport/include/QtSerialPort/qserialport.h
+0
-228
qserialport_export.h
...rty/qserialport/include/QtSerialPort/qserialport_export.h
+0
-52
qserialportnative.h
...arty/qserialport/include/QtSerialPort/qserialportnative.h
+0
-109
installwin.bat
libs/thirdParty/qserialport/installwin.bat
+0
-17
libQtSerialPort.debug.so
libs/thirdParty/qserialport/lib/libQtSerialPort.debug.so
+0
-1
libQtSerialPort.debug.so.1
libs/thirdParty/qserialport/lib/libQtSerialPort.debug.so.1
+0
-1
libQtSerialPort.debug.so.1.0
libs/thirdParty/qserialport/lib/libQtSerialPort.debug.so.1.0
+0
-1
libQtSerialPort.debug.so.1.0.0
...thirdParty/qserialport/lib/libQtSerialPort.debug.so.1.0.0
+0
-0
libQtSerialPort.prl
libs/thirdParty/qserialport/lib/libQtSerialPort.prl
+0
-5
libQtSerialPort.so
libs/thirdParty/qserialport/lib/libQtSerialPort.so
+0
-1
libQtSerialPort.so.1
libs/thirdParty/qserialport/lib/libQtSerialPort.so.1
+0
-1
libQtSerialPort.so.1.0
libs/thirdParty/qserialport/lib/libQtSerialPort.so.1.0
+0
-1
libQtSerialPort.so.1.0.0
libs/thirdParty/qserialport/lib/libQtSerialPort.so.1.0.0
+0
-0
qserialport.prf
libs/thirdParty/qserialport/qserialport.prf
+0
-72
qserialport.pro
libs/thirdParty/qserialport/qserialport.pro
+0
-50
QtSerialPort_resource.rc
libs/thirdParty/qserialport/src/QtSerialPort_resource.rc
+0
-34
QtSerialPortd_resource.rc
libs/thirdParty/qserialport/src/QtSerialPortd_resource.rc
+0
-34
qportsettings.cpp
libs/thirdParty/qserialport/src/common/qportsettings.cpp
+0
-325
qserialport.cpp
libs/thirdParty/qserialport/src/common/qserialport.cpp
+0
-771
qserialportnative_posix.cpp
...rdParty/qserialport/src/posix/qserialportnative_posix.cpp
+0
-227
termioshelper.cpp
libs/thirdParty/qserialport/src/posix/termioshelper.cpp
+0
-723
termioshelper.h
libs/thirdParty/qserialport/src/posix/termioshelper.h
+0
-139
qt.tag
libs/thirdParty/qserialport/src/qt.tag
+0
-60791
src.pro
libs/thirdParty/qserialport/src/src.pro
+0
-152
commdcbhelper.cpp
libs/thirdParty/qserialport/src/win32/commdcbhelper.cpp
+0
-811
commdcbhelper.h
libs/thirdParty/qserialport/src/win32/commdcbhelper.h
+0
-123
qserialportnative_win32.cpp
...rdParty/qserialport/src/win32/qserialportnative_win32.cpp
+0
-374
qserialportnative_wince.cpp
...rdParty/qserialport/src/win32/qserialportnative_wince.cpp
+0
-272
qwincommevtnotifier.cpp
.../thirdParty/qserialport/src/win32/qwincommevtnotifier.cpp
+0
-196
qwincommevtnotifier.h
libs/thirdParty/qserialport/src/win32/qwincommevtnotifier.h
+0
-89
wincommevtbreaker.cpp
libs/thirdParty/qserialport/src/win32/wincommevtbreaker.cpp
+0
-120
wincommevtbreaker.h
libs/thirdParty/qserialport/src/win32/wincommevtbreaker.h
+0
-87
README
libs/thirdParty/qserialport/unittest/README
+0
-22
TestPlan
libs/thirdParty/qserialport/unittest/TestPlan
+0
-11
checkall
libs/thirdParty/qserialport/unittest/checkall
+0
-3
qserialportunittest
...rialport/unittest/qserialportunittest/qserialportunittest
+0
-0
qserialportunittest.cpp
...port/unittest/qserialportunittest/qserialportunittest.cpp
+0
-577
qserialportunittest.h
...alport/unittest/qserialportunittest/qserialportunittest.h
+0
-49
qserialportunittest.pro
...port/unittest/qserialportunittest/qserialportunittest.pro
+0
-50
serport
libs/thirdParty/qserialport/unittest/serport
+0
-1
unittest.pri
libs/thirdParty/qserialport/unittest/unittest.pri
+0
-29
unittest.pro
libs/thirdParty/qserialport/unittest/unittest.pro
+0
-33
qgroundcontrol.pro
qgroundcontrol.pro
+31
-3
qupgrade
qupgrade
+1
-1
GAudioOutput.cc
src/GAudioOutput.cc
+14
-35
GAudioOutput.h
src/GAudioOutput.h
+7
-12
QGCCore.cc
src/QGCCore.cc
+2
-2
QGCCore.h
src/QGCCore.h
+1
-1
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+1
-9
MAVLinkSimulationLink.cc
src/comm/MAVLinkSimulationLink.cc
+1
-0
MAVLinkSimulationWaypointPlanner.cc
src/comm/MAVLinkSimulationWaypointPlanner.cc
+10
-19
configuration.h
src/configuration.h
+2
-2
Mouse6dofInput.cpp
src/input/Mouse6dofInput.cpp
+12
-12
Mouse6dofInput.h
src/input/Mouse6dofInput.h
+10
-10
MockUAS.h
src/qgcunittest/MockUAS.h
+3
-0
ArduPilotMegaMAV.cc
src/uas/ArduPilotMegaMAV.cc
+16
-0
UAS.cc
src/uas/UAS.cc
+29
-11
UAS.h
src/uas/UAS.h
+3
-0
UASInterface.h
src/uas/UASInterface.h
+8
-1
UASWaypointManager.cc
src/uas/UASWaypointManager.cc
+27
-4
CommConfigurationWindow.cc
src/ui/CommConfigurationWindow.cc
+16
-16
CommConfigurationWindow.h
src/ui/CommConfigurationWindow.h
+4
-4
HUD.cc
src/ui/HUD.cc
+6
-34
HUD.h
src/ui/HUD.h
+1
-3
MainWindow.cc
src/ui/MainWindow.cc
+20
-10
MainWindow.h
src/ui/MainWindow.h
+22
-23
QGCPX4VehicleConfig.cc
src/ui/QGCPX4VehicleConfig.cc
+5
-6
QGCPX4VehicleConfig.h
src/ui/QGCPX4VehicleConfig.h
+0
-2
QGCRGBDView.cc
src/ui/QGCRGBDView.cc
+2
-2
WaypointEditableView.cc
src/ui/WaypointEditableView.cc
+5
-1
WaypointEditableView.ui
src/ui/WaypointEditableView.ui
+11
-2
WaypointList.cc
src/ui/WaypointList.cc
+10
-4
WaypointList.ui
src/ui/WaypointList.ui
+4
-4
Imagery.cc
src/ui/map3D/Imagery.cc
+2
-7
Q3DWidget.h
src/ui/map3D/Q3DWidget.h
+12
-0
user_config.pri.dist
user_config.pri.dist
+10
-7
No files found.
QGCExternalLibs.pri
View file @
3d1f55cf
This diff is collapsed.
Click to expand it.
QGCInstaller.pri
0 → 100644
View file @
3d1f55cf
# -------------------------------------------------
# QGroundControl - Micro Air Vehicle Groundstation
# Please see our website at <http://qgroundcontrol.org>
# Maintainer:
# Lorenz Meier <lm@inf.ethz.ch>
# (c) 2009-2014 QGroundControl Developers
# This file is part of the open groundstation project
# QGroundControl is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# QGroundControl is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with QGroundControl. If not, see <http://www.gnu.org/licenses/>.
# -------------------------------------------------
installer {
MacBuild {
QMAKE_POST_LINK += && macdeployqt $${DESTDIR}/qgroundcontrol.app -dmg
}
WindowsBuild {
QMAKE_POST_LINK += $$escape_expand(\\n) $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /NOCD "\"/XOutFile $${DESTDIR_WIN}\\qgroundcontrol-installer-win32.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
}
}
QGCSetup.pri
View file @
3d1f55cf
...
...
@@ -153,10 +153,11 @@ MacBuild {
}
WindowsBuild {
# Copy dependencies
BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
DESTDIR_WIN = $$replace(DESTDIR,"/","\\")
# Copy dependencies
QMAKE_POST_LINK += $$escape_expand(\\n) $$quote($$QMAKE_COPY_DIR "$$(QTDIR)\\plugins" "$$DESTDIR_WIN")
COPY_FILE_DESTDIR = $$DESTDIR_WIN
...
...
@@ -188,9 +189,10 @@ WindowsBuild {
# Copy Visual Studio DLLs
# Note that this is only done for release because the debugging versions of these DLLs cannot be redistributed.
#
I'm not certain of the path for VS2008, so this
only works for VS2010.
#
This currently
only works for VS2010.
win32-msvc2010 {
QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(xcopy /D /Y "\"C:\\Program Files \(x86\)\\Microsoft Visual Studio 10.0\\VC\\redist\\x86\\Microsoft.VC100.CRT\\*.dll\"" "$$DESTDIR_WIN\\")
QMAKE_POST_LINK += $$escape_expand(\\n) $$quote($$QMAKE_COPY "C:\\Windows\\System32\\msvcp100.dll" "$$DESTDIR_WIN\\")
QMAKE_POST_LINK += $$escape_expand(\\n) $$quote($$QMAKE_COPY "C:\\Windows\\System32\\msvcr100.dll" "$$DESTDIR_WIN\\")
}
}
}
README.md
View file @
3d1f55cf
This diff is collapsed.
Click to expand it.
deploy/mac_create_dmg.sh
→
deploy/mac_create_dmg
_shell
.sh
View file @
3d1f55cf
#!/bin/sh
cp
-r
../
../build-qgroundcontrol-Qt_4_8_1-Release/
release/qgroundcontrol.app
.
cp
-r
../release/qgroundcontrol.app
.
cp
-r
../files/audio qgroundcontrol.app/Contents/MacOs/.
...
...
@@ -7,9 +7,10 @@ mkdir -p qgroundcontrol.app/Contents/Frameworks/
mkdir
-p
qgroundcontrol.app/Contents/PlugIns/imageformats
mkdir
-p
qgroundcontrol.app/Contents/PlugIns/codecs
mkdir
-p
qgroundcontrol.app/Contents/PlugIns/accessible
cp
-r
/usr/local/Cellar/qt/4.8.5/plugins/ qgroundcontrol.app/Contents/PlugIns/.
# SDL is not copied by Qt - for whatever reason
cp
-r
/Library/Frameworks/SDL.framework qgroundcontrol.app/Contents/Frameworks/.
echo
-e
'\n\nStarting to create disk image. This may take a while..\n'
$HOME
/QtSDK/Desktop/Qt/4.8.1/gcc/bin/
macdeployqt qgroundcontrol.app
-dmg
macdeployqt qgroundcontrol.app
-dmg
rm
-rf
qgroundcontrol.app
echo
-e
'\n\n QGroundControl .DMG file is now ready for publishing\n'
deploy/qgroundcontrol_installer.nsi
View file @
3d1f55cf
Name "QGroundcontrol"
OutFile "qgroundcontrol-installer-win32.exe"
InstallDir $PROGRAMFILES\qgroundcontrol
Page license
...
...
@@ -11,12 +9,12 @@ Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
LicenseData
..\
license.txt
LicenseData license.txt
Section ""
SetOutPath $INSTDIR
File /r
..\
release\*.*
File /r release\*.*
WriteUninstaller $INSTDIR\QGroundControl_uninstall.exe
SectionEnd
...
...
libs/opmapcontrol/src/internals/projections/lks94projection.cpp
View file @
3d1f55cf
...
...
@@ -28,6 +28,11 @@
#include <qmath.h>
// These pragmas are local modifications to this third party library to silence warnings
#ifdef Q_OS_LINUX
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
namespace
projections
{
LKS94Projection
::
LKS94Projection
()
:
MinLatitude
(
53.33
),
MaxLatitude
(
56.55
),
MinLongitude
(
20.22
),
...
...
@@ -787,3 +792,8 @@ Size LKS94Projection::GetTileMatrixMaxXY(int const& zoom)
}
}
#ifdef Q_OS_LINUX
#pragma GCC diagnostic pop
#endif
libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp
View file @
3d1f55cf
...
...
@@ -57,6 +57,16 @@ Point MercatorProjectionYandex::FromLatLngToPixel(double lat, double lng, const
return
ret
;
}
// These pragmas are local modifications to this third party library to silence warnings
#ifdef Q_OS_LINUX
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#elif defined(Q_OS_MAC)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#endif
internals
::
PointLatLng
MercatorProjectionYandex
::
FromPixelToLatLng
(
const
int
&
x
,
const
int
&
y
,
const
int
&
zoom
)
{
Size
s
=
GetTileMatrixSizePixel
(
zoom
);
...
...
@@ -82,6 +92,11 @@ internals::PointLatLng MercatorProjectionYandex::FromPixelToLatLng(const int &x,
return
ret
;
}
#ifndef Q_OS_WIN
#pragma GCC diagnostic pop
#endif
double
MercatorProjectionYandex
::
Clip
(
const
double
&
n
,
const
double
&
minValue
,
const
double
&
maxValue
)
const
{
return
qMin
(
qMax
(
n
,
minValue
),
maxValue
);
...
...
libs/qextserialport/qextserialenumerator.h
deleted
100644 → 0
View file @
ad64e8a0
/*!
* \file qextserialenumerator.h
* \author Michal Policht
* \see QextSerialEnumerator
*/
#ifndef _QEXTSERIALENUMERATOR_H_
#define _QEXTSERIALENUMERATOR_H_
#include <QtCore/qglobal.h>
//#ifdef QEXTSERIALPORT_LIB
//# define QEXTSERIALPORT_EXPORT Q_DECL_EXPORT
//#else
//# define QEXTSERIALPORT_EXPORT Q_DECL_IMPORT
//#endif
#define QEXTSERIALPORT_EXPORT
#include <QString>
#include <QList>
#include <QObject>
//#include "qextserialport_global.h"
#ifdef Q_OS_WIN
#include <windows.h>
#include <setupapi.h>
#include <dbt.h>
#endif
/*Q_OS_WIN*/
#ifdef Q_OS_MAC
#include <IOKit/usb/IOUSBLib.h>
#endif
/*!
* Structure containing port information.
*/
struct
QextPortInfo
{
QString
portName
;
///< Port name.
QString
physName
;
///< Physical name.
QString
friendName
;
///< Friendly name.
QString
enumName
;
///< Enumerator name.
int
vendorID
;
///< Vendor ID.
int
productID
;
///< Product ID
};
#ifdef Q_OS_WIN
#ifdef QT_GUI_LIB
#include <QWidget>
class
QextSerialEnumerator
;
class
QextSerialRegistrationWidget
:
public
QWidget
{
Q_OBJECT
public:
QextSerialRegistrationWidget
(
QextSerialEnumerator
*
qese
)
{
this
->
qese
=
qese
;
}
~
QextSerialRegistrationWidget
(
)
{
}
protected:
QextSerialEnumerator
*
qese
;
bool
winEvent
(
MSG
*
message
,
long
*
result
);
};
#endif // QT_GUI_LIB
#endif // Q_OS_WIN
/*!
Provides list of ports available in the system.
\section Usage
To poll the system for a list of connected devices, simply use getPorts(). Each
QextPortInfo structure will populated with information about the corresponding device.
\b Example
\code
QList<QextPortInfo> ports = QextSerialEnumerator::getPorts();
foreach( QextPortInfo port, ports ) {
// inspect port...
}
\endcode
To enable event-driven notification of device connection events, first call
setUpNotifications() and then connect to the deviceDiscovered() and deviceRemoved()
signals. Event-driven behavior is currently available only on Windows and OS X.
\b Example
\code
QextSerialEnumerator* enumerator = new QextSerialEnumerator();
connect(enumerator, SIGNAL(deviceDiscovered(const QextPortInfo &)),
myClass, SLOT(onDeviceDiscovered(const QextPortInfo &)));
connect(enumerator, SIGNAL(deviceRemoved(const QextPortInfo &)),
myClass, SLOT(onDeviceRemoved(const QextPortInfo &)));
\endcode
\section Credits
Windows implementation is based on Zach Gorman's work from
<a href="http://www.codeproject.com">The Code Project</a> (http://www.codeproject.com/system/setupdi.asp).
OS X implementation, see
http://developer.apple.com/documentation/DeviceDrivers/Conceptual/AccessingHardware/AH_Finding_Devices/chapter_4_section_2.html
\author Michal Policht, Liam Staskawicz
*/
class
QEXTSERIALPORT_EXPORT
QextSerialEnumerator
:
public
QObject
{
Q_OBJECT
public:
QextSerialEnumerator
(
);
~
QextSerialEnumerator
(
);
#ifdef Q_OS_WIN
LRESULT
onDeviceChangeWin
(
WPARAM
wParam
,
LPARAM
lParam
);
private:
/*!
* Get value of specified property from the registry.
* \param key handle to an open key.
* \param property property name.
* \return property value.
*/
static
QString
getRegKeyValue
(
HKEY
key
,
LPCTSTR
property
);
/*!
* Get specific property from registry.
* \param devInfo pointer to the device information set that contains the interface
* and its underlying device. Returned by SetupDiGetClassDevs() function.
* \param devData pointer to an SP_DEVINFO_DATA structure that defines the device instance.
* this is returned by SetupDiGetDeviceInterfaceDetail() function.
* \param property registry property. One of defined SPDRP_* constants.
* \return property string.
*/
static
QString
getDeviceProperty
(
HDEVINFO
devInfo
,
PSP_DEVINFO_DATA
devData
,
DWORD
property
);
/*!
* Search for serial ports using setupapi.
* \param infoList list with result.
*/
static
void
setupAPIScan
(
QList
<
QextPortInfo
>
&
infoList
);
void
setUpNotificationWin
(
);
static
bool
getDeviceDetailsWin
(
QextPortInfo
*
portInfo
,
HDEVINFO
devInfo
,
PSP_DEVINFO_DATA
devData
,
WPARAM
wParam
=
DBT_DEVICEARRIVAL
);
static
void
enumerateDevicesWin
(
const
GUID
&
guidDev
,
QList
<
QextPortInfo
>*
infoList
);
bool
matchAndDispatchChangedDevice
(
const
QString
&
deviceID
,
const
GUID
&
guid
,
WPARAM
wParam
);
#ifdef QT_GUI_LIB
QextSerialRegistrationWidget
*
notificationWidget
;
#endif
#endif
/*Q_OS_WIN*/
#ifdef Q_OS_UNIX
#ifdef Q_OS_MAC
private:
/*!
* Search for serial ports using IOKit.
* \param infoList list with result.
*/
static
void
scanPortsOSX
(
QList
<
QextPortInfo
>
&
infoList
);
static
void
iterateServicesOSX
(
io_object_t
service
,
QList
<
QextPortInfo
>
&
infoList
);
static
bool
getServiceDetailsOSX
(
io_object_t
service
,
QextPortInfo
*
portInfo
);
void
setUpNotificationOSX
(
);
void
onDeviceDiscoveredOSX
(
io_object_t
service
);
void
onDeviceTerminatedOSX
(
io_object_t
service
);
friend
void
deviceDiscoveredCallbackOSX
(
void
*
ctxt
,
io_iterator_t
serialPortIterator
);
friend
void
deviceTerminatedCallbackOSX
(
void
*
ctxt
,
io_iterator_t
serialPortIterator
);
IONotificationPortRef
notificationPortRef
;
#else // Q_OS_MAC
private:
/*!
* Search for serial ports on unix.
* \param infoList list with result.
*/
static
void
scanPortsNix
(
QList
<
QextPortInfo
>
&
infoList
);
#endif // Q_OS_MAC
#endif
/* Q_OS_UNIX */
public:
/*!
Get list of ports.
\return list of ports currently available in the system.
*/
static
QList
<
QextPortInfo
>
getPorts
();
/*!
Enable event-driven notifications of board discovery/removal.
*/
void
setUpNotifications
(
);
signals:
/*!
A new device has been connected to the system.
setUpNotifications() must be called first to enable event-driven device notifications.
Currently only implemented on Windows and OS X.
\param info The device that has been discovered.
*/
void
deviceDiscovered
(
const
QextPortInfo
&
info
);
/*!
A device has been disconnected from the system.
setUpNotifications() must be called first to enable event-driven device notifications.
Currently only implemented on Windows and OS X.
\param info The device that was disconnected.
*/
void
deviceRemoved
(
const
QextPortInfo
&
info
);
};
#endif
/*_QEXTSERIALENUMERATOR_H_*/
libs/qextserialport/qextserialenumerator_osx.cpp
deleted
100644 → 0
View file @
ad64e8a0
This diff is collapsed.
Click to expand it.
libs/qextserialport/qextserialenumerator_unix.cpp
deleted
100644 → 0
View file @
ad64e8a0
#include "qextserialenumerator.h"
#include <QDebug>
#include <QMetaType>
#include <QStringList>
#include <QDir>
QextSerialEnumerator
::
QextSerialEnumerator
(
)
{
if
(
!
QMetaType
::
isRegistered
(
QMetaType
::
type
(
"QextPortInfo"
)
)
)
qRegisterMetaType
<
QextPortInfo
>
(
"QextPortInfo"
);
}
QextSerialEnumerator
::~
QextSerialEnumerator
(
)
{
}
QList
<
QextPortInfo
>
QextSerialEnumerator
::
getPorts
()
{
QList
<
QextPortInfo
>
infoList
;
#ifdef Q_OS_LINUX
QStringList
portNamePrefixes
,
portNameList
;
portNamePrefixes
<<
"ttyS*"
;
// list normal serial ports first
QDir
dir
(
"/dev"
);
portNameList
=
dir
.
entryList
(
portNamePrefixes
,
(
QDir
::
System
|
QDir
::
Files
),
QDir
::
Name
);
// remove the values which are not serial ports for e.g. /dev/ttysa
for
(
int
i
=
0
;
i
<
portNameList
.
size
();
i
++
)
{
bool
ok
;
QString
current
=
portNameList
.
at
(
i
);
// remove the ttyS part, and check, if the other part is a number
current
.
remove
(
0
,
4
).
toInt
(
&
ok
,
10
);
if
(
!
ok
)
{
portNameList
.
removeAt
(
i
);
i
--
;
}
}
// get the non standard serial ports names
// (USB-serial, bluetooth-serial, 18F PICs, and so on)
// if you know an other name prefix for serial ports please let us know
portNamePrefixes
.
clear
();
portNamePrefixes
<<
"ttyACM*"
<<
"ttyUSB*"
<<
"rfcomm*"
;
portNameList
.
append
(
dir
.
entryList
(
portNamePrefixes
,
(
QDir
::
System
|
QDir
::
Files
),
QDir
::
Name
));
foreach
(
QString
str
,
portNameList
)
{
QextPortInfo
inf
;
inf
.
physName
=
"/dev/"
+
str
;
inf
.
portName
=
str
;
if
(
str
.
contains
(
"ttyS"
))
{
inf
.
friendName
=
"Serial port "
+
str
.
remove
(
0
,
4
);
}
else
if
(
str
.
contains
(
"ttyUSB"
))
{
inf
.
friendName
=
"USB-serial adapter "
+
str
.
remove
(
0
,
6
);
}
else
if
(
str
.
contains
(
"rfcomm"
))
{
inf
.
friendName
=
"Bluetooth-serial adapter "
+
str
.
remove
(
0
,
6
);
}
inf
.
enumName
=
"/dev"
;
// is there a more helpful name for this?
infoList
.
append
(
inf
);
}
#else
qCritical
(
"Enumeration for POSIX systems (except Linux) is not implemented yet."
);
#endif
return
infoList
;
}
void
QextSerialEnumerator
::
setUpNotifications
(
)
{
qCritical
(
"Notifications for *Nix/FreeBSD are not implemented yet"
);
}
libs/qextserialport/qextserialenumerator_win.cpp
deleted
100644 → 0
View file @
ad64e8a0
#include "qextserialenumerator.h"
#include <QDebug>
#include <QMetaType>
#include <objbase.h>
#include <initguid.h>
//#include "qextserialport.h"
#include <QRegExp>
#ifdef Q_OS_WIN
#ifndef _MSC_VER
#include <windows.h>
#include <dbt.h>
#include <QtCore/qglobal.h>
#endif
#endif
QextSerialEnumerator
::
QextSerialEnumerator
(
)
{
if
(
!
QMetaType
::
isRegistered
(
QMetaType
::
type
(
"QextPortInfo"
)
)
)
qRegisterMetaType
<
QextPortInfo
>
(
"QextPortInfo"
);
#if (defined QT_GUI_LIB)
notificationWidget
=
0
;
#endif // Q_OS_WIN
}
QextSerialEnumerator
::~
QextSerialEnumerator
(
)
{
#if (defined QT_GUI_LIB)
if
(
notificationWidget
)
delete
notificationWidget
;
#endif
}
// see http://msdn.microsoft.com/en-us/library/ms791134.aspx for list of GUID classes
#ifndef GUID_DEVCLASS_PORTS
DEFINE_GUID
(
GUID_DEVCLASS_PORTS
,
0x4D36E978
,
0xE325
,
0x11CE
,
0xBF
,
0xC1
,
0x08
,
0x00
,
0x2B
,
0xE1
,
0x03
,
0x18
);
#endif
/* Gordon Schumacher's macros for TCHAR -> QString conversions and vice versa */
#ifdef UNICODE
#define QStringToTCHAR(x) (wchar_t*) x.utf16()
#define PQStringToTCHAR(x) (wchar_t*) x->utf16()
#define TCHARToQString(x) QString::fromUtf16((ushort*)(x))
#define TCHARToQStringN(x,y) QString::fromUtf16((ushort*)(x),(y))
#else
#define QStringToTCHAR(x) x.local8Bit().constData()
#define PQStringToTCHAR(x) x->local8Bit().constData()
#define TCHARToQString(x) QString::fromLocal8Bit((x))
#define TCHARToQStringN(x,y) QString::fromLocal8Bit((x),(y))
#endif
/*UNICODE*/
//static
QString
QextSerialEnumerator
::
getRegKeyValue
(
HKEY
key
,
LPCTSTR
property
)
{
DWORD
size
=
0
;
DWORD
type
;
RegQueryValueEx
(
key
,
property
,
NULL
,
NULL
,
NULL
,
&
size
);
BYTE
*
buff
=
new
BYTE
[
size
];
QString
result
;
if
(
RegQueryValueEx
(
key
,
property
,
NULL
,
&
type
,
buff
,
&
size
)
==
ERROR_SUCCESS
)
result
=
TCHARToQString
(
buff
);
RegCloseKey
(
key
);
delete
[]
buff
;
return
result
;
}
//static
QString
QextSerialEnumerator
::
getDeviceProperty
(
HDEVINFO
devInfo
,
PSP_DEVINFO_DATA
devData
,
DWORD
property
)
{
DWORD
buffSize
=
0
;
SetupDiGetDeviceRegistryProperty
(
devInfo
,
devData
,
property
,
NULL
,
NULL
,
0
,
&
buffSize
);
BYTE
*
buff
=
new
BYTE
[
buffSize
];
SetupDiGetDeviceRegistryProperty
(
devInfo
,
devData
,
property
,
NULL
,
buff
,
buffSize
,
NULL
);
QString
result
=
TCHARToQString
(
buff
);
delete
[]
buff
;
return
result
;
}
QList
<
QextPortInfo
>
QextSerialEnumerator
::
getPorts
()
{
QList
<
QextPortInfo
>
ports
;
enumerateDevicesWin
(
GUID_DEVCLASS_PORTS
,
&
ports
);
return
ports
;
}
void
QextSerialEnumerator
::
enumerateDevicesWin
(
const
GUID
&
guid
,
QList
<
QextPortInfo
>*
infoList
)
{
HDEVINFO
devInfo
;
if
(
(
devInfo
=
SetupDiGetClassDevs
(
&
guid
,
NULL
,
NULL
,
DIGCF_PRESENT
))
!=
INVALID_HANDLE_VALUE
)
{
SP_DEVINFO_DATA
devInfoData
;
devInfoData
.
cbSize
=
sizeof
(
SP_DEVINFO_DATA
);
for
(
int
i
=
0
;
SetupDiEnumDeviceInfo
(
devInfo
,
i
,
&
devInfoData
);
i
++
)
{
QextPortInfo
info
;
info
.
productID
=
info
.
vendorID
=
0
;
getDeviceDetailsWin
(
&
info
,
devInfo
,
&
devInfoData
);
infoList
->
append
(
info
);
}
SetupDiDestroyDeviceInfoList
(
devInfo
);
}
}
#ifdef QT_GUI_LIB
bool
QextSerialRegistrationWidget
::
winEvent
(
MSG
*
message
,
long
*
result
)
{
if
(
message
->
message
==
WM_DEVICECHANGE
)
{
qese
->
onDeviceChangeWin
(
message
->
wParam
,
message
->
lParam
);
*
result
=
1
;
return
true
;
}
return
false
;
}
#endif
void
QextSerialEnumerator
::
setUpNotifications
(
)
{
#ifdef QT_GUI_LIB
if
(
notificationWidget
)
return
;
notificationWidget
=
new
QextSerialRegistrationWidget
(
this
);
DEV_BROADCAST_DEVICEINTERFACE
dbh
;
ZeroMemory
(
&
dbh
,
sizeof
(
dbh
));
dbh
.
dbcc_size
=
sizeof
(
dbh
);
dbh
.
dbcc_devicetype
=
DBT_DEVTYP_DEVICEINTERFACE
;
CopyMemory
(
&
dbh
.
dbcc_classguid
,
&
GUID_DEVCLASS_PORTS
,
sizeof
(
GUID
));
if
(
RegisterDeviceNotification
(
notificationWidget
->
winId
(
),
&
dbh
,
DEVICE_NOTIFY_WINDOW_HANDLE
)
==
NULL
)
qWarning
()
<<
"RegisterDeviceNotification failed:"
<<
GetLastError
();
// setting up notifications doesn't tell us about devices already connected
// so get those manually
foreach
(
QextPortInfo
port
,
getPorts
()
)
emit
deviceDiscovered
(
port
);
#else
qWarning
(
"QextSerialEnumerator: GUI not enabled - can't register for device notifications."
);
#endif // QT_GUI_LIB
}
LRESULT
QextSerialEnumerator
::
onDeviceChangeWin
(
WPARAM
wParam
,
LPARAM
lParam
)
{
if
(
DBT_DEVICEARRIVAL
==
wParam
||
DBT_DEVICEREMOVECOMPLETE
==
wParam
)
{
PDEV_BROADCAST_HDR
pHdr
=
(
PDEV_BROADCAST_HDR
)
lParam
;
if
(
pHdr
->
dbch_devicetype
==
DBT_DEVTYP_DEVICEINTERFACE
)
{
PDEV_BROADCAST_DEVICEINTERFACE
pDevInf
=
(
PDEV_BROADCAST_DEVICEINTERFACE
)
pHdr
;
// delimiters are different across APIs...change to backslash. ugh.
QString
deviceID
=
TCHARToQString
(
pDevInf
->
dbcc_name
).
toUpper
().
replace
(
"#"
,
"
\\
"
);
matchAndDispatchChangedDevice
(
deviceID
,
GUID_DEVCLASS_PORTS
,
wParam
);
}
}
return
0
;
}
bool
QextSerialEnumerator
::
matchAndDispatchChangedDevice
(
const
QString
&
deviceID
,
const
GUID
&
guid
,
WPARAM
wParam
)
{
bool
rv
=
false
;
DWORD
dwFlag
=
(
DBT_DEVICEARRIVAL
==
wParam
)
?
DIGCF_PRESENT
:
DIGCF_ALLCLASSES
;
HDEVINFO
devInfo
;
if
(
(
devInfo
=
SetupDiGetClassDevs
(
&
guid
,
NULL
,
NULL
,
dwFlag
))
!=
INVALID_HANDLE_VALUE
)
{
SP_DEVINFO_DATA
spDevInfoData
;
spDevInfoData
.
cbSize
=
sizeof
(
SP_DEVINFO_DATA
);
for
(
int
i
=
0
;
SetupDiEnumDeviceInfo
(
devInfo
,
i
,
&
spDevInfoData
);
i
++
)
{
DWORD
nSize
=
0
;
TCHAR
buf
[
MAX_PATH
];
if
(
SetupDiGetDeviceInstanceId
(
devInfo
,
&
spDevInfoData
,
buf
,
MAX_PATH
,
&
nSize
)
&&
deviceID
.
contains
(
TCHARToQString
(
buf
)))
// we found a match
{
rv
=
true
;
QextPortInfo
info
;
info
.
productID
=
info
.
vendorID
=
0
;
getDeviceDetailsWin
(
&
info
,
devInfo
,
&
spDevInfoData
,
wParam
);
if
(
wParam
==
DBT_DEVICEARRIVAL
)
emit
deviceDiscovered
(
info
);
else
if
(
wParam
==
DBT_DEVICEREMOVECOMPLETE
)
emit
deviceRemoved
(
info
);
break
;
}
}
SetupDiDestroyDeviceInfoList
(
devInfo
);
}
return
rv
;
}
bool
QextSerialEnumerator
::
getDeviceDetailsWin
(
QextPortInfo
*
portInfo
,
HDEVINFO
devInfo
,
PSP_DEVINFO_DATA
devData
,
WPARAM
wParam
)
{
portInfo
->
friendName
=
getDeviceProperty
(
devInfo
,
devData
,
SPDRP_FRIENDLYNAME
);
if
(
wParam
==
DBT_DEVICEARRIVAL
)
portInfo
->
physName
=
getDeviceProperty
(
devInfo
,
devData
,
SPDRP_PHYSICAL_DEVICE_OBJECT_NAME
);
portInfo
->
enumName
=
getDeviceProperty
(
devInfo
,
devData
,
SPDRP_ENUMERATOR_NAME
);
QString
hardwareIDs
=
getDeviceProperty
(
devInfo
,
devData
,
SPDRP_HARDWAREID
);
HKEY
devKey
=
SetupDiOpenDevRegKey
(
devInfo
,
devData
,
DICS_FLAG_GLOBAL
,
0
,
DIREG_DEV
,
KEY_READ
);
QRegExp
rx
(
"^COM(
\\
d+)"
);
QString
fullName
(
getRegKeyValue
(
devKey
,
TEXT
(
"PortName"
)));
if
(
fullName
.
contains
(
rx
))
{
int
portnum
=
rx
.
cap
(
1
).
toInt
();
if
(
portnum
>
9
)
// COM ports greater than 9 need \\.\ prepended
fullName
.
prepend
(
"
\\\\
.
\\
"
);
}
portInfo
->
portName
=
fullName
;
QRegExp
idRx
(
"VID_(
\\
w+)&PID_(
\\
w+)"
);
if
(
hardwareIDs
.
toUpper
().
contains
(
idRx
)
)
{
bool
dummy
;
portInfo
->
vendorID
=
idRx
.
cap
(
1
).
toInt
(
&
dummy
,
16
);
portInfo
->
productID
=
idRx
.
cap
(
2
).
toInt
(
&
dummy
,
16
);
//qDebug() << "got vid:" << vid << "pid:" << pid;
}
return
true
;
}
libs/qwt/qwt_plot_spectrogram.cpp
View file @
3d1f55cf
...
...
@@ -533,6 +533,15 @@ QwtRasterData::ContourLines QwtPlotSpectrogram::renderContourLines(
d_data
->
contourLevels
,
d_data
->
conrecAttributes
);
}
// These pragmas are local modifications to this third party library to silence warnings
#ifdef Q_OS_LINUX
#pragma GCC diagnostic push