Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qgroundcontrol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valentin Platzgummer
qgroundcontrol
Commits
4a078f99
Commit
4a078f99
authored
12 years ago
by
Lorenz Meier
Browse files
Options
Downloads
Patches
Plain Diff
Added connect button, added 15 seconds timeout on system messages
parent
e6ffde7c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ui/QGCToolBar.cc
+14
-2
14 additions, 2 deletions
src/ui/QGCToolBar.cc
src/ui/QGCToolBar.h
+3
-0
3 additions, 0 deletions
src/ui/QGCToolBar.h
with
17 additions
and
2 deletions
src/ui/QGCToolBar.cc
+
14
−
2
View file @
4a078f99
...
@@ -110,7 +110,6 @@ QGCToolBar::QGCToolBar(QWidget *parent) :
...
@@ -110,7 +110,6 @@ QGCToolBar::QGCToolBar(QWidget *parent) :
addWidget
(
toolBarMessageLabel
);
addWidget
(
toolBarMessageLabel
);
connectButton
=
new
QPushButton
(
tr
(
"Connect"
),
this
);
connectButton
=
new
QPushButton
(
tr
(
"Connect"
),
this
);
connectButton
->
setCheckable
(
true
);
connectButton
->
setToolTip
(
tr
(
"Connect wireless link to MAV"
));
connectButton
->
setToolTip
(
tr
(
"Connect wireless link to MAV"
));
addWidget
(
connectButton
);
addWidget
(
connectButton
);
connect
(
connectButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
connectLink
(
bool
)));
connect
(
connectButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
connectLink
(
bool
)));
...
@@ -309,7 +308,12 @@ void QGCToolBar::updateView()
...
@@ -309,7 +308,12 @@ void QGCToolBar::updateView()
toolBarStateLabel
->
setText
(
tr
(
"%1"
).
arg
(
state
));
toolBarStateLabel
->
setText
(
tr
(
"%1"
).
arg
(
state
));
toolBarModeLabel
->
setText
(
tr
(
"%1"
).
arg
(
mode
));
toolBarModeLabel
->
setText
(
tr
(
"%1"
).
arg
(
mode
));
toolBarNameLabel
->
setText
(
systemName
);
toolBarNameLabel
->
setText
(
systemName
);
// expire after 15 seconds
if
(
QGC
::
groundTimeMilliseconds
()
-
lastSystemMessageTimeMs
<
15000
)
{
toolBarMessageLabel
->
setText
(
lastSystemMessage
);
toolBarMessageLabel
->
setText
(
lastSystemMessage
);
}
else
{
toolBarMessageLabel
->
setText
(
""
);
}
if
(
systemArmed
)
if
(
systemArmed
)
{
{
...
@@ -454,6 +458,8 @@ void QGCToolBar::receiveTextMessage(int uasid, int componentid, int severity, QS
...
@@ -454,6 +458,8 @@ void QGCToolBar::receiveTextMessage(int uasid, int componentid, int severity, QS
Q_UNUSED
(
severity
);
Q_UNUSED
(
severity
);
if
(
lastSystemMessage
!=
text
)
changed
=
true
;
if
(
lastSystemMessage
!=
text
)
changed
=
true
;
lastSystemMessage
=
text
;
lastSystemMessage
=
text
;
lastSystemMessageTimeMs
=
QGC
::
groundTimeMilliseconds
();
QTimer
::
singleShot
(
16000
,
this
,
SLOT
(
clearStatusString
()));
}
}
void
QGCToolBar
::
connectLink
(
bool
connect
)
void
QGCToolBar
::
connectLink
(
bool
connect
)
...
@@ -481,6 +487,12 @@ void QGCToolBar::connectLink(bool connect)
...
@@ -481,6 +487,12 @@ void QGCToolBar::connectLink(bool connect)
}
}
void
QGCToolBar
::
clearStatusString
()
{
lastSystemMessage
=
""
;
changed
=
true
;
}
QGCToolBar
::~
QGCToolBar
()
QGCToolBar
::~
QGCToolBar
()
{
{
if
(
toggleLoggingAction
)
toggleLoggingAction
->
deleteLater
();
if
(
toggleLoggingAction
)
toggleLoggingAction
->
deleteLater
();
...
...
This diff is collapsed.
Click to expand it.
src/ui/QGCToolBar.h
+
3
−
0
View file @
4a078f99
...
@@ -75,6 +75,8 @@ public slots:
...
@@ -75,6 +75,8 @@ public slots:
void
heartbeatTimeout
(
bool
timeout
,
unsigned
int
ms
);
void
heartbeatTimeout
(
bool
timeout
,
unsigned
int
ms
);
/** @brief Create or connect link */
/** @brief Create or connect link */
void
connectLink
(
bool
connect
);
void
connectLink
(
bool
connect
);
/** @brief Clear status string */
void
clearStatusString
();
protected:
protected:
void
createCustomWidgets
();
void
createCustomWidgets
();
...
@@ -104,6 +106,7 @@ protected:
...
@@ -104,6 +106,7 @@ protected:
QString
mode
;
QString
mode
;
QString
systemName
;
QString
systemName
;
QString
lastSystemMessage
;
QString
lastSystemMessage
;
quint64
lastSystemMessageTimeMs
;
QTimer
updateViewTimer
;
QTimer
updateViewTimer
;
bool
systemArmed
;
bool
systemArmed
;
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment