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
a3943266
Commit
a3943266
authored
Jun 11, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #697 from Susurrus/serialport
Removed constant debugging output from scanning for serial ports.
parents
d222658a
eeb0d547
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
13 deletions
+16
-13
SerialLink.cc
src/comm/SerialLink.cc
+1
-9
SerialConfigurationWindow.cc
src/ui/SerialConfigurationWindow.cc
+8
-3
SerialConfigurationWindow.h
src/ui/SerialConfigurationWindow.h
+7
-1
No files found.
src/comm/SerialLink.cc
View file @
a3943266
...
...
@@ -99,19 +99,11 @@ QList<QString> SerialLink::getCurrentPorts()
m_ports
.
clear
();
QList
<
QSerialPortInfo
>
portList
=
QSerialPortInfo
::
availablePorts
();
if
(
portList
.
count
()
==
0
){
qDebug
()
<<
"No Ports Found"
<<
m_ports
;
}
foreach
(
const
QSerialPortInfo
&
info
,
portList
)
{
// qDebug() << "PortName : " << info.portName()
// << "Description : " << info.description();
// qDebug() << "Manufacturer: " << info.manufacturer();
m_ports
.
append
(
info
.
portName
());
}
return
m_ports
;
}
...
...
src/ui/SerialConfigurationWindow.cc
View file @
a3943266
...
...
@@ -55,7 +55,10 @@ SerialConfigurationWindow::SerialConfigurationWindow(LinkInterface* link, QWidge
action
=
new
QAction
(
QIcon
(
":/files/images/devices/network-wireless.svg"
),
""
,
this
);
setLinkName
(
link
->
getName
());
setupPortList
();
// Scan for serial ports. Let the user know if none were found for debugging purposes
if
(
!
setupPortList
())
{
qDebug
()
<<
"No serial ports found."
;
}
// Set up baud rates
ui
.
baudRate
->
clear
();
...
...
@@ -213,9 +216,9 @@ void SerialConfigurationWindow::configureCommunication()
this
->
show
();
}
void
SerialConfigurationWindow
::
setupPortList
()
bool
SerialConfigurationWindow
::
setupPortList
()
{
if
(
!
link
)
return
;
if
(
!
link
)
return
false
;
// Get the ports available on this system
QList
<
QString
>
ports
=
link
->
getCurrentPorts
();
...
...
@@ -240,6 +243,8 @@ void SerialConfigurationWindow::setupPortList()
if
(
storedFound
)
ui
.
portName
->
setEditText
(
storedName
);
return
(
ports
.
count
()
>
0
);
}
void
SerialConfigurationWindow
::
enableFlowControl
(
bool
flow
)
...
...
src/ui/SerialConfigurationWindow.h
View file @
a3943266
...
...
@@ -60,7 +60,13 @@ public slots:
void
setParityEven
(
bool
accept
);
void
setPortName
(
QString
port
);
void
setLinkName
(
QString
name
);
void
setupPortList
();
/**
* @brief setupPortList Populates the dropdown with the list of available serial ports.
* This function is called at 1s intervals to check that the serial port still exists and to see if
* any new ones have been attached.
* @return True if any ports were found, false otherwise.
*/
bool
setupPortList
();
protected:
void
showEvent
(
QShowEvent
*
event
);
...
...
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