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
9b1804a8
Commit
9b1804a8
authored
May 22, 2013
by
Bryant
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/mavlink/qgroundcontrol
into restyling
parents
fdcb5567
8432278f
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
61 additions
and
73 deletions
+61
-73
UAS.cc
src/uas/UAS.cc
+3
-4
DebugConsole.cc
src/ui/DebugConsole.cc
+19
-4
DebugConsole.h
src/ui/DebugConsole.h
+4
-0
HDDisplay.cc
src/ui/HDDisplay.cc
+4
-2
HSIDisplay.cc
src/ui/HSIDisplay.cc
+2
-0
MainWindow.cc
src/ui/MainWindow.cc
+11
-50
MainWindow.ui
src/ui/MainWindow.ui
+1
-0
QGCWaypointListMulti.cc
src/ui/QGCWaypointListMulti.cc
+6
-0
UASInfoWidget.cc
src/ui/uas/UASInfoWidget.cc
+6
-13
UASListWidget.cc
src/ui/uas/UASListWidget.cc
+5
-0
No files found.
src/uas/UAS.cc
View file @
9b1804a8
...
...
@@ -1148,13 +1148,12 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
case
MAVLINK_MSG_ID_STATUSTEXT
:
{
QByteArray
b
;
b
.
resize
(
MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN
);
b
.
resize
(
MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN
+
1
);
mavlink_msg_statustext_get_text
(
&
message
,
b
.
data
());
//b.append('\0');
// Ensure NUL-termination
b
[
b
.
length
()
-
1
]
=
'\0'
;
QString
text
=
QString
(
b
);
int
severity
=
mavlink_msg_statustext_get_severity
(
&
message
);
//qDebug() << "RECEIVED STATUS:" << text;false
//emit statusTextReceived(severity, text);
if
(
text
.
startsWith
(
"#audio:"
))
{
...
...
src/ui/DebugConsole.cc
View file @
9b1804a8
...
...
@@ -93,14 +93,23 @@ DebugConsole::DebugConsole(QWidget *parent) :
// Update measurements the first time
updateTrafficMeasurements
();
// First connect management slots, then make sure to add all existing objects
// Connect to link manager to get notified about new links
connect
(
LinkManager
::
instance
(),
SIGNAL
(
newLink
(
LinkInterface
*
)),
this
,
SLOT
(
addLink
(
LinkInterface
*
)));
// Connect to UAS manager to get notified about new UAS
connect
(
UASManager
::
instance
(),
SIGNAL
(
UASCreated
(
UASInterface
*
)),
this
,
SLOT
(
uasCreated
(
UASInterface
*
)));
// Get a list of all existing links
links
=
QList
<
LinkInterface
*>
();
foreach
(
LinkInterface
*
link
,
LinkManager
::
instance
()
->
getLinks
())
{
addLink
(
link
);
}
// Connect to link manager to get notified about new links
connect
(
LinkManager
::
instance
(),
SIGNAL
(
newLink
(
LinkInterface
*
)),
this
,
SLOT
(
addLink
(
LinkInterface
*
)));
// Get a list of all existing UAS
foreach
(
UASInterface
*
uas
,
UASManager
::
instance
()
->
getUASList
())
{
uasCreated
(
uas
);
}
// Connect link combo box
connect
(
m_ui
->
linkComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
linkSelected
(
int
)));
// Connect send button
...
...
@@ -169,6 +178,12 @@ void DebugConsole::storeSettings()
//qDebug() << "Storing settings!";
}
void
DebugConsole
::
uasCreated
(
UASInterface
*
uas
)
{
connect
(
uas
,
SIGNAL
(
textMessageReceived
(
int
,
int
,
int
,
QString
)),
this
,
SLOT
(
receiveTextMessage
(
int
,
int
,
int
,
QString
)),
Qt
::
UniqueConnection
);
}
/**
* Add a link to the debug console output
*/
...
...
@@ -183,8 +198,8 @@ void DebugConsole::addLink(LinkInterface* link)
linkSelected
(
m_ui
->
linkComboBox
->
currentIndex
());
// Register for name changes
connect
(
link
,
SIGNAL
(
nameChanged
(
QString
)),
this
,
SLOT
(
updateLinkName
(
QString
)));
connect
(
link
,
SIGNAL
(
deleteLink
(
LinkInterface
*
const
)),
this
,
SLOT
(
removeLink
(
LinkInterface
*
const
)));
connect
(
link
,
SIGNAL
(
nameChanged
(
QString
)),
this
,
SLOT
(
updateLinkName
(
QString
))
,
Qt
::
UniqueConnection
);
connect
(
link
,
SIGNAL
(
deleteLink
(
LinkInterface
*
const
)),
this
,
SLOT
(
removeLink
(
LinkInterface
*
const
))
,
Qt
::
UniqueConnection
);
}
void
DebugConsole
::
removeLink
(
LinkInterface
*
const
linkInterface
)
...
...
src/ui/DebugConsole.h
View file @
9b1804a8
...
...
@@ -45,6 +45,8 @@ namespace Ui
class
DebugConsole
;
}
class
UASInterface
;
/**
* @brief Shows a debug console
*
...
...
@@ -61,6 +63,8 @@ public:
public
slots
:
/** @brief Add a link to the list of monitored links */
void
addLink
(
LinkInterface
*
link
);
/** @brief Add a UAS to the list of monitored UAS */
void
uasCreated
(
UASInterface
*
uas
);
/** @brief Remove a link from the list */
void
removeLink
(
LinkInterface
*
const
link
);
/** @brief Update a link name */
...
...
src/ui/HDDisplay.cc
View file @
9b1804a8
...
...
@@ -128,8 +128,8 @@ HDDisplay::HDDisplay(QStringList* plotList, QString title, QWidget *parent) :
if
(
font
.
family
()
!=
fontFamilyName
)
qDebug
()
<<
"ERROR! Font not loaded: "
<<
fontFamilyName
;
// Connect with UAS
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
)));
//start(
);
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
))
,
Qt
::
UniqueConnection
);
setActiveUAS
(
UASManager
::
instance
()
->
getActiveUAS
()
);
}
HDDisplay
::~
HDDisplay
()
...
...
@@ -476,6 +476,8 @@ void HDDisplay::renderOverlay()
*/
void
HDDisplay
::
setActiveUAS
(
UASInterface
*
uas
)
{
if
(
!
uas
)
return
;
// Disconnect any previously connected active UAS
if
(
this
->
uas
!=
NULL
)
{
removeSource
(
this
->
uas
);
...
...
src/ui/HSIDisplay.cc
View file @
9b1804a8
...
...
@@ -178,6 +178,8 @@ HSIDisplay::HSIDisplay(QWidget *parent) :
connect
(
&
statusClearTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
clearStatusMessage
()));
statusClearTimer
.
start
(
3000
);
setActiveUAS
(
UASManager
::
instance
()
->
getActiveUAS
());
setFocusPolicy
(
Qt
::
StrongFocus
);
}
...
...
src/ui/MainWindow.cc
View file @
9b1804a8
...
...
@@ -1682,43 +1682,17 @@ void MainWindow::UASCreated(UASInterface* uas)
break
;
}
// XXX The multi-UAS selection menu has been disabled for now,
// its redundant with right-clicking the UAS in the list.
// this code piece might be removed later if this is the final
// conclusion (May 2013)
// QAction* uasAction = new QAction(icon, tr("Select %1 for control").arg(uas->getUASName()), ui.menuConnected_Systems);
// connect(uas, SIGNAL(systemRemoved()), uasAction, SLOT(deleteLater()));
// connect(uasAction, SIGNAL(triggered()), uas, SLOT(setSelected()));
connect
(
uas
,
SIGNAL
(
systemSpecsChanged
(
int
)),
this
,
SLOT
(
UASSpecsChanged
(
int
)));
// ui.menuConnected_Systems->addAction(uasAction);
// FIXME Should be not inside the mainwindow
if
(
debugConsoleDockWidget
)
{
DebugConsole
*
debugConsole
=
dynamic_cast
<
DebugConsole
*>
(
debugConsoleDockWidget
->
widget
());
if
(
debugConsole
)
{
connect
(
uas
,
SIGNAL
(
textMessageReceived
(
int
,
int
,
int
,
QString
)),
debugConsole
,
SLOT
(
receiveTextMessage
(
int
,
int
,
int
,
QString
)));
}
}
// Health / System status indicator
if
(
infoDockWidget
)
{
UASInfoWidget
*
infoWidget
=
dynamic_cast
<
UASInfoWidget
*>
(
infoDockWidget
->
widget
());
if
(
infoWidget
)
{
infoWidget
->
addUAS
(
uas
);
}
}
// UAS List
if
(
listDockWidget
)
{
UASListWidget
*
listWidget
=
dynamic_cast
<
UASListWidget
*>
(
listDockWidget
->
widget
());
if
(
listWidget
)
{
listWidget
->
addUAS
(
uas
);
}
}
connect
(
uas
,
SIGNAL
(
systemSpecsChanged
(
int
)),
this
,
SLOT
(
UASSpecsChanged
(
int
)));
// HIL
showHILConfigurationWidget
(
uas
);
...
...
@@ -1730,25 +1704,12 @@ void MainWindow::UASCreated(UASInterface* uas)
}
// Line chart
//if (!linechartWidget)
//{
// Center widgets
//linechartWidget->addSystem(uas);
linechartWidget
->
addSource
(
mavlinkDecoder
);
//addCentralWidget(linechartWidget, tr("Realtime Plot"));
if
(
dataView
->
centralWidget
()
!=
linechartWidget
)
{
dataView
->
setCentralWidget
(
linechartWidget
);
linechartWidget
->
show
();
}
//dataView->setCentralWidget(linechartWidget);
//linechartWidget->show();
//}
linechartWidget
->
addSource
(
mavlinkDecoder
);
if
(
dataView
->
centralWidget
()
!=
linechartWidget
)
{
dataView
->
setCentralWidget
(
linechartWidget
);
linechartWidget
->
show
();
}
// Load default custom widgets for this autopilot type
loadCustomWidgetsFromDefaults
(
uas
->
getSystemTypeName
(),
uas
->
getAutopilotTypeName
());
...
...
src/ui/MainWindow.ui
View file @
9b1804a8
...
...
@@ -81,6 +81,7 @@
</property>
<addaction
name=
"actionNewCustomWidget"
/>
<addaction
name=
"actionLoadCustomWidgetFile"
/>
<addaction
name=
"separator"
/>
</widget>
<widget
class=
"QMenu"
name=
"menuHelp"
>
<property
name=
"title"
>
...
...
src/ui/QGCWaypointListMulti.cc
View file @
9b1804a8
...
...
@@ -15,6 +15,12 @@ QGCWaypointListMulti::QGCWaypointListMulti(QWidget *parent) :
WaypointList
*
list
=
new
WaypointList
(
ui
->
stackedWidget
,
NULL
);
lists
.
insert
(
offline_uas_id
,
list
);
ui
->
stackedWidget
->
addWidget
(
list
);
if
(
UASManager
::
instance
()
->
getActiveUAS
())
{
systemCreated
(
UASManager
::
instance
()
->
getActiveUAS
());
systemSetActive
(
UASManager
::
instance
()
->
getActiveUAS
()
->
getUASID
());
}
}
void
QGCWaypointListMulti
::
systemDeleted
(
QObject
*
uas
)
...
...
src/ui/uas/UASInfoWidget.cc
View file @
9b1804a8
...
...
@@ -34,7 +34,7 @@ This file is part of the PIXHAWK project
#include <float.h>
#include <UASInfoWidget.h>
#include <UASManager.h>
#include <
MG
.h>
#include <
QGC
.h>
#include <QTimer>
#include <QDir>
#include <cstdlib>
...
...
@@ -46,20 +46,12 @@ UASInfoWidget::UASInfoWidget(QWidget *parent, QString name) : QWidget(parent)
{
ui
.
setupUi
(
this
);
this
->
name
=
name
;
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
)));
activeUAS
=
NULL
;
//instruments = new QMap<QString, QProgressBar*>();
// Set default battery type
// setBattery(0, LIPOLY, 3);
startTime
=
MG
::
TIME
::
getGroundTimeNow
();
// startVoltage = 0.0f;
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
)));
setActiveUAS
(
UASManager
::
instance
()
->
getActiveUAS
());
// lastChargeLevel = 0.5f;
// lastRemainingTime = 1;
startTime
=
QGC
::
groundTimeMilliseconds
();
// Set default values
/** Set two voltage decimals and zero charge level decimals **/
...
...
@@ -117,7 +109,8 @@ void UASInfoWidget::addUAS(UASInterface* uas)
void
UASInfoWidget
::
setActiveUAS
(
UASInterface
*
uas
)
{
activeUAS
=
uas
;
if
(
uas
)
activeUAS
=
uas
;
}
void
UASInfoWidget
::
updateBattery
(
UASInterface
*
uas
,
double
voltage
,
double
percent
,
int
seconds
)
...
...
src/ui/uas/UASListWidget.cc
View file @
9b1804a8
...
...
@@ -67,6 +67,11 @@ UASListWidget::UASListWidget(QWidget *parent) : QWidget(parent), m_ui(new Ui::UA
this
->
setVisible
(
false
);
connect
(
UASManager
::
instance
(),
SIGNAL
(
UASCreated
(
UASInterface
*
)),
this
,
SLOT
(
addUAS
(
UASInterface
*
)));
// Get a list of all existing UAS
foreach
(
UASInterface
*
uas
,
UASManager
::
instance
()
->
getUASList
())
{
addUAS
(
uas
);
}
}
UASListWidget
::~
UASListWidget
()
...
...
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