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
7aa3ca2d
Commit
7aa3ca2d
authored
Aug 26, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed port to not auto-reset
parent
1665245a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
13 deletions
+32
-13
QGCToolBar.cc
src/ui/QGCToolBar.cc
+25
-13
QGCToolBar.h
src/ui/QGCToolBar.h
+7
-0
No files found.
src/ui/QGCToolBar.cc
View file @
7aa3ca2d
...
...
@@ -33,6 +33,7 @@ QGCToolBar::QGCToolBar(QWidget *parent) :
QToolBar
(
parent
),
mav
(
NULL
),
userBaudChoice
(
false
),
userPortChoice
(
false
),
changed
(
true
),
batteryPercent
(
0
),
batteryVoltage
(
0
),
...
...
@@ -182,7 +183,7 @@ void QGCToolBar::createUI()
baudcomboBox
->
setCurrentIndex
(
baudcomboBox
->
findData
(
57600
));
addWidget
(
baudcomboBox
);
connect
(
baudcomboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
baudSelected
(
int
)));
connect
(
portComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
portSelected
(
int
)));
connectButton
=
new
QPushButton
(
tr
(
"Connect"
),
this
);
connectButton
->
setObjectName
(
"connectButton"
);
...
...
@@ -254,9 +255,16 @@ void QGCToolBar::resetToolbarUI()
void
QGCToolBar
::
baudSelected
(
int
index
)
{
Q_UNUSED
(
index
);
userBaudChoice
=
true
;
}
void
QGCToolBar
::
portSelected
(
int
index
)
{
Q_UNUSED
(
index
);
userPortChoice
=
true
;
}
void
QGCToolBar
::
setPerspectiveChangeActions
(
const
QList
<
QAction
*>
&
actions
)
{
if
(
actions
.
count
()
>
1
)
...
...
@@ -656,7 +664,6 @@ void QGCToolBar::removeLink(LinkInterface* link)
}
void
QGCToolBar
::
updateComboBox
()
{
// portComboBox->clear();
if
(
currentLink
)
{
SerialLink
*
slink
=
qobject_cast
<
SerialLink
*>
(
currentLink
);
...
...
@@ -669,26 +676,31 @@ void QGCToolBar::updateComboBox()
}
}
if
(
slink
->
getPortName
().
trimmed
().
length
()
>
0
)
{
portComboBox
->
setCurrentIndex
(
portComboBox
->
findData
(
slink
->
getPortName
()));
portComboBox
->
setEditText
(
slink
->
getPortName
());
}
else
{
if
(
portlist
.
length
()
>
0
)
if
(
!
userPortChoice
)
{
if
(
slink
->
getPortName
().
trimmed
().
length
()
>
0
)
{
portComboBox
->
setEditText
(
portlist
.
last
());
int
portIndex
=
portComboBox
->
findData
(
slink
->
getPortName
());
if
(
portIndex
>=
0
)
{
portComboBox
->
setCurrentIndex
(
portIndex
);
portComboBox
->
setEditText
(
slink
->
getPortName
());
}
}
else
{
portComboBox
->
setEditText
(
tr
(
"No serial port found"
));
if
(
portlist
.
length
()
>
0
)
{
portComboBox
->
setEditText
(
portlist
.
last
());
}
else
{
portComboBox
->
setEditText
(
tr
(
"No serial port found"
));
}
}
}
if
(
!
userBaudChoice
)
{
int
index
=
baudcomboBox
->
findData
(
slink
->
getBaudRate
());
if
(
index
>
0
)
if
(
index
>
=
0
)
baudcomboBox
->
setCurrentIndex
(
index
);
}
}
...
...
src/ui/QGCToolBar.h
View file @
7aa3ca2d
...
...
@@ -93,6 +93,12 @@ public slots:
*/
void
baudSelected
(
int
index
);
/**
* @brief User selected port
* @param index The current index of the combo box
*/
void
portSelected
(
int
index
);
protected:
void
storeSettings
();
void
loadSettings
();
...
...
@@ -117,6 +123,7 @@ protected:
QComboBox
*
baudcomboBox
;
QTimer
portBoxTimer
;
bool
userBaudChoice
;
bool
userPortChoice
;
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