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
359f8bd1
Commit
359f8bd1
authored
Jul 11, 2013
by
Bill Bonney
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
APMToolbar as a docking widget [complete] + missing files
parent
a01da581
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
229 additions
and
53 deletions
+229
-53
qgroundcontrol.pro
qgroundcontrol.pro
+1
-0
ApmToolBar.qml
qml/ApmToolBar.qml
+63
-10
Button.qml
qml/components/Button.qml
+1
-1
SerialLink.cc
src/comm/SerialLink.cc
+18
-13
SerialLink.h
src/comm/SerialLink.h
+1
-1
CommConfigurationWindow.cc
src/ui/CommConfigurationWindow.cc
+1
-1
MainWindow.cc
src/ui/MainWindow.cc
+47
-14
MainWindow.h
src/ui/MainWindow.h
+1
-1
MainWindow.ui
src/ui/MainWindow.ui
+5
-1
apmtoolbar.cpp
src/ui/apmtoolbar.cpp
+82
-9
apmtoolbar.h
src/ui/apmtoolbar.h
+9
-2
No files found.
qgroundcontrol.pro
View file @
359f8bd1
...
...
@@ -778,6 +778,7 @@ OTHER_FILES += \
OTHER_FILES
+=
\
qml
/
ApmToolBar
.
qml
\
qml
/
components
/
Button
.
qml
\
qml
/
components
/
TextButton
.
qml
\
qml
/
resources
/
apmplanner
/
toolbar
/
connect
.
png
\
qml
/
resources
/
apmplanner
/
toolbar
/
flightplanner
.
png
\
qml
/
resources
/
apmplanner
/
toolbar
/
helpwizard
.
png
\
...
...
qml/ApmToolBar.qml
View file @
359f8bd1
...
...
@@ -4,21 +4,46 @@ import "./components"
Rectangle
{
id
:
toolbar
width
:
parent
.
width
property
alias
backgroundColor
:
toolbar
.
color
property
alias
linkNameLabel
:
linkDevice
.
label
property
alias
baudrateLabel
:
baudrate
.
label
width
:
1024
<
parent
.
width
?
1024
:
parent
.
width
height
:
72
color
:
"
black
"
border.color
:
"
black
"
Connections
{
target
:
globalObj
onMAVConnected
:
{
console
.
log
(
"
Change Connection
"
+
connected
)
if
(
connect
){
console
.
log
(
"
connected
"
)
// connectButton.image = "./resources/apmplanner/toolbar/disconnect.png"
}
else
{
console
.
log
(
"
disconnected
"
)
// connectButton.image = "./resources/apmplanner/toolbar/connect.png"
}
}
}
Row
{
anchors.left
:
parent
.
left
spacing
:
2
Rectangle
{
width
:
5
height
:
parent
.
height
color
:
"
black
"
}
Button
{
id
:
flightDataView
label
:
"
FLIGHT DATA
"
image
:
"
./resources/apmplanner/toolbar/flightdata.png
"
onClicked
:
{
globalObj
.
select
FlightView
()
globalObj
.
trigger
FlightView
()
}
}
...
...
@@ -26,7 +51,7 @@ Rectangle {
id
:
flightPlanView
label
:
"
FLIGHT PLAN
"
image
:
"
./resources/apmplanner/toolbar/flightplanner.png
"
onClicked
:
globalObj
.
select
FlightPlanView
()
onClicked
:
globalObj
.
trigger
FlightPlanView
()
}
Button
{
...
...
@@ -34,7 +59,7 @@ Rectangle {
label
:
"
HARDWARE
"
image
:
"
./resources/apmplanner/toolbar/hardwareconfig.png
"
margins
:
8
onClicked
:
globalObj
.
select
HardwareView
()
onClicked
:
globalObj
.
trigger
HardwareView
()
}
Button
{
...
...
@@ -42,34 +67,62 @@ Rectangle {
label
:
"
SOFTWARE
"
image
:
"
./resources/apmplanner/toolbar/softwareconfig.png
"
margins
:
8
onClicked
:
globalObj
.
select
SoftwareView
()
onClicked
:
globalObj
.
trigger
SoftwareView
()
}
Button
{
id
:
simualtionView
label
:
"
SIMULATION
"
image
:
"
./resources/apmplanner/toolbar/simulation.png
"
onClicked
:
globalObj
.
select
SimulationView
()
onClicked
:
globalObj
.
trigger
SimulationView
()
}
Button
{
id
:
terminalView
label
:
"
TERMINAL
"
image
:
"
./resources/apmplanner/toolbar/terminal.png
"
onClicked
:
globalObj
.
select
TerminalView
()
onClicked
:
globalObj
.
trigger
TerminalView
()
}
}
Row
{
anchors.
lef
t
:
parent
.
right
anchors.
righ
t
:
parent
.
right
spacing
:
2
TextButton
{
id
:
linkDevice
label
:
"
none
"
minWidth
:
100
onClicked
:
globalObj
.
showConnectionDialog
()
}
TextButton
{
id
:
baudrate
label
:
"
none
"
minWidth
:
100
onClicked
:
globalObj
.
showConnectionDialog
()
}
Rectangle
{
width
:
5
height
:
parent
.
height
color
:
"
black
"
}
Button
{
id
:
connectButton
label
:
"
CONNECT
"
image
:
"
./resources/apmplanner/toolbar/connect.png
"
onClicked
:
globalObj
.
connect
()
onClicked
:
globalObj
.
connectMAV
()
}
Rectangle
{
anchors.right
:
parent
.
right
width
:
5
height
:
parent
.
height
color
:
"
black
"
}
}
}
qml/components/Button.qml
View file @
359f8bd1
...
...
@@ -38,7 +38,7 @@ Rectangle {
signal
buttonClick
()
onButtonClick
:
{
console
.
log
(
buttonLabel
.
text
+
"
clicked
.
"
)
console
.
log
(
buttonLabel
.
text
+
"
clicked
calling signal
"
)
clicked
()
}
...
...
src/comm/SerialLink.cc
View file @
359f8bd1
...
...
@@ -27,14 +27,18 @@ SerialLink::SerialLink(QString portname, int baudRate, bool hardwareFlowControl,
m_stopp
(
false
),
m_reqReset
(
false
)
{
qDebug
()
<<
"create SerialLink "
<<
portname
<<
baudRate
<<
hardwareFlowControl
<<
parity
<<
dataBits
<<
stopBits
;
// Setup settings
m_portName
=
portname
.
trimmed
();
if
(
m_portName
==
""
&&
getCurrentPorts
()
->
size
()
>
0
)
{
m_portName
=
m_ports
->
first
().
trimmed
();
m_portName
=
m_ports
->
first
().
trimmed
();
}
qDebug
()
<<
"m_portName "
<<
m_portName
;
// Set unique ID and add link to the list of links
m_id
=
getNextLinkId
();
...
...
@@ -61,14 +65,15 @@ SerialLink::SerialLink(QString portname, int baudRate, bool hardwareFlowControl,
m_stopBits
=
stopBits
;
// Set the port name
if
(
m_portName
==
""
)
{
m_name
=
tr
(
"Serial Link "
)
+
QString
::
number
(
getId
());
}
else
{
m_name
=
portname
.
trimmed
();
}
// if (m_portName == "")
// {
// m_name = tr("Serial Link ") + QString::number(getId());
// }
// else
// {
// m_name = portname.trimmed();
// }
loadSettings
();
}
void
SerialLink
::
requestReset
()
...
...
@@ -187,7 +192,7 @@ void SerialLink::run()
m_bitsReceivedTotal
+=
readData
.
length
()
*
8
;
}
}
else
{
qDebug
()
<<
"readyReadTime #"
<<
__LINE__
;
//
qDebug() << "readyReadTime #"<< __LINE__;
}
...
...
@@ -460,7 +465,7 @@ int SerialLink::getId()
QString
SerialLink
::
getName
()
{
return
m_
n
ame
;
return
m_
portN
ame
;
}
/**
...
...
@@ -695,11 +700,11 @@ bool SerialLink::setPortName(QString portName)
if
((
portName
!=
m_portName
)
&&
(
portName
.
trimmed
().
length
()
>
0
))
{
m_portName
=
portName
.
trimmed
();
m_name
=
tr
(
"serial port "
)
+
portName
.
trimmed
();
// [TODO] Do we need this?
//
m_name = tr("serial port ") + portName.trimmed(); // [TODO] Do we need this?
if
(
m_port
)
m_port
->
setPortName
(
portName
);
emit
nameChanged
(
m_
n
ame
);
// [TODO] maybe we can eliminate this
emit
nameChanged
(
m_
portN
ame
);
// [TODO] maybe we can eliminate this
return
accepted
;
}
return
false
;
...
...
src/comm/SerialLink.h
View file @
359f8bd1
...
...
@@ -148,7 +148,7 @@ protected:
int
m_stopBits
;
int
m_parity
;
QString
m_portName
;
QString
m_name
;
//
QString m_name;
int
m_timeout
;
int
m_id
;
...
...
src/ui/CommConfigurationWindow.cc
View file @
359f8bd1
...
...
@@ -55,7 +55,7 @@ This file is part of the QGROUNDCONTROL project
#include "LinkManager.h"
#include "MainWindow.h"
CommConfigurationWindow
::
CommConfigurationWindow
(
LinkInterface
*
link
,
ProtocolInterface
*
protocol
,
QWidget
*
parent
)
:
QWidget
(
NULL
)
CommConfigurationWindow
::
CommConfigurationWindow
(
LinkInterface
*
link
,
ProtocolInterface
*
protocol
,
QWidget
*
parent
)
:
QWidget
(
parent
)
{
this
->
link
=
link
;
...
...
src/ui/MainWindow.cc
View file @
359f8bd1
...
...
@@ -181,15 +181,6 @@ MainWindow::MainWindow(QWidget *parent):
actions
<<
ui
.
actionSoftwareConfig
;
toolBar
->
setPerspectiveChangeActions
(
actions
);
// We only want one of these.
apmToolBar
=
new
APMToolBar
(
this
);
apmToolBar
->
setFlightViewAction
(
ui
.
actionFlightView
);
apmToolBar
->
setFlightPlanViewAction
(
ui
.
actionMissionView
);
apmToolBar
->
setHardwareViewAction
(
ui
.
actionHardwareConfig
);
apmToolBar
->
setSoftwareViewAction
(
ui
.
actionSoftwareConfig
);
apmToolBar
->
setSimulationViewAction
(
ui
.
actionSimulation_View
);
apmToolBar
->
setTerminalViewAction
(
ui
.
actionSimulation_View
);
// Add actions for advanced users (displayed in dropdown under "advanced")
QList
<
QAction
*>
advancedActions
;
advancedActions
<<
ui
.
actionSimulation_View
;
...
...
@@ -200,8 +191,6 @@ MainWindow::MainWindow(QWidget *parent):
setStatusBar
(
customStatusBar
);
statusBar
()
->
setSizeGripEnabled
(
true
);
emit
initStatusChanged
(
"Building common widgets."
);
buildCommonWidgets
();
...
...
@@ -616,9 +605,17 @@ void MainWindow::buildCommonWidgets()
createDockWidget
(
pilotView
,
new
PrimaryFlightDisplay
(
320
,
240
,
this
),
tr
(
"Primary Flight Display"
),
"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET"
,
VIEW_FLIGHT
,
Qt
::
LeftDockWidgetArea
,
this
->
width
()
/
1.8
);
// Add Our new 'toolbar'
qDebug
()
<<
"width"
<<
this
->
width
();
// Create the APM Toolbar
APMToolBar
*
apmToolBar
=
new
APMToolBar
(
this
);
apmToolBar
->
setFlightViewAction
(
ui
.
actionFlightView
);
apmToolBar
->
setFlightPlanViewAction
(
ui
.
actionMissionView
);
apmToolBar
->
setHardwareViewAction
(
ui
.
actionHardwareConfig
);
apmToolBar
->
setSoftwareViewAction
(
ui
.
actionSoftwareConfig
);
apmToolBar
->
setSimulationViewAction
(
ui
.
actionSimulation_View
);
apmToolBar
->
setTerminalViewAction
(
ui
.
actionSimulation_View
);
createDockWidget
(
pilotView
,
apmToolBar
,
tr
(
"APM Tool Bar"
),
"APM_TOOLBAR_DOCKWIDGET"
,
VIEW_FLIGHT
,
Qt
::
TopDockWidgetArea
,
this
->
width
(),
70
);
QGCTabbedInfoView
*
infoview
=
new
QGCTabbedInfoView
(
this
);
infoview
->
addSource
(
mavlinkDecoder
);
createDockWidget
(
pilotView
,
infoview
,
tr
(
"Info View"
),
"UAS_INFO_INFOVIEW_DOCKWIDGET"
,
VIEW_FLIGHT
,
Qt
::
LeftDockWidgetArea
);
...
...
@@ -864,7 +861,15 @@ void MainWindow::loadDockWidget(QString name)
else
if
(
name
==
"APM_TOOLBAR_DOCKWIDGET"
)
{
// Add Our new 'toolbar'
createDockWidget
(
centerStack
->
currentWidget
(),
apmToolBar
,
tr
(
"APM Tool Bar"
),
"APM_TOOLBAR_DOCKWIDGET"
,
VIEW_FLIGHT
,
Qt
::
TopDockWidgetArea
,
this
->
width
(),
70
);
// Create the APM Toolbar
APMToolBar
*
apmToolBar
=
new
APMToolBar
(
this
);
apmToolBar
->
setFlightViewAction
(
ui
.
actionFlightView
);
apmToolBar
->
setFlightPlanViewAction
(
ui
.
actionMissionView
);
apmToolBar
->
setHardwareViewAction
(
ui
.
actionHardwareConfig
);
apmToolBar
->
setSoftwareViewAction
(
ui
.
actionSoftwareConfig
);
apmToolBar
->
setSimulationViewAction
(
ui
.
actionSimulation_View
);
apmToolBar
->
setTerminalViewAction
(
ui
.
actionSimulation_View
);
createDockWidget
(
centerStack
->
currentWidget
(),
apmToolBar
,
tr
(
"APM Tool Bar"
),
"APM_TOOLBAR_DOCKWIDGET"
,
currentView
,
Qt
::
TopDockWidgetArea
,
this
->
width
(),
70
);
}
else
{
...
...
@@ -1651,6 +1656,29 @@ void MainWindow::addLink()
}
}
bool
MainWindow
::
configLink
(
LinkInterface
*
link
)
{
// Go searching for this link's configuration window
QList
<
QAction
*>
actions
=
ui
.
menuNetwork
->
actions
();
bool
found
(
false
);
const
int32_t
&
linkIndex
(
LinkManager
::
instance
()
->
getLinks
().
indexOf
(
link
));
const
int32_t
&
linkID
(
LinkManager
::
instance
()
->
getLinks
()[
linkIndex
]
->
getId
());
foreach
(
QAction
*
action
,
actions
)
{
if
(
action
->
data
().
toInt
()
==
linkID
)
{
// LinkManager::instance()->getLinks().indexOf(link)
found
=
true
;
action
->
trigger
();
// Show the Link Config Dialog
}
}
return
found
;
}
void
MainWindow
::
addLink
(
LinkInterface
*
link
)
{
// IMPORTANT! KEEP THESE TWO LINES
...
...
@@ -1680,7 +1708,7 @@ void MainWindow::addLink(LinkInterface *link)
if
(
!
found
)
{
// || udp
CommConfigurationWindow
*
commWidget
=
new
CommConfigurationWindow
(
link
,
mavlink
,
this
);
CommConfigurationWindow
*
commWidget
=
new
CommConfigurationWindow
(
link
,
mavlink
,
NULL
);
commsWidgetList
.
append
(
commWidget
);
connect
(
commWidget
,
SIGNAL
(
destroyed
(
QObject
*
)),
this
,
SLOT
(
commsWidgetDestroyed
(
QObject
*
)));
QAction
*
action
=
commWidget
->
getAction
();
...
...
@@ -1696,6 +1724,11 @@ void MainWindow::addLink(LinkInterface *link)
}
}
}
//void MainWindow::configLink(LinkInterface *link)
//{
//}
void
MainWindow
::
commsWidgetDestroyed
(
QObject
*
obj
)
{
if
(
commsWidgetList
.
contains
(
obj
))
...
...
src/ui/MainWindow.h
View file @
359f8bd1
...
...
@@ -151,6 +151,7 @@ public slots:
/** @brief Add a communication link */
void
addLink
();
void
addLink
(
LinkInterface
*
link
);
bool
configLink
(
LinkInterface
*
link
);
void
configure
();
/** @brief Set the currently controlled UAS */
void
setActiveUAS
(
UASInterface
*
uas
);
...
...
@@ -404,7 +405,6 @@ protected:
QPointer
<
QGCToolBar
>
toolBar
;
QPointer
<
QGCStatusBar
>
customStatusBar
;
QPointer
<
APMToolBar
>
apmToolBar
;
QPointer
<
DebugConsole
>
debugConsole
;
...
...
src/ui/MainWindow.ui
View file @
359f8bd1
...
...
@@ -284,7 +284,7 @@
</property>
<property
name=
"icon"
>
<iconset
resource=
"../../qgroundcontrol.qrc"
>
<normaloff>
:/files/images/
status/weather-overcast.svg
</normaloff>
:/files/images/status/weather-overcas
t.svg
</iconset>
<normaloff>
:/files/images/
categories/applications-internet.svg
</normaloff>
:/files/images/categories/applications-interne
t.svg
</iconset>
</property>
<property
name=
"text"
>
<string>
Mission
</string>
...
...
@@ -496,6 +496,10 @@
</property>
</action>
<action
name=
"actionSoftwareConfig"
>
<property
name=
"icon"
>
<iconset
resource=
"../../qgroundcontrol.qrc"
>
<normaloff>
:/files/images/categories/applications-system.svg
</normaloff>
:/files/images/categories/applications-system.svg
</iconset>
</property>
<property
name=
"text"
>
<string>
Software
</string>
</property>
...
...
src/ui/apmtoolbar.cpp
View file @
359f8bd1
#include <QDebug>
#include <QDeclarativeContext>
#include <QGraphicsObject>
#include "LinkManager.h"
#include "MainWindow.h"
#include "apmtoolbar.h"
APMToolBar
::
APMToolBar
(
QWidget
*
parent
)
:
APMToolBar
::
APMToolBar
(
QWidget
*
parent
)
:
QDeclarativeView
(
parent
)
{
// Configure our QML object
this
->
rootContext
()
->
setContextProperty
(
"globalObj"
,
this
);
setSource
(
QUrl
::
fromLocalFile
(
"qml/ApmToolBar.qml"
));
setResizeMode
(
QDeclarativeView
::
SizeRootObjectToView
);
QObject
*
root
=
rootObject
();
connect
(
LinkManager
::
instance
(),
SIGNAL
(
newLink
(
LinkInterface
*
)),
this
,
SLOT
(
updateLinkDisplay
(
LinkInterface
*
)));
}
void
APMToolBar
::
setFlightViewAction
(
QAction
*
action
)
{
connect
(
this
,
SIGNAL
(
select
FlightView
()),
action
,
SIGNAL
(
triggered
()));
connect
(
this
,
SIGNAL
(
trigger
FlightView
()),
action
,
SIGNAL
(
triggered
()));
}
void
APMToolBar
::
setFlightPlanViewAction
(
QAction
*
action
)
{
connect
(
this
,
SIGNAL
(
select
FlightPlanView
()),
action
,
SIGNAL
(
triggered
()));
connect
(
this
,
SIGNAL
(
trigger
FlightPlanView
()),
action
,
SIGNAL
(
triggered
()));
}
void
APMToolBar
::
setHardwareViewAction
(
QAction
*
action
)
{
connect
(
this
,
SIGNAL
(
select
HardwareView
()),
action
,
SIGNAL
(
triggered
()));
connect
(
this
,
SIGNAL
(
trigger
HardwareView
()),
action
,
SIGNAL
(
triggered
()));
}
void
APMToolBar
::
setSoftwareViewAction
(
QAction
*
action
)
{
connect
(
this
,
SIGNAL
(
select
SoftwareView
()),
action
,
SIGNAL
(
triggered
()));
connect
(
this
,
SIGNAL
(
trigger
SoftwareView
()),
action
,
SIGNAL
(
triggered
()));
}
void
APMToolBar
::
setSimulationViewAction
(
QAction
*
action
)
{
connect
(
this
,
SIGNAL
(
selectSimual
tionView
()),
action
,
SIGNAL
(
triggered
()));
connect
(
this
,
SIGNAL
(
triggerSimula
tionView
()),
action
,
SIGNAL
(
triggered
()));
}
void
APMToolBar
::
setTerminalViewAction
(
QAction
*
action
)
{
connect
(
this
,
SIGNAL
(
selectTerminalView
()),
action
,
SIGNAL
(
triggered
()));
connect
(
this
,
SIGNAL
(
triggerTerminalView
()),
action
,
SIGNAL
(
triggered
()));
}
void
APMToolBar
::
setConnectMAVAction
(
QAction
*
action
)
{
connect
(
this
,
SIGNAL
(
connectMAV
()),
action
,
SIGNAL
(
triggered
()));
}
void
APMToolBar
::
selectFlightView
()
{
qDebug
()
<<
"APMToolBar: SelectFlightView"
;
//
emit triggerFlightView();
emit
triggerFlightView
();
}
void
APMToolBar
::
selectFlightPlanView
()
{
qDebug
()
<<
"APMToolBar: SelectFlightPlanView"
;
emit
triggerFlightPlanView
();
}
void
APMToolBar
::
selectHardwareView
()
{
qDebug
()
<<
"APMToolBar: selectHardwareView"
;
emit
triggerHardwareView
();
}
void
APMToolBar
::
selectSoftwareView
()
{
qDebug
()
<<
"APMToolBar: selectSoftwareView"
;
emit
triggerSoftwareView
();
}
void
APMToolBar
::
selectSimulationView
()
...
...
@@ -76,6 +90,65 @@ void APMToolBar::selectTerminalView()
void
APMToolBar
::
connectMAV
()
{
qDebug
()
<<
"APMToolBar: connect"
;
qDebug
()
<<
"APMToolBar: connectMAV "
;
bool
connected
=
LinkManager
::
instance
()
->
getLinks
().
last
()
->
isConnected
();
bool
result
;
if
(
!
connected
&&
LinkManager
::
instance
()
->
getLinks
().
count
()
<
3
)
{
// No Link so prompt to connect one
MainWindow
::
instance
()
->
addLink
();
}
else
if
(
!
connected
)
{
// Need to Connect Link
result
=
LinkManager
::
instance
()
->
getLinks
().
last
()
->
connect
();
}
else
if
(
connected
&&
LinkManager
::
instance
()
->
getLinks
().
count
()
>
2
)
{
// result need to be the opposite of success.
result
=
!
LinkManager
::
instance
()
->
getLinks
().
last
()
->
disconnect
();
}
qDebug
()
<<
"result = "
<<
result
;
emit
MAVConnected
(
result
);
}
APMToolBar
::~
APMToolBar
()
{
qDebug
()
<<
"Destory APM Toolbar"
;
}
void
APMToolBar
::
showConnectionDialog
()
{
// Displays a UI where the user can select a MAV Link.
qDebug
()
<<
"APMToolBar: showConnectionDialog link count ="
<<
LinkManager
::
instance
()
->
getLinks
().
count
();
LinkInterface
*
link
=
LinkManager
::
instance
()
->
getLinks
().
last
();
bool
result
;
if
(
link
&&
LinkManager
::
instance
()
->
getLinks
().
count
()
>=
3
)
{
// Serial Link so prompt to config it
result
=
MainWindow
::
instance
()
->
configLink
(
link
);
if
(
!
result
)
qDebug
()
<<
"Link Config Failed!"
;
}
else
{
// No Link so prompt to create one
MainWindow
::
instance
()
->
addLink
();
}
}
void
APMToolBar
::
updateLinkDisplay
(
LinkInterface
*
newLink
)
{
qDebug
()
<<
"APMToolBar: updateLinkDisplay"
;
QObject
*
object
=
rootObject
();
if
(
newLink
){
qint64
baudrate
=
newLink
->
getNominalDataRate
();
object
->
setProperty
(
"baudrateLabel"
,
QString
::
number
(
baudrate
));
QString
linkName
=
newLink
->
getName
();
object
->
setProperty
(
"linkNameLabel"
,
linkName
);
}
}
src/ui/apmtoolbar.h
View file @
359f8bd1
...
...
@@ -4,11 +4,14 @@
#include <QAction>
#include <QDeclarativeView>
class
LinkInterface
;
class
APMToolBar
:
public
QDeclarativeView
{
Q_OBJECT
public:
explicit
APMToolBar
(
QWidget
*
parent
=
0
);
~
APMToolBar
();
void
setFlightViewAction
(
QAction
*
action
);
void
setFlightPlanViewAction
(
QAction
*
action
);
...
...
@@ -16,6 +19,7 @@ public:
void
setSoftwareViewAction
(
QAction
*
action
);
void
setSimulationViewAction
(
QAction
*
action
);
void
setTerminalViewAction
(
QAction
*
action
);
void
setConnectMAVAction
(
QAction
*
action
);
signals:
void
triggerFlightView
();
...
...
@@ -25,8 +29,9 @@ signals:
void
triggerSimulationView
();
void
triggerTerminalView
();
void
MAVConnected
(
bool
connected
);
public
slots
:
//signals:
void
selectFlightView
();
void
selectFlightPlanView
();
void
selectHardwareView
();
...
...
@@ -34,8 +39,10 @@ public slots:
void
selectSimulationView
();
void
selectTerminalView
();
public
slots
:
void
connectMAV
();
void
showConnectionDialog
();
void
updateLinkDisplay
(
LinkInterface
*
newLink
);
};
#endif // APMTOOLBAR_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