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
02874e52
Commit
02874e52
authored
Feb 05, 2014
by
Bryant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mouse support now indicated by QGC_MOUSE_ENABLED_* macros.
parent
e540ddb9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
38 deletions
+39
-38
QGCExternalLibs.pri
QGCExternalLibs.pri
+3
-2
Mouse6dofInput.cpp
src/input/Mouse6dofInput.cpp
+12
-12
Mouse6dofInput.h
src/input/Mouse6dofInput.h
+10
-10
MainWindow.cc
src/ui/MainWindow.cc
+6
-6
MainWindow.h
src/ui/MainWindow.h
+8
-8
No files found.
QGCExternalLibs.pri
View file @
02874e52
...
...
@@ -419,12 +419,13 @@ contains(DEFINES, DISABLE_XBEE) {
#
contains(DEFINES, DISABLE_3DMOUSE) {
message("Skipping support for 3DConnexion mice (manual override)")
DEFINES -= DISABLE_3DMOUSE
} else:LinuxBuild {
exists(/usr/local/lib/libxdrvlib.so) {
message("Including support for 3DConnexion mice")
DEFINES +=
MOUSE_ENABLED_LINUX \
QGC_
MOUSE_ENABLED_LINUX \
ParameterCheck # Hack: Has to be defined for magellan usage
HEADERS += src/input/Mouse6dofInput.h
...
...
@@ -436,7 +437,7 @@ contains(DEFINES, DISABLE_3DMOUSE) {
} else:WindowsBuild {
message("Including support for 3DConnexion mice")
DEFINES += MOUSE_ENABLED_WIN
DEFINES +=
QGC_
MOUSE_ENABLED_WIN
INCLUDEPATH += libs/thirdParty/3DMouse/win
...
...
src/input/Mouse6dofInput.cpp
View file @
02874e52
...
...
@@ -11,7 +11,7 @@
#include "UASManager.h"
#include "QMessageBox"
#ifdef
MOUSE_ENABLED_LINUX
#ifdef
QGC_MOUSE_ENABLED_LINUX
#include <QX11Info>
#include <X11/Xlib.h>
#ifdef Success
...
...
@@ -21,9 +21,9 @@ extern "C"
{
#include "xdrvlib.h"
}
#endif //
MOUSE_ENABLED_LINUX
#endif //
QGC_MOUSE_ENABLED_LINUX
#ifdef
MOUSE_ENABLED_WIN
#ifdef
QGC_MOUSE_ENABLED_WIN
Mouse6dofInput
::
Mouse6dofInput
(
Mouse3DInput
*
mouseInput
)
:
mouse3DMax
(
0.075
),
// TODO: check maximum value fot plugged device
uas
(
NULL
),
...
...
@@ -45,9 +45,9 @@ Mouse6dofInput::Mouse6dofInput(Mouse3DInput* mouseInput) :
//connect(mouseInput, SIGNAL(On3dmouseKeyUp(int)), this, SLOT(FUNCTION(int)));
}
#endif //
MOUSE_ENABLED_WIN
#endif //
QGC_MOUSE_ENABLED_WIN
#ifdef
MOUSE_ENABLED_LINUX
#ifdef
QGC_MOUSE_ENABLED_LINUX
Mouse6dofInput
::
Mouse6dofInput
(
QWidget
*
parent
)
:
mouse3DMax
(
350.0
),
// TODO: check maximum value fot plugged device
uas
(
NULL
),
...
...
@@ -109,7 +109,7 @@ Mouse6dofInput::Mouse6dofInput(QWidget* parent) :
}
}
#endif //
MOUSE_ENABLED_LINUX
#endif //
QGC_MOUSE_ENABLED_LINUX
Mouse6dofInput
::~
Mouse6dofInput
()
...
...
@@ -191,7 +191,7 @@ void Mouse6dofInput::run()
}
}
#ifdef
MOUSE_ENABLED_WIN
#ifdef
QGC_MOUSE_ENABLED_WIN
void
Mouse6dofInput
::
motion3DMouse
(
std
::
vector
<
float
>
&
motionData
)
{
if
(
motionData
.
size
()
<
6
)
return
;
...
...
@@ -220,9 +220,9 @@ void Mouse6dofInput::motion3DMouse(std::vector<float> &motionData)
//qDebug() << "NEW 3D MOUSE VALUES -- X" << xValue << " -- Y" << yValue << " -- Z" << zValue << " -- A" << aValue << " -- B" << bValue << " -- C" << cValue;
}
#endif //
MOUSE_ENABLED_WIN
#endif //
QGC_MOUSE_ENABLED_WIN
#ifdef
MOUSE_ENABLED_WIN
#ifdef
QGC_MOUSE_ENABLED_WIN
void
Mouse6dofInput
::
button3DMouseDown
(
int
button
)
{
switch
(
button
)
...
...
@@ -245,9 +245,9 @@ void Mouse6dofInput::button3DMouseDown(int button)
break
;
}
}
#endif //
MOUSE_ENABLED_WIN
#endif //
QGC_MOUSE_ENABLED_WIN
#ifdef
MOUSE_ENABLED_LINUX
#ifdef
QGC_MOUSE_ENABLED_LINUX
void
Mouse6dofInput
::
handleX11Event
(
XEvent
*
event
)
{
//qDebug("XEvent occured...");
...
...
@@ -327,4 +327,4 @@ void Mouse6dofInput::handleX11Event(XEvent *event)
}
}
}
#endif //
MOUSE_ENABLED_LINUX
#endif //
QGC_MOUSE_ENABLED_LINUX
src/input/Mouse6dofInput.h
View file @
02874e52
...
...
@@ -11,9 +11,9 @@
#include <QThread>
#ifdef
MOUSE_ENABLED_WIN
#ifdef
QGC_MOUSE_ENABLED_WIN
#include "Mouse3DInput.h"
#endif //
MOUSE_ENABLED_WIN
#endif //
QGC_MOUSE_ENABLED_WIN
#include "UASInterface.h"
...
...
@@ -22,12 +22,12 @@ class Mouse6dofInput : public QThread
Q_OBJECT
public:
#ifdef
MOUSE_ENABLED_WIN
#ifdef
QGC_MOUSE_ENABLED_WIN
Mouse6dofInput
(
Mouse3DInput
*
mouseInput
);
#endif //
MOUSE_ENABLED_WIN
#ifdef
MOUSE_ENABLED_LINUX
#endif //
QGC_MOUSE_ENABLED_WIN
#ifdef
QGC_MOUSE_ENABLED_LINUX
Mouse6dofInput
(
QWidget
*
parent
);
#endif //
MOUSE_ENABLED_LINUX
#endif //
QGC_MOUSE_ENABLED_LINUX
~
Mouse6dofInput
();
void
run
();
...
...
@@ -78,16 +78,16 @@ signals:
public
slots
:
void
setActiveUAS
(
UASInterface
*
uas
);
#ifdef
MOUSE_ENABLED_WIN
#ifdef
QGC_MOUSE_ENABLED_WIN
/** @brief Get a motion input from 3DMouse */
void
motion3DMouse
(
std
::
vector
<
float
>
&
motionData
);
/** @brief Get a button input from 3DMouse */
void
button3DMouseDown
(
int
button
);
#endif //
MOUSE_ENABLED_WIN
#ifdef
MOUSE_ENABLED_LINUX
#endif //
QGC_MOUSE_ENABLED_WIN
#ifdef
QGC_MOUSE_ENABLED_LINUX
/** @brief Get an XEvent to check it for an 3DMouse event (motion or button) */
void
handleX11Event
(
XEvent
*
event
);
#endif //
MOUSE_ENABLED_LINUX
#endif //
QGC_MOUSE_ENABLED_LINUX
};
...
...
src/ui/MainWindow.cc
View file @
02874e52
...
...
@@ -279,19 +279,19 @@ void MainWindow::init()
joystickWidget
=
0
;
joystick
=
new
JoystickInput
();
#ifdef
MOUSE_ENABLED_WIN
#ifdef
QGC_MOUSE_ENABLED_WIN
emit
initStatusChanged
(
tr
(
"Initializing 3D mouse interface"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
mouseInput
=
new
Mouse3DInput
(
this
);
mouse
=
new
Mouse6dofInput
(
mouseInput
);
#endif //
MOUSE_ENABLED_WIN
#endif //
QGC_MOUSE_ENABLED_WIN
#if
MOUSE_ENABLED_LINUX
#if
QGC_MOUSE_ENABLED_LINUX
emit
initStatusChanged
(
tr
(
"Initializing 3D mouse interface"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
mouse
=
new
Mouse6dofInput
(
this
);
connect
(
this
,
SIGNAL
(
x11EventOccured
(
XEvent
*
)),
mouse
,
SLOT
(
handleX11Event
(
XEvent
*
)));
#endif //
MOUSE_ENABLED_LINUX
#endif //
QGC_MOUSE_ENABLED_LINUX
// Connect link
if
(
autoReconnect
)
...
...
@@ -2023,11 +2023,11 @@ bool MainWindow::dockWidgetTitleBarsEnabled() const
return
menuActionHelper
->
dockWidgetTitleBarsEnabled
();
}
#ifdef
MOUSE_ENABLED_LINUX
#ifdef
QGC_MOUSE_ENABLED_LINUX
bool
MainWindow
::
x11Event
(
XEvent
*
event
)
{
emit
x11EventOccured
(
event
);
//qDebug("XEvent occured...");
return
false
;
}
#endif //
MOUSE_ENABLED_LINUX
#endif //
QGC_MOUSE_ENABLED_LINUX
src/ui/MainWindow.h
View file @
02874e52
...
...
@@ -51,9 +51,9 @@ This file is part of the QGROUNDCONTROL project
#include "ObjectDetectionView.h"
#include "submainwindow.h"
#include "input/JoystickInput.h"
#if (defined
MOUSE_ENABLED_WIN) | (defined MOUSE_ENABLED_LINUX)
#if (defined
QGC_MOUSE_ENABLED_WIN) | (defined QGC_MOUSE_ENABLED_LINUX)
#include "Mouse6dofInput.h"
#endif //
MOUSE_ENABLED_WIN
#endif //
QGC_MOUSE_ENABLED_WIN
#include "DebugConsole.h"
#include "ParameterInterface.h"
#include "HDDisplay.h"
...
...
@@ -303,10 +303,10 @@ signals:
/** Emitted when any value changes from any source */
void
valueChanged
(
const
int
uasId
,
const
QString
&
name
,
const
QString
&
unit
,
const
QVariant
&
value
,
const
quint64
msec
);
#ifdef
MOUSE_ENABLED_LINUX
#ifdef
QGC_MOUSE_ENABLED_LINUX
/** @brief Forward X11Event to catch 3DMouse inputs */
void
x11EventOccured
(
XEvent
*
event
);
#endif //
MOUSE_ENABLED_LINUX
#endif //
QGC_MOUSE_ENABLED_LINUX
public:
QGCMAVLinkLogPlayer
*
getLogPlayer
()
...
...
@@ -465,17 +465,17 @@ protected:
JoystickInput
*
joystick
;
#ifdef
MOUSE_ENABLED_WIN
#ifdef
QGC_MOUSE_ENABLED_WIN
/** @brief 3d Mouse support (WIN only) */
Mouse3DInput
*
mouseInput
;
///< 3dConnexion 3dMouse SDK
Mouse6dofInput
*
mouse
;
///< Implementation for 3dMouse input
#endif //
MOUSE_ENABLED_WIN
#endif //
QGC_MOUSE_ENABLED_WIN
#ifdef
MOUSE_ENABLED_LINUX
#ifdef
QGC_MOUSE_ENABLED_LINUX
/** @brief Reimplementation of X11Event to handle 3dMouse Events (magellan) */
bool
x11Event
(
XEvent
*
event
);
Mouse6dofInput
*
mouse
;
///< Implementation for 3dMouse input
#endif //
MOUSE_ENABLED_LINUX
#endif //
QGC_MOUSE_ENABLED_LINUX
/** User interface actions **/
QAction
*
connectUASAct
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment