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
d8efa558
Commit
d8efa558
authored
Jul 31, 2013
by
Michael Carpenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addition of Armed/Disarmed indicator on ApmToolbar
parent
eb59fcb5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
1 deletion
+53
-1
ApmToolBar.qml
qml/ApmToolBar.qml
+27
-0
apmtoolbar.cpp
src/ui/apmtoolbar.cpp
+20
-1
apmtoolbar.h
src/ui/apmtoolbar.h
+6
-0
No files found.
qml/ApmToolBar.qml
View file @
d8efa558
...
...
@@ -9,12 +9,25 @@ Rectangle {
property
alias
linkNameLabel
:
linkDevice
.
label
property
alias
baudrateLabel
:
baudrate
.
label
property
bool
connected
:
false
property
bool
armed
:
false
property
string
armedstr
:
"
Disarmed
"
width
:
toolbar
.
width
height
:
72
color
:
"
black
"
border.color
:
"
black
"
onArmedChanged
:
{
if
(
armed
)
{
armedText
.
text
=
"
Armed
"
armedText
.
color
=
"
Red
"
}
else
{
armedText
.
text
=
"
Disarmed
"
armedText
.
color
=
"
Green
"
}
}
onConnectedChanged
:
{
if
(
connected
){
console
.
log
(
"
APM Tool BAR QML: connected
"
)
...
...
@@ -97,6 +110,20 @@ Rectangle {
image
:
"
./resources/apmplanner/toolbar/terminal.png
"
onClicked
:
globalObj
.
triggerTerminalView
()
}
Rectangle
{
width
:
150
height
:
parent
.
height
Text
{
id
:
armedText
;
anchors.fill
:
parent
verticalAlignment
:
Text
.
AlignVCenter
horizontalAlignment
:
Text
.
AlignHCenter
font.pixelSize
:
20
color
:
"
green
"
text
:
"
Disarmed
"
}
color
:
"
black
"
}
Rectangle
{
// Spacer
width
:
5
...
...
src/ui/apmtoolbar.cpp
View file @
d8efa558
...
...
@@ -7,7 +7,7 @@
#include "apmtoolbar.h"
APMToolBar
::
APMToolBar
(
QWidget
*
parent
)
:
QDeclarativeView
(
parent
)
QDeclarativeView
(
parent
)
,
m_uas
(
0
)
{
// Configure our QML object
setSource
(
QUrl
::
fromLocalFile
(
"qml/ApmToolBar.qml"
));
...
...
@@ -21,6 +21,25 @@ APMToolBar::APMToolBar(QWidget *parent):
}
setConnection
(
false
);
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
activeUasSet
(
UASInterface
*
)));
activeUasSet
(
UASManager
::
instance
()
->
getActiveUAS
());
}
void
APMToolBar
::
activeUasSet
(
UASInterface
*
uas
)
{
if
(
!
uas
)
{
return
;
}
if
(
m_uas
)
{
disconnect
(
m_uas
,
SIGNAL
(
armingChanged
(
bool
)),
this
,
SLOT
(
armingChanged
(
bool
)));
}
connect
(
uas
,
SIGNAL
(
armingChanged
(
bool
)),
this
,
SLOT
(
armingChanged
(
bool
)));
}
void
APMToolBar
::
armingChanged
(
bool
armed
)
{
this
->
rootObject
()
->
setProperty
(
"armed"
,
armed
);
}
void
APMToolBar
::
setFlightViewAction
(
QAction
*
action
)
...
...
src/ui/apmtoolbar.h
View file @
d8efa558
...
...
@@ -3,6 +3,7 @@
#include <QAction>
#include <QDeclarativeView>
#include "UASInterface.h"
class
LinkInterface
;
...
...
@@ -32,6 +33,8 @@ signals:
void
MAVConnected
(
bool
connected
);
public
slots
:
void
armingChanged
(
bool
armed
);
void
activeUasSet
(
UASInterface
*
uas
);
void
selectFlightView
();
void
selectFlightPlanView
();
void
selectHardwareView
();
...
...
@@ -44,6 +47,9 @@ public slots:
void
setConnection
(
bool
connection
);
void
updateLinkDisplay
(
LinkInterface
*
newLink
);
private:
UASInterface
*
m_uas
;
};
#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