Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
69d34ea8
Commit
69d34ea8
authored
Nov 23, 2014
by
Don Gagne
Browse files
Use new LinkManager::[connect|disconnect]Link api
parent
f65c0a57
Changes
4
Show whitespace changes
Inline
Side-by-side
src/ui/CommConfigurationWindow.cc
View file @
69d34ea8
...
...
@@ -353,13 +353,13 @@ void CommConfigurationWindow::setProtocol(int protocol)
void
CommConfigurationWindow
::
setConnection
()
{
if
(
!
link
->
isConnected
())
{
l
ink
->
connect
(
);
L
ink
Manager
::
instance
()
->
connectLink
(
link
);
QGC
::
SLEEP
::
msleep
(
100
);
if
(
link
->
isConnected
())
// Auto-close window on connect
this
->
window
()
->
close
();
}
else
{
l
ink
->
disconnect
(
);
L
ink
Manager
::
instance
()
->
disconnect
Link
(
link
);
}
}
...
...
src/ui/DebugConsole.cc
View file @
69d34ea8
...
...
@@ -782,9 +782,9 @@ void DebugConsole::handleConnectButton()
{
if
(
currLink
)
{
if
(
currLink
->
isConnected
())
{
curr
Link
->
disconnect
();
Link
Manager
::
instance
()
->
disconnect
(
currLink
);
}
else
{
currLink
->
connect
(
);
LinkManager
::
instance
()
->
connectLink
(
currLink
);
}
}
}
...
...
src/ui/QGCToolBar.cc
View file @
69d34ea8
...
...
@@ -769,24 +769,25 @@ void QGCToolBar::updateLinkState(bool connected)
void
QGCToolBar
::
connectLink
(
bool
connect
)
{
LinkManager
*
linkMgr
=
LinkManager
::
instance
();
Q_ASSERT
(
linkMgr
);
// No serial port yet present
if
(
connect
&&
LinkManager
::
instance
()
->
getSerialLinks
().
count
()
==
0
)
{
if
(
connect
&&
linkMgr
->
getSerialLinks
().
count
()
==
0
)
{
MainWindow
::
instance
()
->
addLink
();
currentLink
=
L
inkM
anager
::
instance
()
->
getLinks
().
last
();
currentLink
=
l
inkM
gr
->
getLinks
().
last
();
}
else
if
(
connect
)
{
SerialLink
*
link
=
qobject_cast
<
SerialLink
*>
(
currentLink
);
if
(
link
)
{
if
(
link
)
{
link
->
setPortName
(
portComboBox
->
itemData
(
portComboBox
->
currentIndex
()).
toString
().
trimmed
());
int
baud
=
baudcomboBox
->
currentText
().
toInt
();
link
->
setBaudRate
(
baud
);
QObject
::
connect
(
link
,
SIGNAL
(
connected
(
bool
)),
this
,
SLOT
(
updateLinkState
(
bool
)));
link
->
connect
(
);
link
Mgr
->
connect
Link
(
link
);
}
}
else
if
(
!
connect
&&
currentLink
)
{
currentLink
->
disconnect
(
);
linkMgr
->
disconnect
Link
(
currentLink
);
QObject
::
disconnect
(
currentLink
,
SIGNAL
(
connected
(
bool
)),
this
,
SLOT
(
updateLinkState
(
bool
)));
}
...
...
src/ui/uas/QGCUnconnectedInfoWidget.cc
View file @
69d34ea8
...
...
@@ -30,7 +30,7 @@ void QGCUnconnectedInfoWidget::simulate()
foreach
(
LinkInterface
*
link
,
links
)
{
MAVLinkSimulationLink
*
sim
=
dynamic_cast
<
MAVLinkSimulationLink
*>
(
link
);
if
(
sim
)
{
sim
->
connectLink
();
LinkManager
::
instance
()
->
connectLink
(
sim
);
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment