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
d87add18
Commit
d87add18
authored
May 25, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compile fixes, added warning for log replay
parent
259403be
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
5 deletions
+41
-5
QGCMAVLinkLogPlayer.cc
src/ui/QGCMAVLinkLogPlayer.cc
+17
-0
QGCToolBar.cc
src/ui/QGCToolBar.cc
+16
-1
QGCToolBar.h
src/ui/QGCToolBar.h
+4
-0
Pixhawk3DWidget.cc
src/ui/map3D/Pixhawk3DWidget.cc
+4
-4
No files found.
src/ui/QGCMAVLinkLogPlayer.cc
View file @
d87add18
...
...
@@ -3,6 +3,7 @@
#include <QDesktopServices>
#include "MainWindow.h"
#include "SerialLink.h"
#include "QGCMAVLinkLogPlayer.h"
#include "QGC.h"
#include "ui_QGCMAVLinkLogPlayer.h"
...
...
@@ -361,6 +362,22 @@ bool QGCMAVLinkLogPlayer::loadLogFile(const QString& file)
// Reset current state
reset
(
0
);
// Check if a serial link is connected
bool
linkWarning
=
false
;
foreach
(
LinkInterface
*
link
,
LinkManager
::
instance
()
->
getLinks
())
{
SerialLink
*
s
=
dynamic_cast
<
SerialLink
*>
(
link
);
if
(
s
&&
s
->
isConnected
())
linkWarning
=
true
;
}
if
(
linkWarning
)
MainWindow
::
instance
()
->
showInfoMessage
(
tr
(
"Active MAVLink links found"
),
tr
(
"Currently other links are connected. It is recommended to disconnect any active link before replaying a log."
));
play
();
return
true
;
}
}
...
...
src/ui/QGCToolBar.cc
View file @
d87add18
...
...
@@ -46,6 +46,16 @@ QGCToolBar::QGCToolBar(QWidget *parent) :
// Do not load UI, wait for actions
}
void
QGCToolBar
::
globalPositionChanged
(
UASInterface
*
uas
,
double
lat
,
double
lon
,
double
alt
,
quint64
usec
)
{
Q_UNUSED
(
uas
);
Q_UNUSED
(
lat
);
Q_UNUSED
(
lon
);
Q_UNUSED
(
usec
);
altitudeMSL
=
alt
;
changed
=
true
;
}
void
QGCToolBar
::
heartbeatTimeout
(
bool
timeout
,
unsigned
int
ms
)
{
// set timeout label visible
...
...
@@ -281,6 +291,7 @@ void QGCToolBar::setActiveUAS(UASInterface* active)
disconnect
(
mav
,
SIGNAL
(
batteryChanged
(
UASInterface
*
,
double
,
double
,
int
)),
this
,
SLOT
(
updateBatteryRemaining
(
UASInterface
*
,
double
,
double
,
int
)));
disconnect
(
mav
,
SIGNAL
(
armingChanged
(
bool
)),
this
,
SLOT
(
updateArmingState
(
bool
)));
disconnect
(
mav
,
SIGNAL
(
heartbeatTimeout
(
bool
,
unsigned
int
)),
this
,
SLOT
(
heartbeatTimeout
(
bool
,
unsigned
int
)));
disconnect
(
active
,
SIGNAL
(
globalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
globalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
if
(
mav
->
getWaypointManager
())
{
disconnect
(
mav
->
getWaypointManager
(),
SIGNAL
(
currentWaypointChanged
(
quint16
)),
this
,
SLOT
(
updateCurrentWaypoint
(
quint16
)));
...
...
@@ -298,6 +309,7 @@ void QGCToolBar::setActiveUAS(UASInterface* active)
connect
(
active
,
SIGNAL
(
batteryChanged
(
UASInterface
*
,
double
,
double
,
int
)),
this
,
SLOT
(
updateBatteryRemaining
(
UASInterface
*
,
double
,
double
,
int
)));
connect
(
active
,
SIGNAL
(
armingChanged
(
bool
)),
this
,
SLOT
(
updateArmingState
(
bool
)));
connect
(
active
,
SIGNAL
(
heartbeatTimeout
(
bool
,
unsigned
int
)),
this
,
SLOT
(
heartbeatTimeout
(
bool
,
unsigned
int
)));
connect
(
active
,
SIGNAL
(
globalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
globalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
if
(
active
->
getWaypointManager
())
{
connect
(
active
->
getWaypointManager
(),
SIGNAL
(
currentWaypointChanged
(
quint16
)),
this
,
SLOT
(
updateCurrentWaypoint
(
quint16
)));
...
...
@@ -314,6 +326,7 @@ void QGCToolBar::setActiveUAS(UASInterface* active)
toolBarStateLabel
->
setText
(
mav
->
getShortState
());
toolBarTimeoutLabel
->
setStyleSheet
(
QString
(
""
));
toolBarTimeoutLabel
->
setText
(
""
);
toolBarDistLabel
->
setText
(
""
);
setSystemType
(
mav
,
mav
->
getSystemType
());
}
...
...
@@ -333,7 +346,9 @@ void QGCToolBar::updateArmingState(bool armed)
void
QGCToolBar
::
updateView
()
{
if
(
!
changed
)
return
;
toolBarDistLabel
->
setText
(
tr
(
"%1 m"
).
arg
(
wpDistance
,
6
,
'f'
,
2
,
'0'
));
//toolBarDistLabel->setText(tr("%1 m").arg(wpDistance, 6, 'f', 2, '0'));
// XXX add also rel altitude
toolBarDistLabel
->
setText
(
QString
(
"%1 m MSL"
).
arg
(
altitudeMSL
,
6
,
'f'
,
2
,
'0'
));
toolBarWpLabel
->
setText
(
tr
(
"WP%1"
).
arg
(
wpId
));
toolBarBatteryBar
->
setValue
(
batteryPercent
);
if
(
batteryPercent
<
30
&&
toolBarBatteryBar
->
value
()
>=
30
)
{
...
...
src/ui/QGCToolBar.h
View file @
d87add18
...
...
@@ -74,6 +74,8 @@ public slots:
void
updateView
();
/** @brief Update connection timeout time */
void
heartbeatTimeout
(
bool
timeout
,
unsigned
int
ms
);
/** @brief Update global position */
void
globalPositionChanged
(
UASInterface
*
uas
,
double
lat
,
double
lon
,
double
alt
,
quint64
usec
);
/** @brief Create or connect link */
void
connectLink
(
bool
connect
);
/** @brief Clear status string */
...
...
@@ -106,6 +108,8 @@ protected:
float
batteryVoltage
;
int
wpId
;
double
wpDistance
;
float
altitudeMSL
;
float
altitudeRel
;
QString
state
;
QString
mode
;
QString
systemName
;
...
...
src/ui/map3D/Pixhawk3DWidget.cc
View file @
d87add18
...
...
@@ -834,7 +834,7 @@ Pixhawk3DWidget::moveWaypointPosition(void)
return
;
}
const
Q
Vector
<
Waypoint
*>
waypoints
=
const
Q
List
<
Waypoint
*>
waypoints
=
mActiveUAS
->
getWaypointManager
()
->
getWaypointEditableList
();
Waypoint
*
waypoint
=
waypoints
.
at
(
mSelectedWpIndex
);
...
...
@@ -882,7 +882,7 @@ Pixhawk3DWidget::moveWaypointHeading(void)
return
;
}
const
Q
Vector
<
Waypoint
*>
waypoints
=
const
Q
List
<
Waypoint
*>
waypoints
=
mActiveUAS
->
getWaypointManager
()
->
getWaypointEditableList
();
Waypoint
*
waypoint
=
waypoints
.
at
(
mSelectedWpIndex
);
...
...
@@ -929,7 +929,7 @@ Pixhawk3DWidget::setWaypointAltitude(void)
}
bool
ok
;
const
Q
Vector
<
Waypoint
*>
waypoints
=
const
Q
List
<
Waypoint
*>
waypoints
=
mActiveUAS
->
getWaypointManager
()
->
getWaypointEditableList
();
Waypoint
*
waypoint
=
waypoints
.
at
(
mSelectedWpIndex
);
...
...
@@ -960,7 +960,7 @@ Pixhawk3DWidget::clearAllWaypoints(void)
{
if
(
mActiveUAS
)
{
const
Q
Vector
<
Waypoint
*>
waypoints
=
const
Q
List
<
Waypoint
*>
waypoints
=
mActiveUAS
->
getWaypointManager
()
->
getWaypointEditableList
();
for
(
int
i
=
waypoints
.
size
()
-
1
;
i
>=
0
;
--
i
)
{
...
...
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