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
9e38f8ca
Commit
9e38f8ca
authored
Feb 24, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved qRegisterMetaType calls to main
Also commented out noisy serial link error output
parent
8b4a3854
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
11 deletions
+14
-11
SerialLink.cc
src/comm/SerialLink.cc
+5
-5
TCPLink.cc
src/comm/TCPLink.cc
+0
-6
main.cc
src/main.cc
+9
-0
No files found.
src/comm/SerialLink.cc
View file @
9e38f8ca
...
...
@@ -26,10 +26,6 @@ SerialLink::SerialLink(QString portname, int baudRate, bool hardwareFlowControl,
m_stopp
(
false
),
m_reqReset
(
false
)
{
// We use QSerialPort::SerialPortError in a signal so we must declare it as a meta type
static
const
int
idMetaType
=
qRegisterMetaType
<
QSerialPort
::
SerialPortError
>
();
Q_UNUSED
(
idMetaType
);
// Get the name of the current port in use.
m_portName
=
portname
.
trimmed
();
if
(
m_portName
==
""
&&
getCurrentPorts
().
size
()
>
0
)
...
...
@@ -449,7 +445,11 @@ bool SerialLink::hardwareConnect()
void
SerialLink
::
linkError
(
QSerialPort
::
SerialPortError
error
)
{
if
(
error
!=
QSerialPort
::
NoError
)
{
qDebug
()
<<
"SerialLink::linkError"
<<
error
;
// You can use the following qDebug output as needed during development. Make sure to comment it back out
// when you are done. The reason for this is that this signal is very noisy. For example if you try to
// connect to a PixHawk before it is ready to accept the connection it will output a continuous stream
// of errors until the Pixhawk responds.
//qDebug() << "SerialLink::linkError" << error;
}
}
...
...
src/comm/TCPLink.cc
View file @
9e38f8ca
...
...
@@ -43,12 +43,6 @@ TCPLink::TCPLink(QHostAddress hostAddress, quint16 socketPort) :
_socket
(
NULL
),
_socketIsConnected
(
false
)
{
// Even though QAbstractSocket::SocketError is used in a signal by Qt, Qt doesn't declare it as a meta type.
// This in turn causes debug output to be kicked out about not being able to queue the signal. We register it
// as a meta type to silence that.
static
const
int
idMetaType
=
qRegisterMetaType
<
QAbstractSocket
::
SocketError
>
();
Q_UNUSED
(
idMetaType
);
_linkId
=
getNextLinkId
();
_resetName
();
...
...
src/main.cc
View file @
9e38f8ca
...
...
@@ -32,6 +32,8 @@ This file is part of the QGROUNDCONTROL project
#include "QGCCore.h"
#include "MainWindow.h"
#include "configuration.h"
#include "SerialLink.h"
#include "TCPLink.h"
#ifdef QT_DEBUG
#include "AutoTest.h"
#endif
...
...
@@ -70,6 +72,13 @@ int main(int argc, char *argv[])
#ifdef Q_OS_WIN
qInstallMsgHandler
(
msgHandler
);
#endif
// The following calls to qRegisterMetaType are done to silence debug output which warns
// that we use these types in signals, and without calling qRegisterMetaType we can't queue
// these signals. In general we don't queue these signals, but we do what the warning says
// anyway to silence the debug output.
qRegisterMetaType
<
QSerialPort
::
SerialPortError
>
();
qRegisterMetaType
<
QAbstractSocket
::
SocketError
>
();
#ifdef QT_DEBUG
if
(
argc
>
1
&&
QString
(
argv
[
1
]).
compare
(
"--unittest"
,
Qt
::
CaseInsensitive
)
==
0
)
{
...
...
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