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
de6731dd
Commit
de6731dd
authored
Feb 11, 2011
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor naming changes to MAVLink enum end
parent
76cfbbb9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
36 deletions
+57
-36
qgroundcontrol.pri
qgroundcontrol.pri
+11
-11
Waypoint.cc
src/Waypoint.cc
+5
-5
Waypoint.h
src/Waypoint.h
+4
-4
MAVLinkXMLParser.cc
src/comm/MAVLinkXMLParser.cc
+5
-4
UASWaypointManager.cc
src/uas/UASWaypointManager.cc
+2
-2
QGCParamWidget.cc
src/ui/QGCParamWidget.cc
+22
-2
WaypointView.cc
src/ui/WaypointView.cc
+8
-8
No files found.
qgroundcontrol.pri
View file @
de6731dd
...
...
@@ -47,35 +47,35 @@ DEFINES += _TTY_NOWARN_
# MAC OS X
macx {
COMPILER_VERSION = $$system(gcc -v)
#
COMPILER_VERSION = $$system(gcc -v)
#message(Using compiler $$COMPILER_VERSION)
CONFIG += x86 cocoa phonon
CONFIG -= x86_64
HARDWARE_PLATFORM = $$system(uname -a)
contains( $$HARDWARE_PLATFORM, "9.6.0" ) || contains( $$HARDWARE_PLATFORM, "9.7.0" ) || contains( $$HARDWARE_PLATFORM, "9.8.0" ) || contains( $$HARDWARE_PLATFORM, "9.9.0" ) {
#
HARDWARE_PLATFORM = $$system(uname -a)
#
contains( $$HARDWARE_PLATFORM, "9.6.0" ) || contains( $$HARDWARE_PLATFORM, "9.7.0" ) || contains( $$HARDWARE_PLATFORM, "9.8.0" ) || contains( $$HARDWARE_PLATFORM, "9.9.0" ) {
# x86 Mac OS X Leopard 10.5 and earlier
#message(Building for Mac OS X 32bit/Leopard 10.5 and earlier)
# Enable function-profiling with the OS X saturn tool
debug {
#
debug {
#QMAKE_CXXFLAGS += -finstrument-functions
#LIBS += -lSaturn
CONFIG += console
}
} else {
#
CONFIG += console
#
}
#
} else {
# x64 Mac OS X Snow Leopard 10.6 and later
CONFIG += x86_64 x86 cocoa phonon
#
CONFIG += x86_64 x86 cocoa phonon
#CONFIG -= x86 # phonon
#message(Building for Mac OS X 64bit/Snow Leopard 10.6 and later)
debug {
#
debug {
#QMAKE_CXXFLAGS += -finstrument-functions
#LIBS += -lSaturn
CONFIG += console
}
}
#
}
#
}
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
...
...
src/Waypoint.cc
View file @
de6731dd
...
...
@@ -32,7 +32,7 @@ This file is part of the QGROUNDCONTROL project
#include "Waypoint.h"
#include <QStringList>
Waypoint
::
Waypoint
(
quint16
_id
,
double
_x
,
double
_y
,
double
_z
,
double
_yaw
,
bool
_autocontinue
,
bool
_current
,
double
_orbit
,
int
_holdTime
,
MAV_FRAME
_frame
,
MAV_C
OMMAN
D
_action
)
Waypoint
::
Waypoint
(
quint16
_id
,
double
_x
,
double
_y
,
double
_z
,
double
_yaw
,
bool
_autocontinue
,
bool
_current
,
double
_orbit
,
int
_holdTime
,
MAV_FRAME
_frame
,
MAV_C
M
D
_action
)
:
id
(
_id
),
x
(
_x
),
y
(
_y
),
...
...
@@ -75,7 +75,7 @@ bool Waypoint::load(QTextStream &loadStream)
{
this
->
id
=
wpParams
[
0
].
toInt
();
this
->
frame
=
(
MAV_FRAME
)
wpParams
[
1
].
toInt
();
this
->
action
=
(
MAV_C
OMMAN
D
)
wpParams
[
2
].
toInt
();
this
->
action
=
(
MAV_C
M
D
)
wpParams
[
2
].
toInt
();
this
->
param1
=
wpParams
[
3
].
toDouble
();
this
->
param2
=
wpParams
[
4
].
toDouble
();
this
->
orbit
=
wpParams
[
5
].
toDouble
();
...
...
@@ -136,14 +136,14 @@ void Waypoint::setYaw(double yaw)
void
Waypoint
::
setAction
(
int
action
)
{
if
(
this
->
action
!=
(
MAV_C
OMMAN
D
)
action
)
if
(
this
->
action
!=
(
MAV_C
M
D
)
action
)
{
this
->
action
=
(
MAV_C
OMMAN
D
)
action
;
this
->
action
=
(
MAV_C
M
D
)
action
;
emit
changed
(
this
);
}
}
void
Waypoint
::
setAction
(
MAV_C
OMMAN
D
action
)
void
Waypoint
::
setAction
(
MAV_C
M
D
action
)
{
if
(
this
->
action
!=
action
)
{
...
...
src/Waypoint.h
View file @
de6731dd
...
...
@@ -45,7 +45,7 @@ class Waypoint : public QObject
public:
Waypoint
(
quint16
id
=
0
,
double
x
=
0
.
0
f
,
double
y
=
0
.
0
f
,
double
z
=
0
.
0
f
,
double
yaw
=
0
.
0
f
,
bool
autocontinue
=
false
,
bool
current
=
false
,
double
orbit
=
0
.
15
f
,
int
holdTime
=
0
,
MAV_FRAME
frame
=
MAV_FRAME_GLOBAL
,
MAV_C
OMMAN
D
action
=
MAV_CMD_NAV_WAYPOINT
);
MAV_FRAME
frame
=
MAV_FRAME_GLOBAL
,
MAV_C
M
D
action
=
MAV_CMD_NAV_WAYPOINT
);
~
Waypoint
();
quint16
getId
()
const
{
return
id
;
}
...
...
@@ -67,7 +67,7 @@ public:
double
getParam7
()
const
{
return
z
;
}
int
getTurns
()
const
{
return
param1
;
}
MAV_FRAME
getFrame
()
const
{
return
frame
;
}
MAV_C
OMMAN
D
getAction
()
const
{
return
action
;
}
MAV_C
M
D
getAction
()
const
{
return
action
;
}
const
QString
&
getName
()
const
{
return
name
;
}
void
save
(
QTextStream
&
saveStream
);
...
...
@@ -81,7 +81,7 @@ protected:
double
z
;
double
yaw
;
MAV_FRAME
frame
;
MAV_C
OMMAN
D
action
;
MAV_C
M
D
action
;
bool
autocontinue
;
bool
current
;
double
orbit
;
...
...
@@ -98,7 +98,7 @@ public slots:
void
setYaw
(
double
yaw
);
/** @brief Set the waypoint action */
void
setAction
(
int
action
);
void
setAction
(
MAV_C
OMMAN
D
action
);
void
setAction
(
MAV_C
M
D
action
);
void
setFrame
(
MAV_FRAME
frame
);
void
setAutocontinue
(
bool
autoContinue
);
void
setCurrent
(
bool
current
);
...
...
src/comm/MAVLinkXMLParser.cc
View file @
de6731dd
...
...
@@ -247,11 +247,11 @@ bool MAVLinkXMLParser::generate()
// Everything sane, starting with enum content
currEnum
=
"enum "
+
enumName
.
toUpper
()
+
"
\n
{
\n
"
;
currEnumEnd
=
QString
(
"
\
n
%1_ENUM_END
\n
};
\n\n
"
).
arg
(
enumName
.
toUpper
());
currEnumEnd
=
QString
(
"
\
t
%1_ENUM_END
\n
};
\n\n
"
).
arg
(
enumName
.
toUpper
());
int
nextEnumValue
=
0
;
// Get the
message
fields
// Get the
enum
fields
QDomNode
f
=
e
.
firstChild
();
while
(
!
f
.
isNull
())
{
...
...
@@ -298,8 +298,9 @@ bool MAVLinkXMLParser::generate()
}
// Add the last parsed enum
// Remove the last comma, as the last value has none
int
commaPosition
=
currEnum
.
lastIndexOf
(
","
);
currEnum
.
remove
(
commaPosition
,
1
);
// ENUM END MARKER IS LAST ENTRY, COMMA REMOVAL NOT NEEDED
//int commaPosition = currEnum.lastIndexOf(",");
//currEnum.remove(commaPosition, 1);
enums
+=
"/** @brief "
+
comment
+
" */
\n
"
+
currEnum
+
currEnumEnd
;
}
// Element is non-zero and element name is <enum>
...
...
src/uas/UASWaypointManager.cc
View file @
de6731dd
...
...
@@ -138,8 +138,8 @@ void UASWaypointManager::handleWaypoint(quint8 systemId, quint8 compId, mavlink_
if
(
wp
->
seq
==
current_wp_id
)
{
qDebug
()
<<
"Got WP: "
<<
wp
->
seq
<<
wp
->
x
<<
wp
->
y
<<
wp
->
z
<<
wp
->
param4
<<
"auto:"
<<
wp
->
autocontinue
<<
"curr:"
<<
wp
->
current
<<
wp
->
param1
<<
wp
->
param2
<<
(
MAV_FRAME
)
wp
->
frame
<<
(
MAV_C
OMMAN
D
)
wp
->
command
;
Waypoint
*
lwp
=
new
Waypoint
(
wp
->
seq
,
wp
->
x
,
wp
->
y
,
wp
->
z
,
wp
->
param4
,
wp
->
autocontinue
,
wp
->
current
,
wp
->
param1
,
wp
->
param2
,
(
MAV_FRAME
)
wp
->
frame
,
(
MAV_C
OMMAN
D
)
wp
->
command
);
qDebug
()
<<
"Got WP: "
<<
wp
->
seq
<<
wp
->
x
<<
wp
->
y
<<
wp
->
z
<<
wp
->
param4
<<
"auto:"
<<
wp
->
autocontinue
<<
"curr:"
<<
wp
->
current
<<
wp
->
param1
<<
wp
->
param2
<<
(
MAV_FRAME
)
wp
->
frame
<<
(
MAV_C
M
D
)
wp
->
command
;
Waypoint
*
lwp
=
new
Waypoint
(
wp
->
seq
,
wp
->
x
,
wp
->
y
,
wp
->
z
,
wp
->
param4
,
wp
->
autocontinue
,
wp
->
current
,
wp
->
param1
,
wp
->
param2
,
(
MAV_FRAME
)
wp
->
frame
,
(
MAV_C
M
D
)
wp
->
command
);
addWaypoint
(
lwp
,
false
);
//get next waypoint
...
...
src/ui/QGCParamWidget.cc
View file @
de6731dd
...
...
@@ -179,7 +179,21 @@ void QGCParamWidget::addParameter(int uas, int component, QString parameterName,
// Get component
if
(
!
components
->
contains
(
component
))
{
addComponent
(
uas
,
component
,
"Component #"
+
QString
::
number
(
component
));
QString
componentName
;
switch
(
component
)
{
case
MAV_COMP_ID_CAMERA
:
componentName
=
tr
(
"Camera (#%1)"
).
arg
(
component
);
break
;
case
MAV_COMP_ID_IMU
:
componentName
=
tr
(
"IMU (#%1)"
).
arg
(
component
);
break
;
default:
componentName
=
tr
(
"Component #"
).
arg
(
component
);
break
;
}
addComponent
(
uas
,
component
,
componentName
);
}
// Replace value in map
...
...
@@ -227,7 +241,9 @@ void QGCParamWidget::addParameter(int uas, int component, QString parameterName,
QStringList
plist
;
plist
.
append
(
parameterName
);
plist
.
append
(
QString
::
number
(
value
));
// CREATE PARAMETER ITEM
parameterItem
=
new
QTreeWidgetItem
(
plist
);
// CONFIGURE PARAMETER ITEM
compParamGroups
->
value
(
parent
)
->
addChild
(
parameterItem
);
parameterItem
->
setFlags
(
parameterItem
->
flags
()
|
Qt
::
ItemIsEditable
);
...
...
@@ -256,7 +272,9 @@ void QGCParamWidget::addParameter(int uas, int component, QString parameterName,
QStringList
plist
;
plist
.
append
(
parameterName
);
plist
.
append
(
QString
::
number
(
value
));
// CREATE PARAMETER ITEM
parameterItem
=
new
QTreeWidgetItem
(
plist
);
// CONFIGURE PARAMETER ITEM
components
->
value
(
component
)
->
addChild
(
parameterItem
);
parameterItem
->
setFlags
(
parameterItem
->
flags
()
|
Qt
::
ItemIsEditable
);
...
...
@@ -356,7 +374,9 @@ void QGCParamWidget::saveParameters()
QMap
<
QString
,
float
>::
iterator
j
;
for
(
j
=
comp
->
begin
();
j
!=
comp
->
end
();
++
j
)
{
in
<<
mav
->
getUASID
()
<<
"
\t
"
<<
compid
<<
"
\t
"
<<
j
.
key
()
<<
"
\t
"
<<
j
.
value
()
<<
"
\n
"
;
QString
paramValue
(
"%1"
);
paramValue
=
paramValue
.
arg
(
j
.
value
(),
18
,
'g'
);
in
<<
mav
->
getUASID
()
<<
"
\t
"
<<
compid
<<
"
\t
"
<<
j
.
key
()
<<
"
\t
"
<<
paramValue
<<
"
\n
"
;
in
.
flush
();
}
}
...
...
src/ui/WaypointView.cc
View file @
de6731dd
...
...
@@ -42,7 +42,7 @@ WaypointView::WaypointView(Waypoint* wp, QWidget* parent) :
m_ui
->
comboBox_action
->
addItem
(
tr
(
"Loiter Turns"
),
MAV_CMD_NAV_LOITER_TURNS
);
m_ui
->
comboBox_action
->
addItem
(
tr
(
"Return to Launch"
),
MAV_CMD_NAV_RETURN_TO_LAUNCH
);
m_ui
->
comboBox_action
->
addItem
(
tr
(
"Land"
),
MAV_CMD_NAV_LAND
);
m_ui
->
comboBox_action
->
addItem
(
tr
(
"Other"
),
MAV_C
OMMAN
D_ENUM_END
);
m_ui
->
comboBox_action
->
addItem
(
tr
(
"Other"
),
MAV_C
M
D_ENUM_END
);
// m_ui->comboBox_action->addItem(tr("Delay"), MAV_ACTION_DELAY_BEFORE_COMMAND);
// m_ui->comboBox_action->addItem(tr("Ascend/Descent"), MAV_ACTION_ASCEND_AT_RATE);
// m_ui->comboBox_action->addItem(tr("Change Mode"), MAV_ACTION_CHANGE_MODE);
...
...
@@ -226,9 +226,9 @@ void WaypointView::changedAction(int index)
{
// set waypoint action
int
actionIndex
=
m_ui
->
comboBox_action
->
itemData
(
index
).
toUInt
();
if
(
actionIndex
<
MAV_C
OMMAN
D_ENUM_END
&&
actionIndex
>=
0
)
if
(
actionIndex
<
MAV_C
M
D_ENUM_END
&&
actionIndex
>=
0
)
{
MAV_C
OMMAND
action
=
(
MAV_COMMAN
D
)
actionIndex
;
MAV_C
MD
action
=
(
MAV_CM
D
)
actionIndex
;
wp
->
setAction
(
action
);
}
...
...
@@ -245,14 +245,14 @@ void WaypointView::changedAction(int index)
case
MAV_CMD_NAV_LOITER_UNLIM
:
case
MAV_CMD_NAV_LOITER_TURNS
:
case
MAV_CMD_NAV_LOITER_TIME
:
case
MAV_CMD_
NAV
_DELAY
:
case
MAV_CMD_
SYS
_SET_MODE
:
case
MAV_CMD_
CONDITION
_DELAY
:
case
MAV_CMD_
DO
_SET_MODE
:
// Back to global frame
if
(
wp
->
getFrame
()
==
MAV_FRAME_MISSION
)
changedFrame
(
0
);
// Update view
updateActionView
(
actionIndex
);
break
;
case
MAV_C
OMMAN
D_ENUM_END
:
case
MAV_C
M
D_ENUM_END
:
default:
// Switch to mission frame
changedFrame
(
MAV_FRAME_MISSION
);
...
...
@@ -411,12 +411,12 @@ void WaypointView::updateValues()
}
// Update action
MAV_C
OMMAN
D
action
=
wp
->
getAction
();
MAV_C
M
D
action
=
wp
->
getAction
();
int
action_index
=
m_ui
->
comboBox_action
->
findData
(
action
);
// Set to "Other" action if it was -1
if
(
action_index
==
-
1
)
{
action_index
=
m_ui
->
comboBox_action
->
findData
(
MAV_C
OMMAN
D_ENUM_END
);
action_index
=
m_ui
->
comboBox_action
->
findData
(
MAV_C
M
D_ENUM_END
);
}
// Only update if changed
if
(
m_ui
->
comboBox_action
->
currentIndex
()
!=
action_index
)
...
...
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