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
61cafe14
Commit
61cafe14
authored
Aug 26, 2010
by
Bryan Godbolt
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into dev
parents
f7ea1b9c
c0fdf26c
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
983 additions
and
140 deletions
+983
-140
layer.cpp
lib/QMapControl/src/layer.cpp
+31
-14
layer.h
lib/QMapControl/src/layer.h
+23
-0
mapcontrol.cpp
lib/QMapControl/src/mapcontrol.cpp
+2
-0
qgroundcontrol.pro
qgroundcontrol.pro
+6
-3
AS4Protocol.cc
src/comm/AS4Protocol.cc
+13
-13
LinkManager.cc
src/comm/LinkManager.cc
+13
-13
MAVLinkSimulationLink.cc
src/comm/MAVLinkSimulationLink.cc
+6
-6
MAVLinkSyntaxHighlighter.cc
src/comm/MAVLinkSyntaxHighlighter.cc
+23
-0
MAVLinkXMLParser.cc
src/comm/MAVLinkXMLParser.cc
+2
-2
SerialLink.cc
src/comm/SerialLink.cc
+6
-7
SerialSimulationLink.cc
src/comm/SerialSimulationLink.cc
+6
-7
UDPLink.cc
src/comm/UDPLink.cc
+6
-6
PxQuadMAV.cc
src/uas/PxQuadMAV.cc
+23
-0
SlugsMAV.cc
src/uas/SlugsMAV.cc
+23
-0
UAS.cc
src/uas/UAS.cc
+50
-7
UASInterface.h
src/uas/UASInterface.h
+2
-0
UASManager.cc
src/uas/UASManager.cc
+6
-6
UASWaypointManager.cc
src/uas/UASWaypointManager.cc
+6
-6
AudioOutputWidget.cc
src/ui/AudioOutputWidget.cc
+1
-1
CameraView.cc
src/ui/CameraView.cc
+15
-16
CommConfigurationWindow.cc
src/ui/CommConfigurationWindow.cc
+7
-8
DebugConsole.cc
src/ui/DebugConsole.cc
+7
-7
MAVLinkSettingsWidget.cc
src/ui/MAVLinkSettingsWidget.cc
+29
-0
MainWindow.cc
src/ui/MainWindow.cc
+7
-1
MainWindow.h
src/ui/MainWindow.h
+2
-0
MapWidget.cc
src/ui/MapWidget.cc
+50
-13
MapWidget.h
src/ui/MapWidget.h
+9
-2
QGCDataPlot2D.cc
src/ui/QGCDataPlot2D.cc
+29
-0
QGCFirmwareUpdate.cc
src/ui/QGCFirmwareUpdate.cc
+30
-0
QGCPxImuFirmwareUpdate.cc
src/ui/QGCPxImuFirmwareUpdate.cc
+7
-0
QGCRemoteControlView.cc
src/ui/QGCRemoteControlView.cc
+180
-0
QGCRemoteControlView.h
src/ui/QGCRemoteControlView.h
+76
-0
QGCRemoteControlView.ui
src/ui/QGCRemoteControlView.ui
+279
-0
QGCSensorSettingsWidget.cc
src/ui/QGCSensorSettingsWidget.cc
+7
-0
SerialConfigurationWindow.cc
src/ui/SerialConfigurationWindow.cc
+1
-2
No files found.
lib/QMapControl/src/layer.cpp
View file @
61cafe14
...
...
@@ -110,28 +110,45 @@ namespace qmapcontrol
}
void
Layer
::
mouseEvent
(
const
QMouseEvent
*
evnt
,
const
QPoint
mapmiddle_px
)
{
if
(
takesMouseEvents
())
{
if
(
evnt
->
button
()
==
Qt
::
LeftButton
&&
evnt
->
type
()
==
QEvent
::
MouseButtonPress
)
if
(
takesMouseEvents
()
)
{
// check for collision
QPointF
c
=
mapAdapter
->
displayToCoordinate
(
QPoint
(
evnt
->
x
()
-
screenmiddle
.
x
()
+
mapmiddle_px
.
x
(),
evnt
->
y
()
-
screenmiddle
.
y
()
+
mapmiddle_px
.
y
()));
Point
*
tmppoint
=
new
Point
(
c
.
x
(),
c
.
y
());
for
(
int
i
=
0
;
i
<
geometries
.
count
();
i
++
)
if
(
evnt
->
button
()
==
Qt
::
LeftButton
&&
evnt
->
type
()
==
QEvent
::
MouseButtonPress
)
{
if
(
geometries
.
at
(
i
)
->
isVisible
()
&&
geometries
.
at
(
i
)
->
Touches
(
tmppoint
,
mapAdapter
))
//if (geometries.at(i)->Touches(c, mapAdapter))
// check for collision
QPointF
c
=
mapAdapter
->
displayToCoordinate
(
QPoint
(
evnt
->
x
()
-
screenmiddle
.
x
()
+
mapmiddle_px
.
x
(),
evnt
->
y
()
-
screenmiddle
.
y
()
+
mapmiddle_px
.
y
()));
Point
*
tmppoint
=
new
Point
(
c
.
x
(),
c
.
y
());
for
(
int
i
=
0
;
i
<
geometries
.
count
();
i
++
)
{
emit
(
geometryClicked
(
geometries
.
at
(
i
),
QPoint
(
evnt
->
x
(),
evnt
->
y
())));
if
(
geometries
.
at
(
i
)
->
isVisible
()
&&
geometries
.
at
(
i
)
->
Touches
(
tmppoint
,
mapAdapter
))
//if (geometries.at(i)->Touches(c, mapAdapter))
{
emit
(
geometryClicked
(
geometries
.
at
(
i
),
QPoint
(
evnt
->
x
(),
evnt
->
y
())));
draggingGeometry
=
true
;
geometrySelected
=
geometries
.
at
(
i
);
}
}
delete
tmppoint
;
}
if
(
evnt
->
type
()
==
QEvent
::
MouseButtonRelease
){
QPointF
c
=
mapAdapter
->
displayToCoordinate
(
QPoint
(
evnt
->
x
()
-
screenmiddle
.
x
()
+
mapmiddle_px
.
x
(),
evnt
->
y
()
-
screenmiddle
.
y
()
+
mapmiddle_px
.
y
()));
draggingGeometry
=
false
;
emit
(
geometryEndDrag
(
geometrySelected
,
c
));
geometrySelected
=
0
;
}
if
(
evnt
->
type
()
==
QEvent
::
MouseMove
&&
draggingGeometry
){
QPointF
c
=
mapAdapter
->
displayToCoordinate
(
QPoint
(
evnt
->
x
()
-
screenmiddle
.
x
()
+
mapmiddle_px
.
x
(),
evnt
->
y
()
-
screenmiddle
.
y
()
+
mapmiddle_px
.
y
()));
emit
(
geometryDragged
(
geometrySelected
,
c
));
}
delete
tmppoint
;
}
}
}
bool
Layer
::
takesMouseEvents
()
const
{
...
...
lib/QMapControl/src/layer.h
View file @
61cafe14
...
...
@@ -63,6 +63,7 @@ namespace qmapcontrol
public:
friend
class
LayerManager
;
//! sets the type of a layer, see Layer class doc for further information
enum
LayerType
{
...
...
@@ -157,6 +158,9 @@ namespace qmapcontrol
bool
takeevents
;
mutable
QRect
myoffscreenViewport
;
Geometry
*
geometrySelected
;
bool
draggingGeometry
;
signals:
//! This signal is emitted when a Geometry is clicked
/*!
...
...
@@ -167,6 +171,25 @@ namespace qmapcontrol
*/
void
geometryClicked
(
Geometry
*
geometry
,
QPoint
point
);
//! This signal is emitted while a Geometry is being dragged
/*!
* A Geometry is clickable, if the containing layer is clickable.
* The layer emits a signal as it is dragged
* @param geometry The selected Geometry
* @param coordinate The new coordinate (in world coordinates)
*/
void
geometryDragged
(
Geometry
*
geometrySelected
,
QPointF
coordinate
);
//! This signal is emitted when a User releases the button after selecting a Geometry
/*!
* A Geometry is clickable, if the containing layer is clickable.
* The layer emits a signal when it is released
* @param geometry The selected Geometry
* @param coordinate The new coordinate (in world coordinates)
*/
void
geometryEndDrag
(
Geometry
*
geometrySelected
,
QPointF
coordinate
);
void
updateRequest
(
QRectF
rect
);
void
updateRequest
();
...
...
lib/QMapControl/src/mapcontrol.cpp
View file @
61cafe14
...
...
@@ -255,6 +255,7 @@ namespace qmapcontrol
void
MapControl
::
mouseReleaseEvent
(
QMouseEvent
*
evnt
)
{
layermanager
->
mouseEvent
(
evnt
);
mousepressed
=
false
;
if
(
mymousemode
==
Dragging
)
{
...
...
@@ -271,6 +272,7 @@ namespace qmapcontrol
void
MapControl
::
mouseMoveEvent
(
QMouseEvent
*
evnt
)
{
layermanager
->
mouseEvent
(
evnt
);
emit
(
mouseEvent
(
evnt
));
...
...
qgroundcontrol.pro
View file @
61cafe14
...
...
@@ -74,7 +74,8 @@ FORMS += src/ui/MainWindow.ui \
src
/
ui
/
watchdog
/
WatchdogView
.
ui
\
src
/
ui
/
QGCFirmwareUpdate
.
ui
\
src
/
ui
/
QGCPxImuFirmwareUpdate
.
ui
\
src
/
ui
/
QGCDataPlot2D
.
ui
src
/
ui
/
QGCDataPlot2D
.
ui
\
src
/
ui
/
QGCRemoteControlView
.
ui
INCLUDEPATH
+=
src
\
src
/
ui
\
src
/
ui
/
linechart
\
...
...
@@ -155,7 +156,8 @@ HEADERS += src/MG.h \
src
/
ui
/
linechart
/
IncrementalPlot
.
h
\
src
/
ui
/
map
/
Waypoint2DIcon
.
h
\
src
/
ui
/
map
/
MAV2DIcon
.
h
\
src
/
ui
/
map
/
QGC2DIcon
.
h
src
/
ui
/
map
/
QGC2DIcon
.
h
\
src
/
ui
/
QGCRemoteControlView
.
h
SOURCES
+=
src
/
main
.
cc
\
src
/
Core
.
cc
\
src
/
uas
/
UASManager
.
cc
\
...
...
@@ -218,7 +220,8 @@ SOURCES += src/main.cc \
src
/
ui
/
linechart
/
IncrementalPlot
.
cc
\
src
/
ui
/
map
/
Waypoint2DIcon
.
cc
\
src
/
ui
/
map
/
MAV2DIcon
.
cc
\
src
/
ui
/
map
/
QGC2DIcon
.
cc
src
/
ui
/
map
/
QGC2DIcon
.
cc
\
src
/
ui
/
QGCRemoteControlView
.
cc
RESOURCES
=
mavground
.
qrc
#
Include
RT
-
LAB
Library
...
...
src/comm/AS4Protocol.cc
View file @
61cafe14
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
(c) 2009, 2010
PIXHAWK PROJECT <http://pixhawk.ethz.ch
>
This file is part of the
PIXHAWK
project
PIXHAWK
is free software: you can redistribute it and/or modify
QGroundControl Open Source Ground Control Station
(c) 2009, 2010
QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org
>
This file is part of the
QGROUNDCONTROL
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.
PIXHAWK
is distributed in the hope that it will be useful,
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
PIXHAWK
. If not, see <http://www.gnu.org/licenses/>.
along with
QGROUNDCONTROL
. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
...
...
src/comm/LinkManager.cc
View file @
61cafe14
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
(c) 2009
PIXHAWK PROJECT <http://pixhawk.ethz.ch
>
This file is part of the
PIXHAWK
project
PIXHAWK
is free software: you can redistribute it and/or modify
QGroundControl Open Source Ground Control Station
(c) 2009
, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org
>
This file is part of the
QGROUNDCONTROL
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.
PIXHAWK
is distributed in the hope that it will be useful,
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
PIXHAWK
. If not, see <http://www.gnu.org/licenses/>.
along with
QGROUNDCONTROL
. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
...
...
src/comm/MAVLinkSimulationLink.cc
View file @
61cafe14
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010
PIXHAWK PROJECT <http://pixhawk.ethz.ch
>
(c) 2009, 2010
QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org
>
This file is part of the
PIXHAWK
project
This file is part of the
QGROUNDCONTROL
project
PIXHAWK
is free software: you can redistribute it and/or modify
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.
PIXHAWK
is distributed in the hope that it will be useful,
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
PIXHAWK
. If not, see <http://www.gnu.org/licenses/>.
along with
QGROUNDCONTROL
. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
...
...
src/comm/MAVLinkSyntaxHighlighter.cc
View file @
61cafe14
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL 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/>.
======================================================================*/
#include "MAVLinkSyntaxHighlighter.h"
MAVLinkSyntaxHighlighter
::
MAVLinkSyntaxHighlighter
(
QObject
*
parent
)
:
...
...
src/comm/MAVLinkXMLParser.cc
View file @
61cafe14
...
...
@@ -258,7 +258,7 @@ bool MAVLinkXMLParser::generate()
packLines
+=
QString
(
"
\t
i += put_%1_by_index(%2, %3, i, msg->payload); //%4
\n
"
).
arg
(
arrayType
,
fieldName
,
QString
::
number
(
arrayLength
),
e2
.
text
());
// Add decode function for this type
decodeLines
+=
QString
(
"
\t
mavlink_msg_%1_get_%2(msg, %1->%2);
\n
"
).
arg
(
messageName
,
fieldName
);
arrayDefines
+=
QString
(
"#define MAVLINK_MSG_%1_FIELD_%2_LEN %3"
).
arg
(
messageName
.
toUpper
(),
fieldName
.
toUpper
(),
QString
::
number
(
arrayLength
));
arrayDefines
+=
QString
(
"#define MAVLINK_MSG_%1_FIELD_%2_LEN %3
\n
"
).
arg
(
messageName
.
toUpper
(),
fieldName
.
toUpper
(),
QString
::
number
(
arrayLength
));
}
else
if
(
fieldType
.
startsWith
(
"string"
))
{
...
...
@@ -273,7 +273,7 @@ bool MAVLinkXMLParser::generate()
packLines
+=
QString
(
"
\t
i += put_%1_by_index(%2, %3, i, msg->payload); //%4
\n
"
).
arg
(
arrayType
,
fieldName
,
QString
::
number
(
arrayLength
),
e2
.
text
());
// Add decode function for this type
decodeLines
+=
QString
(
"
\t
mavlink_msg_%1_get_%2(msg, %1->%2);
\n
"
).
arg
(
messageName
,
fieldName
);
arrayDefines
+=
QString
(
"#define MAVLINK_MSG_%1_FIELD_%2_LEN %3"
).
arg
(
messageName
.
toUpper
(),
fieldName
.
toUpper
(),
QString
::
number
(
arrayLength
));
arrayDefines
+=
QString
(
"#define MAVLINK_MSG_%1_FIELD_%2_LEN %3
\n
"
).
arg
(
messageName
.
toUpper
(),
fieldName
.
toUpper
(),
QString
::
number
(
arrayLength
));
}
else
// Handle simple types like integers and floats
...
...
src/comm/SerialLink.cc
View file @
61cafe14
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010
PIXHAWK PROJECT <http://pixhawk.ethz.ch
>
(c) 2009, 2010
QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org
>
This file is part of the
PIXHAWK
project
This file is part of the
QGROUNDCONTROL
project
PIXHAWK
is free software: you can redistribute it and/or modify
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.
PIXHAWK
is distributed in the hope that it will be useful,
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
PIXHAWK
. If not, see <http://www.gnu.org/licenses/>.
along with
QGROUNDCONTROL
. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Cross-platform support for serial ports
...
...
src/comm/SerialSimulationLink.cc
View file @
61cafe14
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009
PIXHAWK PROJECT <http://pixhawk.ethz.ch
>
(c) 2009
, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org
>
This file is part of the
PIXHAWK
project
This file is part of the
QGROUNDCONTROL
project
PIXHAWK
is free software: you can redistribute it and/or modify
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.
PIXHAWK
is distributed in the hope that it will be useful,
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
PIXHAWK
. If not, see <http://www.gnu.org/licenses/>.
along with
QGROUNDCONTROL
. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Brief Description
...
...
src/comm/UDPLink.cc
View file @
61cafe14
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010
PIXHAWK PROJECT <http://pixhawk.ethz.ch
>
(c) 2009, 2010
QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org
>
This file is part of the
PIXHAWK
project
This file is part of the
QGROUNDCONTROL
project
PIXHAWK
is free software: you can redistribute it and/or modify
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.
PIXHAWK
is distributed in the hope that it will be useful,
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
PIXHAWK
. If not, see <http://www.gnu.org/licenses/>.
along with
QGROUNDCONTROL
. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
...
...
src/uas/PxQuadMAV.cc
View file @
61cafe14
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL 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/>.
======================================================================*/
#include "PxQuadMAV.h"
#include "GAudioOutput.h"
...
...
src/uas/SlugsMAV.cc
View file @
61cafe14
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL 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/>.
======================================================================*/
#include "SlugsMAV.h"
#include <QDebug>
...
...
src/uas/UAS.cc
View file @
61cafe14
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010
PIXHAWK PROJECT <http://pixhawk.ethz.ch
>
(c) 2009, 2010
QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org
>
This file is part of the
PIXHAWK
project
This file is part of the
QGROUNDCONTROL
project
PIXHAWK
is free software: you can redistribute it and/or modify
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.
PIXHAWK
is distributed in the hope that it will be useful,
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
PIXHAWK
. If not, see <http://www.gnu.org/licenses/>.
along with
QGROUNDCONTROL
. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
...
...
@@ -387,6 +387,42 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
}
}
break
;
case
MAVLINK_MSG_ID_RC_CHANNELS
:
{
mavlink_rc_channels_t
channels
;
mavlink_msg_rc_channels_decode
(
&
message
,
&
channels
);
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
switch
(
i
)
{
case
0
:
emit
remoteControlChannelChanged
(
i
,
channels
.
chan1_raw
,
channels
.
chan1_255
/
255.0
f
);
break
;
case
1
:
emit
remoteControlChannelChanged
(
i
,
channels
.
chan2_raw
,
channels
.
chan2_255
/
255.0
f
);
break
;
case
2
:
emit
remoteControlChannelChanged
(
i
,
channels
.
chan3_raw
,
channels
.
chan3_255
/
255.0
f
);
break
;
case
3
:
emit
remoteControlChannelChanged
(
i
,
channels
.
chan4_raw
,
channels
.
chan4_255
/
255.0
f
);
break
;
case
4
:
emit
remoteControlChannelChanged
(
i
,
channels
.
chan5_raw
,
channels
.
chan5_255
/
255.0
f
);
break
;
case
5
:
emit
remoteControlChannelChanged
(
i
,
channels
.
chan6_raw
,
channels
.
chan6_255
/
255.0
f
);
break
;
case
6
:
emit
remoteControlChannelChanged
(
i
,
channels
.
chan7_raw
,
channels
.
chan7_255
/
255.0
f
);
break
;
case
7
:
emit
remoteControlChannelChanged
(
i
,
channels
.
chan8_raw
,
channels
.
chan8_255
/
255.0
f
);
break
;
}
}
}
break
;
case
MAVLINK_MSG_ID_PARAM_VALUE
:
{
mavlink_param_value_t
value
;
...
...
@@ -954,6 +990,13 @@ void UAS::enableExtra3Transmission(bool enabled)
#endif
}
/**
* Set a parameter value onboard
*
* @param component The component to set the parameter
* @param id Name of the parameter
* @param value Parameter value
*/
void
UAS
::
setParameter
(
int
component
,
QString
id
,
float
value
)
{
mavlink_message_t
msg
;
...
...
@@ -986,7 +1029,7 @@ void UAS::setParameter(int component, QString id, float value)
}
/**
*
@brief
Launches the system
* Launches the system
*
**/
void
UAS
::
launch
()
...
...
src/uas/UASInterface.h
View file @
61cafe14
...
...
@@ -329,6 +329,8 @@ signals:
void
positionZControlEnabled
(
bool
enabled
);
/** @brief Heading control enabled/disabled */
void
positionYawControlEnabled
(
bool
enabled
);
/** @brief Value of a remote control channel */
void
remoteControlChannelChanged
(
int
channelId
,
float
raw
,
float
normalized
);
/**
* @brief Localization quality changed
...
...
src/uas/UASManager.cc
View file @
61cafe14
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009
PIXHAWK PROJECT <http://pixhawk.ethz.ch
>
(c) 2009
, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org
>
This file is part of the
PIXHAWK
project
This file is part of the
QGROUNDCONTROL
project
PIXHAWK
is free software: you can redistribute it and/or modify
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.
PIXHAWK
is distributed in the hope that it will be useful,
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
PIXHAWK
. If not, see <http://www.gnu.org/licenses/>.
along with
QGROUNDCONTROL
. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
...
...
src/uas/UASWaypointManager.cc
View file @
61cafe14
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010
PIXHAWK PROJECT <http://pixhawk.ethz.ch
>
(c) 2009, 2010
QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org
>
This file is part of the
PIXHAWK
project
This file is part of the
QGROUNDCONTROL
project
PIXHAWK
is free software: you can redistribute it and/or modify
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.
PIXHAWK
is distributed in the hope that it will be useful,
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
PIXHAWK
. If not, see <http://www.gnu.org/licenses/>.
along with
QGROUNDCONTROL
. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
...
...
src/ui/AudioOutputWidget.cc
View file @
61cafe14
...
...
@@ -23,7 +23,7 @@ This file is part of the QGROUNDCONTROL project
/**
* @file
* @brief Implementation of
class
AudioOutputWidget
* @brief Implementation of AudioOutputWidget
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
...
...
src/ui/CameraView.cc
View file @
61cafe14
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
(c) 2009
PIXHAWK PROJECT <http://pixhawk.ethz.ch
>
This file is part of the
PIXHAWK
project
PIXHAWK
is free software: you can redistribute it and/or modify
QGroundControl Open Source Ground Control Station
(c) 2009
, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org
>
This file is part of the
QGROUNDCONTROL
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.
PIXHAWK
is distributed in the hope that it will be useful,
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
PIXHAWK
. If not, see <http://www.gnu.org/licenses/>.
along with
QGROUNDCONTROL
. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Brief Description
*
* @brief Implementation of CameraView
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
...
...
src/ui/CommConfigurationWindow.cc
View file @
61cafe14
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
Please see our website at <http://pixhawk.ethz.ch>
QGroundControl Open Source Ground Control Station
(c) 2009, 2010
PIXHAWK PROJECT <http://pixhawk.ethz.ch
>
(c) 2009, 2010
QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org
>
This file is part of the
PIXHAWK
project
This file is part of the
QGROUNDCONTROL
project
PIXHAWK
is free software: you can redistribute it and/or modify
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.
PIXHAWK
is distributed in the hope that it will be useful,
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
PIXHAWK
. If not, see <http://www.gnu.org/licenses/>.
along with
QGROUNDCONTROL
. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Implementation of
configuration window for serial links
* @brief Implementation of
CommConfigurationWindow
*
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
...
...
src/ui/DebugConsole.cc
View file @
61cafe14
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010
PIXHAWK PROJECT <http://pixhawk.ethz.ch
>
(c) 2009, 2010
QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org
>
This file is part of the
PIXHAWK
project
This file is part of the
QGROUNDCONTROL
project
PIXHAWK
is free software: you can redistribute it and/or modify
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.
PIXHAWK
is distributed in the hope that it will be useful,
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
PIXHAWK
. If not, see <http://www.gnu.org/licenses/>.
along with
QGROUNDCONTROL
. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief
Debug c
onsole
* @brief
Implementation of DebugC
onsole
*
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
...
...
src/ui/MAVLinkSettingsWidget.cc
View file @
61cafe14
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL 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/>.
======================================================================*/
/**
* @file
* @brief Implementation of MAVLinkSettingsWidget
* @author Lorenz Meier <mail@qgroundcontrol.org>
*/
#include "MAVLinkSettingsWidget.h"
#include "ui_MAVLinkSettingsWidget.h"
...
...
src/ui/MainWindow.cc
View file @
61cafe14
...
...
@@ -138,7 +138,8 @@ void MainWindow::buildWidgets()
headDown1
=
new
HDDisplay
(
acceptList
,
this
);
headDown2
=
new
HDDisplay
(
acceptList2
,
this
);
joystick
=
new
JoystickInput
();
dataplot
=
new
QGCDataPlot2D
();
dataplot
=
new
QGCDataPlot2D
(
this
);
rcView
=
new
QGCRemoteControlView
(
this
);
}
void
MainWindow
::
connectWidgets
()
...
...
@@ -562,6 +563,11 @@ void MainWindow::loadPixhawkView()
container7
->
setWidget
(
debugConsole
);
addDockWidget
(
Qt
::
BottomDockWidgetArea
,
container7
);
// DEBUG CONSOLE
QDockWidget
*
rcContainer
=
new
QDockWidget
(
tr
(
"Radio Control"
),
this
);
rcContainer
->
setWidget
(
rcView
);
addDockWidget
(
Qt
::
BottomDockWidgetArea
,
rcContainer
);
// ONBOARD PARAMETERS
QDockWidget
*
containerParams
=
new
QDockWidget
(
tr
(
"Onboard Parameters"
),
this
);
containerParams
->
setWidget
(
parameters
);
...
...
src/ui/MainWindow.h
View file @
61cafe14
...
...
@@ -62,6 +62,7 @@ This file is part of the QGROUNDCONTROL project
#include "WatchdogControl.h"
#include "HSIDisplay.h"
#include "QGCDataPlot2D.h"
#include "QGCRemoteControlView.h"
#include "LogCompressor.h"
...
...
@@ -170,6 +171,7 @@ protected:
WatchdogControl
*
watchdogControl
;
HSIDisplay
*
hsi
;
QGCDataPlot2D
*
dataplot
;
QGCRemoteControlView
*
rcView
;
// Popup widgets
JoystickWidget
*
joystickWidget
;
...
...
src/ui/MapWidget.cc
View file @
61cafe14
...
...
@@ -190,11 +190,16 @@ MapWidget::MapWidget(QWidget *parent) :
this
,
SLOT
(
captureMapClick
(
const
QMouseEvent
*
,
const
QPointF
)));
connect
(
createPath
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
createPathButtonClicked
()));
this
,
SLOT
(
createPathButtonClicked
(
bool
)));
connect
(
geomLayer
,
SIGNAL
(
geometryClicked
(
Geometry
*
,
QPoint
)),
this
,
SLOT
(
captureGeometryClick
(
Geometry
*
,
QPoint
)));
connect
(
geomLayer
,
SIGNAL
(
geometryDragged
(
Geometry
*
,
QPointF
)),
this
,
SLOT
(
captureGeometryDrag
(
Geometry
*
,
QPointF
)));
connect
(
geomLayer
,
SIGNAL
(
geometryEndDrag
(
Geometry
*
,
QPointF
)),
this
,
SLOT
(
captureGeometryEndDrag
(
Geometry
*
,
QPointF
)));
// Configure the WP Path's pen
pointPen
=
new
QPen
(
QColor
(
0
,
255
,
0
));
...
...
@@ -290,12 +295,15 @@ void MapWidget::mapproviderSelected(QAction* action)
}
void
MapWidget
::
createPathButtonClicked
()
void
MapWidget
::
createPathButtonClicked
(
bool
checked
)
{
Q_UNUSED
(
checked
);
if
(
createPath
->
isChecked
())
{
// change the cursor shape
this
->
setCursor
(
Qt
::
PointingHandCursor
);
mc
->
setMouseMode
(
qmapcontrol
::
MapControl
::
None
);
// Clear the previous WP track
// TODO: Move this to an actual clear track button and add a warning dialog
...
...
@@ -303,8 +311,12 @@ void MapWidget::createPathButtonClicked()
wps
.
clear
();
path
->
setPoints
(
wps
);
mc
->
layer
(
"Waypoints"
)
->
addGeometry
(
path
);
wpIndex
.
clear
();
}
else
{
this
->
setCursor
(
Qt
::
ArrowCursor
);
mc
->
setMouseMode
(
qmapcontrol
::
MapControl
::
Panning
);
}
}
...
...
@@ -313,30 +325,55 @@ void MapWidget::createPathButtonClicked()
void
MapWidget
::
captureMapClick
(
const
QMouseEvent
*
event
,
const
QPointF
coordinate
){
if
(
QEvent
::
MouseButtonRelease
==
event
->
type
()
&&
createPath
->
isChecked
()){
// Create waypoint name
QString
str
;
str
=
QString
(
"WP%1"
).
arg
(
path
->
numberOfPoints
()
+
1
);
qDebug
()
<<
"Waypoint "
<<
str
;
qDebug
()
<<
"Lat: "
<<
coordinate
.
y
();
qDebug
()
<<
"Lon: "
<<
coordinate
.
x
();
str
=
QString
(
"WP%1"
).
arg
(
path
->
numberOfPoints
());
// create the WP and set everything in the LineString to display the path
mc
->
layer
(
"Waypoints"
)
->
addGeometry
(
new
CirclePoint
(
coordinate
.
x
(),
coordinate
.
y
(),
10
,
str
));
wps
.
append
(
new
Point
(
coordinate
.
x
(),
coordinate
.
y
(),
str
));
path
->
addPoint
(
new
Point
(
coordinate
.
x
(),
coordinate
.
y
(),
str
));
CirclePoint
*
tempCirclePoint
=
new
CirclePoint
(
coordinate
.
x
(),
coordinate
.
y
(),
10
,
str
);
mc
->
layer
(
"Waypoints"
)
->
addGeometry
(
tempCirclePoint
);
Point
*
tempPoint
=
new
Point
(
coordinate
.
x
(),
coordinate
.
y
(),
str
);
wps
.
append
(
tempPoint
);
path
->
addPoint
(
tempPoint
);
wpIndex
.
insert
(
str
,
tempPoint
);
// Refresh the screen
mc
->
updateRequestNew
();
}
}
void
MapWidget
::
captureGeometryClick
(
Geometry
*
geom
,
QPoint
point
){
Q_UNUSED
(
geom
);
Q_UNUSED
(
point
);
qDebug
()
<<
geom
->
name
();
qDebug
()
<<
geom
->
GeometryType
;
mc
->
setMouseMode
(
qmapcontrol
::
MapControl
::
None
);
}
void
MapWidget
::
captureGeometryDrag
(
Geometry
*
geom
,
QPointF
coordinate
){
Q_UNUSED
(
coordinate
);
Point
*
point2Find
;
point2Find
=
wpIndex
[
geom
->
name
()];
point2Find
->
setCoordinate
(
coordinate
);
point2Find
=
dynamic_cast
<
Point
*>
(
geom
);
point2Find
->
setCoordinate
(
coordinate
);
// Refresh the screen
mc
->
updateRequestNew
();
}
void
MapWidget
::
captureGeometryEndDrag
(
Geometry
*
geom
,
QPointF
coordinate
){
mc
->
setMouseMode
(
qmapcontrol
::
MapControl
::
Panning
);
// qDebug() << geom->name();
// qDebug() << geom->GeometryType;
// qDebug() << point;
}
MapWidget
::~
MapWidget
()
...
...
src/ui/MapWidget.h
View file @
61cafe14
...
...
@@ -89,7 +89,7 @@ protected:
qmapcontrol
::
Layer
*
overlay
;
///< Street overlay (foreground)
qmapcontrol
::
GeometryLayer
*
geomLayer
;
///< Layer for waypoints
int
zoomLevel
;
int
detailZoom
;
///< Steps zoomed in further than qMapControl allows
int
detailZoom
;
///< Steps zoomed in further than qMapControl allows
static
const
int
scrollStep
=
40
;
///< Scroll n pixels per keypress
static
const
int
maxZoom
=
50
;
///< Maximum zoom level
...
...
@@ -102,12 +102,19 @@ protected:
protected
slots
:
void
captureMapClick
(
const
QMouseEvent
*
event
,
const
QPointF
coordinate
);
void
createPathButtonClicked
();
void
createPathButtonClicked
(
bool
checked
);
void
captureGeometryClick
(
Geometry
*
,
QPoint
);
void
mapproviderSelected
(
QAction
*
action
);
void
captureGeometryDrag
(
Geometry
*
geom
,
QPointF
coordinate
);
void
captureGeometryEndDrag
(
Geometry
*
geom
,
QPointF
coordinate
);
signals:
void
movePoint
(
QPointF
newCoord
);
private:
Ui
::
MapWidget
*
m_ui
;
QList
<
Point
*>
wps
;
QHash
<
QString
,
Point
*>
wpIndex
;
LineString
*
path
;
QPen
*
pointPen
;
};
...
...
src/ui/QGCDataPlot2D.cc
View file @
61cafe14
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL 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/>.
======================================================================*/
/**
* @file
* @brief Implementation of QGCDataPlot2D
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#include <QFileDialog>
#include <QTemporaryFile>
...
...
src/ui/QGCFirmwareUpdate.cc
View file @
61cafe14
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL 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/>.
======================================================================*/
/**
* @file
* @brief Implementation of QGCFirmwareUpdate
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#include "QGCFirmwareUpdate.h"
#include "ui_QGCFirmwareUpdate.h"
...
...
src/ui/QGCPxImuFirmwareUpdate.cc
View file @
61cafe14
...
...
@@ -21,6 +21,13 @@ This file is part of the QGROUNDCONTROL project
======================================================================*/
/**
* @file
* @brief Implementation of QGCPxImuFirmwareUpdate
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#include "QGCPxImuFirmwareUpdate.h"
#include "ui_QGCPxImuFirmwareUpdate.h"
...
...
src/ui/QGCRemoteControlView.cc
0 → 100644
View file @
61cafe14
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL 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/>.
======================================================================*/
/**
* @file
* @brief Implementation of QGCRemoteControlView
* @author Lorenz Meier <mail@qgroundcontrol.org>
*/
#include <QGridLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QLabel>
#include <QProgressBar>
#include "QGCRemoteControlView.h"
#include "ui_QGCRemoteControlView.h"
#include "UASManager.h"
QGCRemoteControlView
::
QGCRemoteControlView
(
QWidget
*
parent
)
:
QWidget
(
parent
),
uasId
(
-
1
),
rssi
(
0.0
f
),
updated
(
false
),
channelLayout
(
new
QVBoxLayout
()),
ui
(
new
Ui
::
QGCRemoteControlView
)
{
//ui->setupUi(this);
QGridLayout
*
layout
=
new
QGridLayout
(
this
);
layout
->
addLayout
(
channelLayout
,
1
,
0
,
1
,
2
);
// Name label
nameLabel
=
new
QLabel
(
this
);
nameLabel
->
setText
(
"No MAV selected yet.."
);
layout
->
addWidget
(
nameLabel
,
0
,
0
,
1
,
2
);
// Add spacer left of button
layout
->
addItem
(
new
QSpacerItem
(
0
,
0
,
QSizePolicy
::
Expanding
,
QSizePolicy
::
Expanding
),
2
,
0
);
// Set stretch to maximize spacer, not button
layout
->
setColumnStretch
(
0
,
100
);
layout
->
setColumnStretch
(
1
,
1
);
// Calibrate button
QPushButton
*
calibrateButton
=
new
QPushButton
(
this
);
calibrateButton
->
setText
(
tr
(
"Calibrate"
));
// Connect to calibration slot
connect
(
calibrateButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
calibrate
()));
// Add button
layout
->
addWidget
(
calibrateButton
,
2
,
1
);
setVisible
(
false
);
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
int
)),
this
,
SLOT
(
setUASId
(
int
)));
}
QGCRemoteControlView
::~
QGCRemoteControlView
()
{
delete
ui
;
delete
channelLayout
;
}
void
QGCRemoteControlView
::
calibrate
()
{
// Run auto-calibration
}
void
QGCRemoteControlView
::
setUASId
(
int
id
)
{
if
(
uasId
!=
-
1
)
{
UASInterface
*
uas
=
UASManager
::
instance
()
->
getUASForId
(
id
);
if
(
uas
)
{
// The UAS exists, disconnect any existing connections
disconnect
(
uas
,
SIGNAL
(
remoteControlChannelChanged
(
int
,
float
,
float
)),
this
,
SLOT
(
setChannel
(
int
,
float
,
float
)));
}
}
// Connect the new UAS
UASInterface
*
newUAS
=
UASManager
::
instance
()
->
getUASForId
(
id
);
if
(
newUAS
)
{
// New UAS exists, connect
nameLabel
->
setText
(
QString
(
"RC Input of %1"
).
arg
(
newUAS
->
getUASName
()));
connect
(
newUAS
,
SIGNAL
(
remoteControlChannelChanged
(
int
,
float
,
float
)),
this
,
SLOT
(
setChannel
(
int
,
float
,
float
)));
}
}
void
QGCRemoteControlView
::
setChannel
(
int
channelId
,
float
raw
,
float
normalized
)
{
if
(
this
->
raw
.
size
()
<=
channelId
)
{
// This is a new channel, append it
this
->
raw
.
append
(
raw
);
this
->
normalized
.
append
(
normalized
);
appendChannelWidget
(
channelId
);
}
else
{
// This is an existing channel, update it
this
->
raw
[
channelId
]
=
raw
;
this
->
normalized
[
channelId
]
=
normalized
;
}
updated
=
true
;
// FIXME Will be timer based in the future
redraw
();
}
void
QGCRemoteControlView
::
setRemoteRSSI
(
float
rssiNormalized
)
{
rssi
=
rssiNormalized
;
updated
=
true
;
}
void
QGCRemoteControlView
::
appendChannelWidget
(
int
channelId
)
{
// Create new layout
QHBoxLayout
*
layout
=
new
QHBoxLayout
(
this
);
// Add content
layout
->
addWidget
(
new
QLabel
(
QString
(
"Channel %1"
).
arg
(
channelId
+
1
),
this
));
QLabel
*
raw
=
new
QLabel
(
this
);
// Append raw label
rawLabels
.
append
(
raw
);
layout
->
addWidget
(
raw
);
// Append progress bar
QProgressBar
*
normalized
=
new
QProgressBar
(
this
);
normalized
->
setMinimum
(
0
);
normalized
->
setMaximum
(
100
);
progressBars
.
append
(
normalized
);
layout
->
addWidget
(
normalized
);
channelLayout
->
addLayout
(
layout
);
}
void
QGCRemoteControlView
::
redraw
()
{
if
(
isVisible
()
&&
updated
)
{
// Update raw values
for
(
int
i
=
0
;
i
<
rawLabels
.
count
();
i
++
)
{
rawLabels
.
at
(
i
)
->
setText
(
QString
(
"%1 us"
).
arg
(
raw
.
at
(
i
)));
}
// Update percent bars
for
(
int
i
=
0
;
i
<
progressBars
.
count
();
i
++
)
{
progressBars
.
at
(
i
)
->
setValue
(
normalized
.
at
(
i
)
*
100.0
f
);
}
updated
=
false
;
}
}
void
QGCRemoteControlView
::
changeEvent
(
QEvent
*
e
)
{
QWidget
::
changeEvent
(
e
);
switch
(
e
->
type
())
{
case
QEvent
:
:
LanguageChange
:
ui
->
retranslateUi
(
this
);
break
;
default:
break
;
}
}
src/ui/QGCRemoteControlView.h
0 → 100644
View file @
61cafe14
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL 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/>.
======================================================================*/
/**
* @file
* @brief Declaration of QGCRemoteControlView
* @author Lorenz Meier <mail@qgroundcontrol.org>
*/
#ifndef QGCREMOTECONTROLVIEW_H
#define QGCREMOTECONTROLVIEW_H
#include <QWidget>
#include <QVector>
namespace
Ui
{
class
QGCRemoteControlView
;
}
class
QVBoxLayout
;
class
QLabel
;
class
QProgressBar
;
class
QGCRemoteControlView
:
public
QWidget
{
Q_OBJECT
public:
QGCRemoteControlView
(
QWidget
*
parent
=
0
);
~
QGCRemoteControlView
();
public
slots
:
void
setUASId
(
int
id
);
void
setChannel
(
int
channelId
,
float
raw
,
float
normalized
);
void
setRemoteRSSI
(
float
rssiNormalized
);
void
calibrate
();
void
redraw
();
protected
slots
:
void
appendChannelWidget
(
int
channelId
);
protected:
void
changeEvent
(
QEvent
*
e
);
int
uasId
;
float
rssi
;
bool
updated
;
QVBoxLayout
*
channelLayout
;
QVector
<
int
>
raw
;
QVector
<
float
>
normalized
;
QVector
<
QLabel
*>
rawLabels
;
QVector
<
QProgressBar
*>
progressBars
;
QLabel
*
nameLabel
;
private:
Ui
::
QGCRemoteControlView
*
ui
;
};
#endif // QGCREMOTECONTROLVIEW_H
src/ui/QGCRemoteControlView.ui
0 → 100644
View file @
61cafe14
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
QGCRemoteControlView
</class>
<widget
class=
"QWidget"
name=
"QGCRemoteControlView"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
400
</width>
<height>
300
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<widget
class=
"QPushButton"
name=
"pushButton"
>
<property
name=
"geometry"
>
<rect>
<x>
300
</x>
<y>
260
</y>
<width>
93
</width>
<height>
27
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Calibrate
</string>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"geometry"
>
<rect>
<x>
10
</x>
<y>
270
</y>
<width>
171
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Remote Control detected
</string>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"geometry"
>
<rect>
<x>
10
</x>
<y>
10
</y>
<width>
71
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Channel 1
</string>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"geometry"
>
<rect>
<x>
10
</x>
<y>
30
</y>
<width>
71
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Channel 2
</string>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"geometry"
>
<rect>
<x>
10
</x>
<y>
50
</y>
<width>
71
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Channel 3
</string>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_5"
>
<property
name=
"geometry"
>
<rect>
<x>
10
</x>
<y>
70
</y>
<width>
71
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Channel 4
</string>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_6"
>
<property
name=
"geometry"
>
<rect>
<x>
10
</x>
<y>
90
</y>
<width>
71
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Channel 5
</string>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_7"
>
<property
name=
"geometry"
>
<rect>
<x>
10
</x>
<y>
110
</y>
<width>
71
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Channel 6
</string>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_8"
>
<property
name=
"geometry"
>
<rect>
<x>
10
</x>
<y>
130
</y>
<width>
71
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Channel 7
</string>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_9"
>
<property
name=
"geometry"
>
<rect>
<x>
10
</x>
<y>
150
</y>
<width>
71
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Channel 8
</string>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_10"
>
<property
name=
"geometry"
>
<rect>
<x>
10
</x>
<y>
170
</y>
<width>
62
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
RSSI
</string>
</property>
</widget>
<widget
class=
"QProgressBar"
name=
"chan1ProgressBar"
>
<property
name=
"geometry"
>
<rect>
<x>
200
</x>
<y>
10
</y>
<width>
118
</width>
<height>
16
</height>
</rect>
</property>
<property
name=
"value"
>
<number>
24
</number>
</property>
</widget>
<widget
class=
"QProgressBar"
name=
"chan2ProgressBar"
>
<property
name=
"geometry"
>
<rect>
<x>
200
</x>
<y>
30
</y>
<width>
118
</width>
<height>
16
</height>
</rect>
</property>
<property
name=
"value"
>
<number>
24
</number>
</property>
</widget>
<widget
class=
"QProgressBar"
name=
"chan3ProgressBar"
>
<property
name=
"geometry"
>
<rect>
<x>
200
</x>
<y>
50
</y>
<width>
118
</width>
<height>
16
</height>
</rect>
</property>
<property
name=
"value"
>
<number>
24
</number>
</property>
</widget>
<widget
class=
"QProgressBar"
name=
"chan4ProgressBar"
>
<property
name=
"geometry"
>
<rect>
<x>
200
</x>
<y>
70
</y>
<width>
118
</width>
<height>
16
</height>
</rect>
</property>
<property
name=
"value"
>
<number>
24
</number>
</property>
</widget>
<widget
class=
"QProgressBar"
name=
"chan5ProgressBar"
>
<property
name=
"geometry"
>
<rect>
<x>
200
</x>
<y>
90
</y>
<width>
118
</width>
<height>
16
</height>
</rect>
</property>
<property
name=
"value"
>
<number>
24
</number>
</property>
</widget>
<widget
class=
"QProgressBar"
name=
"chan6ProgressBar"
>
<property
name=
"geometry"
>
<rect>
<x>
200
</x>
<y>
110
</y>
<width>
118
</width>
<height>
16
</height>
</rect>
</property>
<property
name=
"value"
>
<number>
24
</number>
</property>
</widget>
<widget
class=
"QProgressBar"
name=
"chan7ProgressBar"
>
<property
name=
"geometry"
>
<rect>
<x>
200
</x>
<y>
130
</y>
<width>
118
</width>
<height>
16
</height>
</rect>
</property>
<property
name=
"value"
>
<number>
24
</number>
</property>
</widget>
<widget
class=
"QProgressBar"
name=
"chan8ProgressBar"
>
<property
name=
"geometry"
>
<rect>
<x>
200
</x>
<y>
150
</y>
<width>
118
</width>
<height>
16
</height>
</rect>
</property>
<property
name=
"value"
>
<number>
24
</number>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_11"
>
<property
name=
"geometry"
>
<rect>
<x>
90
</x>
<y>
10
</y>
<width>
41
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
1120
</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>
src/ui/QGCSensorSettingsWidget.cc
View file @
61cafe14
...
...
@@ -21,6 +21,13 @@ This file is part of the QGROUNDCONTROL project
======================================================================*/
/**
* @file
* @brief Implementation of QGCSensorSettingsWidget
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#include "QGCSensorSettingsWidget.h"
#include "ui_QGCSensorSettingsWidget.h"
...
...
src/ui/SerialConfigurationWindow.cc
View file @
61cafe14
...
...
@@ -23,8 +23,7 @@ This file is part of the QGROUNDCONTROL project
/**
* @file
* @brief Implementation of configuration window for serial links
*
* @brief Implementation of SerialConfigurationWindow
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
...
...
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