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
d55937a1
Commit
d55937a1
authored
Aug 26, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Another cleanup round
parent
7aa3ca2d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
6 deletions
+38
-6
SerialLink.cc
src/comm/SerialLink.cc
+5
-4
QGCPX4VehicleConfig.cc
src/ui/QGCPX4VehicleConfig.cc
+2
-0
QGCToolBar.cc
src/ui/QGCToolBar.cc
+10
-2
UASListWidget.cc
src/ui/uas/UASListWidget.cc
+20
-0
UASListWidget.h
src/ui/uas/UASListWidget.h
+1
-0
No files found.
src/comm/SerialLink.cc
View file @
d55937a1
...
...
@@ -28,8 +28,6 @@ SerialLink::SerialLink(QString portname, int baudRate, bool hardwareFlowControl,
m_stopp
(
false
),
m_reqReset
(
false
)
{
qDebug
()
<<
"create SerialLink "
<<
portname
<<
baudRate
<<
hardwareFlowControl
<<
parity
<<
dataBits
<<
stopBits
;
// Setup settings
m_portName
=
portname
.
trimmed
();
...
...
@@ -38,8 +36,6 @@ SerialLink::SerialLink(QString portname, int baudRate, bool hardwareFlowControl,
m_portName
=
m_ports
.
first
().
trimmed
();
}
qDebug
()
<<
"m_portName "
<<
m_portName
;
// Set unique ID and add link to the list of links
m_id
=
getNextLinkId
();
...
...
@@ -66,6 +62,11 @@ SerialLink::SerialLink(QString portname, int baudRate, bool hardwareFlowControl,
m_stopBits
=
stopBits
;
loadSettings
();
qDebug
()
<<
"create SerialLink "
<<
portname
<<
baudRate
<<
hardwareFlowControl
<<
parity
<<
dataBits
<<
stopBits
;
qDebug
()
<<
"m_portName "
<<
m_portName
;
LinkManager
::
instance
()
->
add
(
this
);
}
void
SerialLink
::
requestReset
()
...
...
src/ui/QGCPX4VehicleConfig.cc
View file @
d55937a1
...
...
@@ -223,6 +223,8 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
updateTimer
.
setInterval
(
150
);
connect
(
&
updateTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
updateView
()));
updateTimer
.
start
();
firmwareMenuButtonClicked
();
}
QGCPX4VehicleConfig
::~
QGCPX4VehicleConfig
()
...
...
src/ui/QGCToolBar.cc
View file @
d55937a1
...
...
@@ -182,8 +182,8 @@ void QGCToolBar::createUI()
baudcomboBox
->
addItem
(
"921600"
,
921600
);
baudcomboBox
->
setCurrentIndex
(
baudcomboBox
->
findData
(
57600
));
addWidget
(
baudcomboBox
);
connect
(
baudcomboBox
,
SIGNAL
(
currentIndexChang
ed
(
int
)),
this
,
SLOT
(
baudSelected
(
int
)));
connect
(
portComboBox
,
SIGNAL
(
currentIndexChang
ed
(
int
)),
this
,
SLOT
(
portSelected
(
int
)));
connect
(
baudcomboBox
,
SIGNAL
(
activat
ed
(
int
)),
this
,
SLOT
(
baudSelected
(
int
)));
connect
(
portComboBox
,
SIGNAL
(
activat
ed
(
int
)),
this
,
SLOT
(
portSelected
(
int
)));
connectButton
=
new
QPushButton
(
tr
(
"Connect"
),
this
);
connectButton
->
setObjectName
(
"connectButton"
);
...
...
@@ -666,6 +666,10 @@ void QGCToolBar::updateComboBox()
{
if
(
currentLink
)
{
// Do not update if not visible
if
(
!
portComboBox
->
isVisible
())
return
;
SerialLink
*
slink
=
qobject_cast
<
SerialLink
*>
(
currentLink
);
QList
<
QString
>
portlist
=
slink
->
getCurrentPorts
();
foreach
(
QString
port
,
portlist
)
...
...
@@ -715,6 +719,8 @@ void QGCToolBar::updateLinkState(bool connected)
connectButton
->
blockSignals
(
true
);
connectButton
->
setChecked
(
true
);
connectButton
->
blockSignals
(
false
);
portComboBox
->
hide
();
baudcomboBox
->
hide
();
}
else
{
...
...
@@ -722,6 +728,8 @@ void QGCToolBar::updateLinkState(bool connected)
connectButton
->
blockSignals
(
true
);
connectButton
->
setChecked
(
false
);
connectButton
->
blockSignals
(
false
);
portComboBox
->
show
();
baudcomboBox
->
show
();
}
}
...
...
src/ui/uas/UASListWidget.cc
View file @
d55937a1
...
...
@@ -64,6 +64,8 @@ UASListWidget::UASListWidget(QWidget *parent) : QWidget(parent),
this
->
setVisible
(
false
);
connect
(
LinkManager
::
instance
(),
SIGNAL
(
linkRemoved
(
LinkInterface
*
)),
this
,
SLOT
(
removeLink
(
LinkInterface
*
)));
// Listen for when UASes are added or removed. This does not manage the UASView
// widgets that are displayed within this widget.
connect
(
UASManager
::
instance
(),
SIGNAL
(
UASCreated
(
UASInterface
*
)),
...
...
@@ -96,12 +98,30 @@ void UASListWidget::changeEvent(QEvent *e)
}
}
// XXX This is just to prevent
// upfront crashes, will probably need further inspection
void
UASListWidget
::
removeLink
(
LinkInterface
*
link
)
{
QGroupBox
*
box
=
linkToBoxMapping
.
value
(
link
,
NULL
);
if
(
box
)
{
// Just stop updating the status for now - we should
// remove the UAS probably
linkToBoxMapping
.
remove
(
link
);
}
}
void
UASListWidget
::
updateStatus
()
{
QMapIterator
<
LinkInterface
*
,
QGroupBox
*>
i
(
linkToBoxMapping
);
while
(
i
.
hasNext
())
{
i
.
next
();
LinkInterface
*
link
=
i
.
key
();
// Paranoid sanity check
if
(
!
LinkManager
::
instance
()
->
getLinks
().
contains
(
link
))
continue
;
if
(
!
link
)
continue
;
...
...
src/ui/uas/UASListWidget.h
View file @
d55937a1
...
...
@@ -53,6 +53,7 @@ public slots:
void
addUAS
(
UASInterface
*
uas
);
void
activeUAS
(
UASInterface
*
uas
);
void
removeUAS
(
UASInterface
*
uas
);
void
removeLink
(
LinkInterface
*
link
);
protected:
// Keep a mapping from UASes to their GroupBox. Useful for determining when groupboxes are empty.
...
...
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