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
40202972
Commit
40202972
authored
Aug 26, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added periodic check for ports to QGC toolbar to not depend on port state on power up
parent
baafca2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
QGCToolBar.cc
src/ui/QGCToolBar.cc
+12
-5
QGCToolBar.h
src/ui/QGCToolBar.h
+3
-1
No files found.
src/ui/QGCToolBar.cc
View file @
40202972
...
...
@@ -221,6 +221,9 @@ void QGCToolBar::createUI()
loadSettings
();
connect
(
&
portBoxTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
updateComboBox
()));
portBoxTimer
.
start
(
500
);
changed
=
false
;
}
...
...
@@ -647,25 +650,29 @@ void QGCToolBar::removeLink(LinkInterface* link)
}
void
QGCToolBar
::
updateComboBox
()
{
portComboBox
->
clear
();
//
portComboBox->clear();
if
(
currentLink
)
{
SerialLink
*
slink
=
qobject_cast
<
SerialLink
*>
(
currentLink
);
QList
<
QString
>
portlist
=
slink
->
getCurrentPorts
();
foreach
(
QString
port
,
portlist
)
{
portComboBox
->
addItem
(
port
,
port
);
foreach
(
QString
port
,
portlist
)
{
if
(
portComboBox
->
findText
(
port
)
==
-
1
)
{
portComboBox
->
addItem
(
port
,
port
);
}
}
portComboBox
->
setCurrentIndex
(
portComboBox
->
findData
(
slink
->
getPortName
()));
if
(
slink
->
getPortName
().
trimmed
().
length
()
>
0
)
{
portComboBox
->
setCurrentIndex
(
portComboBox
->
findData
(
slink
->
getPortName
()));
portComboBox
->
setEditText
(
slink
->
getPortName
());
}
else
{
if
(
portlist
.
length
()
>
0
)
{
portComboBox
->
setEditText
(
portlist
.
fir
st
());
portComboBox
->
setEditText
(
portlist
.
la
st
());
}
else
{
...
...
src/ui/QGCToolBar.h
View file @
40202972
...
...
@@ -31,6 +31,7 @@ This file is part of the QGROUNDCONTROL project
#include <QLabel>
#include <QProgressBar>
#include <QComboBox>
#include <QTimer>
#include "UASInterface.h"
#include "QGCMAVLinkLogPlayer.h"
#include "SerialLink.h"
...
...
@@ -84,13 +85,13 @@ public slots:
void
clearStatusString
();
/** @brief Set an activity action as checked in menu */
void
advancedActivityTriggered
(
QAction
*
action
);
void
updateComboBox
();
protected:
void
storeSettings
();
void
loadSettings
();
void
createUI
();
void
resetToolbarUI
();
void
updateComboBox
();
UASInterface
*
mav
;
QLabel
*
symbolLabel
;
QLabel
*
toolBarNameLabel
;
...
...
@@ -108,6 +109,7 @@ protected:
QGCMAVLinkLogPlayer
*
player
;
QComboBox
*
portComboBox
;
QComboBox
*
baudcomboBox
;
QTimer
portBoxTimer
;
bool
changed
;
float
batteryPercent
;
float
batteryVoltage
;
...
...
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