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
26122dca
Commit
26122dca
authored
Aug 12, 2011
by
lm
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-mac' of github.com:pixhawk/qgroundcontrol into v10release
parents
1827000b
e2261020
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
28 deletions
+32
-28
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+8
-8
UAS.cc
src/uas/UAS.cc
+9
-19
QGCToolBar.cc
src/ui/QGCToolBar.cc
+12
-0
QGCToolBar.h
src/ui/QGCToolBar.h
+3
-1
No files found.
src/comm/MAVLinkProtocol.cc
View file @
26122dca
...
@@ -183,14 +183,14 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
...
@@ -183,14 +183,14 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
unsigned
int
decodeState
=
mavlink_parse_char
(
link
->
getId
(),
(
uint8_t
)(
b
.
at
(
position
)),
&
message
,
&
status
);
unsigned
int
decodeState
=
mavlink_parse_char
(
link
->
getId
(),
(
uint8_t
)(
b
.
at
(
position
)),
&
message
,
&
status
);
if
(
decodeState
==
1
)
{
if
(
decodeState
==
1
)
{
#ifdef MAVLINK_MESSAGE_LENGTHS
//
#ifdef MAVLINK_MESSAGE_LENGTHS
const
uint8_t
message_lengths
[]
=
MAVLINK_MESSAGE_LENGTHS
;
//
const uint8_t message_lengths[] = MAVLINK_MESSAGE_LENGTHS;
if
(
message
.
msgid
>=
sizeof
(
message_lengths
)
||
//
if (message.msgid >= sizeof(message_lengths) ||
message
.
len
!=
message_lengths
[
message
.
msgid
])
{
//
message.len != message_lengths[message.msgid]) {
qDebug
()
<<
"MAVLink message "
<<
message
.
msgid
<<
" length incorrect (was "
<<
message
.
len
<<
" expected "
<<
message_lengths
[
message
.
msgid
]
<<
")"
;
//
qDebug() << "MAVLink message " << message.msgid << " length incorrect (was " << message.len << " expected " << message_lengths[message.msgid] << ")";
continue
;
//
continue;
}
//
}
#endif
//
#endif
// Log data
// Log data
if
(
m_loggingEnabled
&&
m_logfile
)
{
if
(
m_loggingEnabled
&&
m_logfile
)
{
const
int
len
=
MAVLINK_MAX_PACKET_LEN
+
sizeof
(
quint64
);
const
int
len
=
MAVLINK_MAX_PACKET_LEN
+
sizeof
(
quint64
);
...
...
src/uas/UAS.cc
View file @
26122dca
...
@@ -827,26 +827,16 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
...
@@ -827,26 +827,16 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
case
MAVLINK_MSG_ID_DEBUG
:
case
MAVLINK_MSG_ID_DEBUG
:
emit
valueChanged
(
uasId
,
QString
(
"debug "
)
+
QString
::
number
(
mavlink_msg_debug_get_ind
(
&
message
)),
"raw"
,
mavlink_msg_debug_get_value
(
&
message
),
MG
::
TIME
::
getGroundTimeNow
());
emit
valueChanged
(
uasId
,
QString
(
"debug "
)
+
QString
::
number
(
mavlink_msg_debug_get_ind
(
&
message
)),
"raw"
,
mavlink_msg_debug_get_value
(
&
message
),
MG
::
TIME
::
getGroundTimeNow
());
break
;
break
;
case
MAVLINK_MSG_ID_
ATTITUDE_CONTROLLER_OUTPU
T
:
case
MAVLINK_MSG_ID_
ROLL_PITCH_YAW_THRUST_SETPOIN
T
:
{
{
mavlink_attitude_controller_output_t
out
;
mavlink_roll_pitch_yaw_thrust_setpoint_t
out
;
mavlink_msg_attitude_controller_output_decode
(
&
message
,
&
out
);
mavlink_msg_roll_pitch_yaw_thrust_setpoint_decode
(
&
message
,
&
out
);
quint64
time
=
MG
::
TIME
::
getGroundTimeNowUsecs
();
quint64
time
=
getUnixTime
(
out
.
time_ms
*
1000
);
emit
attitudeThrustSetPointChanged
(
this
,
out
.
roll
/
127.0
f
,
out
.
pitch
/
127.0
f
,
out
.
yaw
/
127.0
f
,
(
uint8_t
)
out
.
thrust
,
time
);
emit
attitudeThrustSetPointChanged
(
this
,
out
.
roll
,
out
.
pitch
,
out
.
yaw
,
out
.
thrust
,
time
);
emit
valueChanged
(
uasId
,
"att control roll"
,
"raw"
,
out
.
roll
,
time
/
1000.0
f
);
emit
valueChanged
(
uasId
,
"att control roll"
,
"rad"
,
out
.
roll
,
time
);
emit
valueChanged
(
uasId
,
"att control pitch"
,
"raw"
,
out
.
pitch
,
time
/
1000.0
f
);
emit
valueChanged
(
uasId
,
"att control pitch"
,
"rad"
,
out
.
pitch
,
time
);
emit
valueChanged
(
uasId
,
"att control yaw"
,
"raw"
,
out
.
yaw
,
time
/
1000.0
f
);
emit
valueChanged
(
uasId
,
"att control yaw"
,
"rad"
,
out
.
yaw
,
time
);
}
emit
valueChanged
(
uasId
,
"att control thrust"
,
"0-1"
,
out
.
thrust
,
time
);
break
;
case
MAVLINK_MSG_ID_POSITION_CONTROLLER_OUTPUT
:
{
mavlink_position_controller_output_t
out
;
mavlink_msg_position_controller_output_decode
(
&
message
,
&
out
);
quint64
time
=
MG
::
TIME
::
getGroundTimeNow
();
//emit positionSetPointsChanged(uasId, out.x/127.0f, out.y/127.0f, out.z/127.0f, out.yaw, time);
emit
valueChanged
(
uasId
,
"pos control x"
,
"raw"
,
out
.
x
,
time
);
emit
valueChanged
(
uasId
,
"pos control y"
,
"raw"
,
out
.
y
,
time
);
emit
valueChanged
(
uasId
,
"pos control z"
,
"raw"
,
out
.
z
,
time
);
}
}
break
;
break
;
case
MAVLINK_MSG_ID_WAYPOINT_COUNT
:
case
MAVLINK_MSG_ID_WAYPOINT_COUNT
:
...
...
src/ui/QGCToolBar.cc
View file @
26122dca
...
@@ -55,6 +55,7 @@ void QGCToolBar::setActiveUAS(UASInterface* active)
...
@@ -55,6 +55,7 @@ void QGCToolBar::setActiveUAS(UASInterface* active)
disconnect
(
mav
,
SIGNAL
(
modeChanged
(
int
,
QString
,
QString
)),
this
,
SLOT
(
updateMode
(
int
,
QString
,
QString
)));
disconnect
(
mav
,
SIGNAL
(
modeChanged
(
int
,
QString
,
QString
)),
this
,
SLOT
(
updateMode
(
int
,
QString
,
QString
)));
disconnect
(
mav
,
SIGNAL
(
nameChanged
(
QString
)),
this
,
SLOT
(
updateName
(
QString
)));
disconnect
(
mav
,
SIGNAL
(
nameChanged
(
QString
)),
this
,
SLOT
(
updateName
(
QString
)));
disconnect
(
mav
,
SIGNAL
(
systemTypeSet
(
UASInterface
*
,
uint
)),
this
,
SLOT
(
setSystemType
(
UASInterface
*
,
uint
)));
disconnect
(
mav
,
SIGNAL
(
systemTypeSet
(
UASInterface
*
,
uint
)),
this
,
SLOT
(
setSystemType
(
UASInterface
*
,
uint
)));
disconnect
(
mav
,
SIGNAL
(
textMessageReceived
(
int
,
int
,
int
,
QString
)),
this
,
SLOT
(
receiveTextMessage
(
int
,
int
,
int
,
QString
)));
}
}
// Connect new system
// Connect new system
...
@@ -63,6 +64,7 @@ void QGCToolBar::setActiveUAS(UASInterface* active)
...
@@ -63,6 +64,7 @@ void QGCToolBar::setActiveUAS(UASInterface* active)
connect
(
active
,
SIGNAL
(
modeChanged
(
int
,
QString
,
QString
)),
this
,
SLOT
(
updateMode
(
int
,
QString
,
QString
)));
connect
(
active
,
SIGNAL
(
modeChanged
(
int
,
QString
,
QString
)),
this
,
SLOT
(
updateMode
(
int
,
QString
,
QString
)));
connect
(
active
,
SIGNAL
(
nameChanged
(
QString
)),
this
,
SLOT
(
updateName
(
QString
)));
connect
(
active
,
SIGNAL
(
nameChanged
(
QString
)),
this
,
SLOT
(
updateName
(
QString
)));
connect
(
active
,
SIGNAL
(
systemTypeSet
(
UASInterface
*
,
uint
)),
this
,
SLOT
(
setSystemType
(
UASInterface
*
,
uint
)));
connect
(
active
,
SIGNAL
(
systemTypeSet
(
UASInterface
*
,
uint
)),
this
,
SLOT
(
setSystemType
(
UASInterface
*
,
uint
)));
connect
(
active
,
SIGNAL
(
textMessageReceived
(
int
,
int
,
int
,
QString
)),
this
,
SLOT
(
receiveTextMessage
(
int
,
int
,
int
,
QString
)));
// Update all values once
// Update all values once
nameLabel
->
setText
(
mav
->
getUASName
());
nameLabel
->
setText
(
mav
->
getUASName
());
...
@@ -81,6 +83,7 @@ void QGCToolBar::createCustomWidgets()
...
@@ -81,6 +83,7 @@ void QGCToolBar::createCustomWidgets()
stateLabel
=
new
QLabel
(
"------"
,
this
);
stateLabel
=
new
QLabel
(
"------"
,
this
);
wpLabel
=
new
QLabel
(
"---"
,
this
);
wpLabel
=
new
QLabel
(
"---"
,
this
);
distlabel
=
new
QLabel
(
"--- ---- m"
,
this
);
distlabel
=
new
QLabel
(
"--- ---- m"
,
this
);
messageLabel
=
new
QLabel
(
"No system messages."
,
this
);
//symbolButton->setIcon(":");
//symbolButton->setIcon(":");
symbolButton
->
setStyleSheet
(
"QWidget { background-color: #050508; color: #DDDDDF; background-clip: border; } QToolButton { font-weight: bold; font-size: 12px; border: 0px solid #999999; border-radius: 5px; min-width:22px; max-width: 22px; min-height: 22px; max-height: 22px; padding: 0px; margin: 0px; background-color: none; }"
);
symbolButton
->
setStyleSheet
(
"QWidget { background-color: #050508; color: #DDDDDF; background-clip: border; } QToolButton { font-weight: bold; font-size: 12px; border: 0px solid #999999; border-radius: 5px; min-width:22px; max-width: 22px; min-height: 22px; max-height: 22px; padding: 0px; margin: 0px; background-color: none; }"
);
addWidget
(
symbolButton
);
addWidget
(
symbolButton
);
...
@@ -89,6 +92,7 @@ void QGCToolBar::createCustomWidgets()
...
@@ -89,6 +92,7 @@ void QGCToolBar::createCustomWidgets()
addWidget
(
stateLabel
);
addWidget
(
stateLabel
);
addWidget
(
wpLabel
);
addWidget
(
wpLabel
);
addWidget
(
distlabel
);
addWidget
(
distlabel
);
addWidget
(
messageLabel
);
toggleLoggingAction
=
new
QAction
(
QIcon
(
":"
),
"Start Logging"
,
this
);
toggleLoggingAction
=
new
QAction
(
QIcon
(
":"
),
"Start Logging"
,
this
);
logReplayAction
=
new
QAction
(
QIcon
(
":"
),
"Start Replay"
,
this
);
logReplayAction
=
new
QAction
(
QIcon
(
":"
),
"Start Replay"
,
this
);
...
@@ -154,6 +158,14 @@ void QGCToolBar::setSystemType(UASInterface* uas, unsigned int systemType)
...
@@ -154,6 +158,14 @@ void QGCToolBar::setSystemType(UASInterface* uas, unsigned int systemType)
}
}
}
}
void
QGCToolBar
::
receiveTextMessage
(
int
uasid
,
int
componentid
,
int
severity
,
QString
text
)
{
Q_UNUSED
(
uasid
);
Q_UNUSED
(
componentid
);
Q_UNUSED
(
severity
);
messageLabel
->
setText
(
text
);
}
QGCToolBar
::~
QGCToolBar
()
QGCToolBar
::~
QGCToolBar
()
{
{
delete
toggleLoggingAction
;
delete
toggleLoggingAction
;
...
...
src/ui/QGCToolBar.h
View file @
26122dca
...
@@ -50,6 +50,8 @@ public slots:
...
@@ -50,6 +50,8 @@ public slots:
void
updateName
(
const
QString
&
name
);
void
updateName
(
const
QString
&
name
);
/** @brief Set the MAV system type */
/** @brief Set the MAV system type */
void
setSystemType
(
UASInterface
*
uas
,
unsigned
int
systemType
);
void
setSystemType
(
UASInterface
*
uas
,
unsigned
int
systemType
);
/** @brief Received system text message */
void
receiveTextMessage
(
int
uasid
,
int
componentid
,
int
severity
,
QString
text
);
protected:
protected:
void
createCustomWidgets
();
void
createCustomWidgets
();
...
@@ -63,7 +65,7 @@ protected:
...
@@ -63,7 +65,7 @@ protected:
QLabel
*
stateLabel
;
QLabel
*
stateLabel
;
QLabel
*
wpLabel
;
QLabel
*
wpLabel
;
QLabel
*
distlabel
;
QLabel
*
distlabel
;
QLabel
*
messageLabel
;
};
};
#endif // QGCTOOLBAR_H
#endif // QGCTOOLBAR_H
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