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
4a078f99
Commit
4a078f99
authored
Feb 25, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added connect button, added 15 seconds timeout on system messages
parent
e6ffde7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
QGCToolBar.cc
src/ui/QGCToolBar.cc
+14
-2
QGCToolBar.h
src/ui/QGCToolBar.h
+3
-0
No files found.
src/ui/QGCToolBar.cc
View file @
4a078f99
...
...
@@ -110,7 +110,6 @@ QGCToolBar::QGCToolBar(QWidget *parent) :
addWidget
(
toolBarMessageLabel
);
connectButton
=
new
QPushButton
(
tr
(
"Connect"
),
this
);
connectButton
->
setCheckable
(
true
);
connectButton
->
setToolTip
(
tr
(
"Connect wireless link to MAV"
));
addWidget
(
connectButton
);
connect
(
connectButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
connectLink
(
bool
)));
...
...
@@ -309,7 +308,12 @@ void QGCToolBar::updateView()
toolBarStateLabel
->
setText
(
tr
(
"%1"
).
arg
(
state
));
toolBarModeLabel
->
setText
(
tr
(
"%1"
).
arg
(
mode
));
toolBarNameLabel
->
setText
(
systemName
);
toolBarMessageLabel
->
setText
(
lastSystemMessage
);
// expire after 15 seconds
if
(
QGC
::
groundTimeMilliseconds
()
-
lastSystemMessageTimeMs
<
15000
)
{
toolBarMessageLabel
->
setText
(
lastSystemMessage
);
}
else
{
toolBarMessageLabel
->
setText
(
""
);
}
if
(
systemArmed
)
{
...
...
@@ -454,6 +458,8 @@ void QGCToolBar::receiveTextMessage(int uasid, int componentid, int severity, QS
Q_UNUSED
(
severity
);
if
(
lastSystemMessage
!=
text
)
changed
=
true
;
lastSystemMessage
=
text
;
lastSystemMessageTimeMs
=
QGC
::
groundTimeMilliseconds
();
QTimer
::
singleShot
(
16000
,
this
,
SLOT
(
clearStatusString
()));
}
void
QGCToolBar
::
connectLink
(
bool
connect
)
...
...
@@ -481,6 +487,12 @@ void QGCToolBar::connectLink(bool connect)
}
void
QGCToolBar
::
clearStatusString
()
{
lastSystemMessage
=
""
;
changed
=
true
;
}
QGCToolBar
::~
QGCToolBar
()
{
if
(
toggleLoggingAction
)
toggleLoggingAction
->
deleteLater
();
...
...
src/ui/QGCToolBar.h
View file @
4a078f99
...
...
@@ -75,6 +75,8 @@ public slots:
void
heartbeatTimeout
(
bool
timeout
,
unsigned
int
ms
);
/** @brief Create or connect link */
void
connectLink
(
bool
connect
);
/** @brief Clear status string */
void
clearStatusString
();
protected:
void
createCustomWidgets
();
...
...
@@ -104,6 +106,7 @@ protected:
QString
mode
;
QString
systemName
;
QString
lastSystemMessage
;
quint64
lastSystemMessageTimeMs
;
QTimer
updateViewTimer
;
bool
systemArmed
;
};
...
...
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