Commit 641438a6 authored by Tomaz Canabrava's avatar Tomaz Canabrava

More signals converted to the new style

Signed-off-by: 's avatarTomaz Canabrava <tomaz.canabrava@intel.com>
parent cae4dce2
...@@ -469,9 +469,9 @@ void FirmwareUpgradeController::_downloadFirmware(void) ...@@ -469,9 +469,9 @@ void FirmwareUpgradeController::_downloadFirmware(void)
Q_ASSERT(_downloadNetworkReply); Q_ASSERT(_downloadNetworkReply);
connect(_downloadNetworkReply, &QNetworkReply::downloadProgress, this, &FirmwareUpgradeController::_downloadProgress); connect(_downloadNetworkReply, &QNetworkReply::downloadProgress, this, &FirmwareUpgradeController::_downloadProgress);
connect(_downloadNetworkReply, &QNetworkReply::finished, this, &FirmwareUpgradeController::_downloadFinished); connect(_downloadNetworkReply, &QNetworkReply::finished, this, &FirmwareUpgradeController::_downloadFinished);
// FIXME
//connect(_downloadNetworkReply, &QNetworkReply::error, this, &FirmwareUpgradeController::_downloadError); connect(_downloadNetworkReply, static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error),
connect(_downloadNetworkReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(_downloadError(QNetworkReply::NetworkError))); this, &FirmwareUpgradeController::_downloadError);
} }
/// @brief Updates the progress indicator while downloading /// @brief Updates the progress indicator while downloading
......
...@@ -158,10 +158,10 @@ bool BluetoothLink::_hardwareConnect() ...@@ -158,10 +158,10 @@ bool BluetoothLink::_hardwareConnect()
_discoveryAgent = NULL; _discoveryAgent = NULL;
} }
_discoveryAgent = new QBluetoothServiceDiscoveryAgent(this); _discoveryAgent = new QBluetoothServiceDiscoveryAgent(this);
QObject::connect(_discoveryAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)), this, SLOT(serviceDiscovered(QBluetoothServiceInfo))); connect(_discoveryAgent, &QBluetoothServiceDiscoveryAgent::serviceDiscovered, this, &BluetoothLink::serviceDiscovered);
QObject::connect(_discoveryAgent, SIGNAL(finished()), this, SLOT(discoveryFinished())); connect(_discoveryAgent, &QBluetoothServiceDiscoveryAgent::finished, this, &BluetoothLink::discoveryFinished);
QObject::connect(_discoveryAgent, SIGNAL(canceled()), this, SLOT(discoveryFinished())); connect(_discoveryAgent, &QBluetoothServiceDiscoveryAgent::canceled, this, &BluetoothLink::discoveryFinished);
QObject::connect(_discoveryAgent, SIGNAL(error(QBluetoothServiceDiscoveryAgent::Error)),this, SLOT(discoveryError(QBluetoothServiceDiscoveryAgent::Error))); connect(_discoveryAgent, &QBluetoothServiceDiscoveryAgent::error,this, BluetoothLink::discoveryError);
_shutDown = false; _shutDown = false;
_discoveryAgent->start(); _discoveryAgent->start();
#else #else
...@@ -179,10 +179,10 @@ void BluetoothLink::_createSocket() ...@@ -179,10 +179,10 @@ void BluetoothLink::_createSocket()
_targetSocket = NULL; _targetSocket = NULL;
} }
_targetSocket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol, this); _targetSocket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol, this);
QObject::connect(_targetSocket, SIGNAL(connected()), this, SLOT(deviceConnected())); QObject::connect(_targetSocket, &QBluetoothSocket::connected, this, &BluetoothLink::deviceConnected);
QObject::connect(_targetSocket, SIGNAL(error(QBluetoothSocket::SocketError)), this, SLOT(deviceError(QBluetoothSocket::SocketError))); QObject::connect(_targetSocket, &QBluetoothSocket::error, this, &BluetoothLink::deviceError);
QObject::connect(_targetSocket, SIGNAL(readyRead()), this, SLOT(readBytes())); QObject::connect(_targetSocket, &QBluetoothSocket::readyRead, this, &BluetoothLink::readBytes);
QObject::connect(_targetSocket, SIGNAL(disconnected()), this, SLOT(deviceDisconnected())); QObject::connect(_targetSocket, &QBluetoothSocket::disconnected, this, &BluetoothLink::deviceDisconnected);
} }
#ifdef __ios__ #ifdef __ios__
......
...@@ -98,31 +98,29 @@ void QGCFlightGearLink::run() ...@@ -98,31 +98,29 @@ void QGCFlightGearLink::run()
Q_CHECK_PTR(_udpCommSocket); Q_CHECK_PTR(_udpCommSocket);
_udpCommSocket->moveToThread(this); _udpCommSocket->moveToThread(this);
_udpCommSocket->bind(host, port, QAbstractSocket::ReuseAddressHint); _udpCommSocket->bind(host, port, QAbstractSocket::ReuseAddressHint);
QObject::connect(_udpCommSocket, SIGNAL(readyRead()), this, SLOT(readBytes())); QObject::connect(_udpCommSocket, &QUdpSocket::readyRead, this, &QGCFlightGearLink::readBytes);
// Connect to the various HIL signals that we use to then send information across the UDP protocol to FlightGear. // Connect to the various HIL signals that we use to then send information across the UDP protocol to FlightGear.
connect(_vehicle->uas(), SIGNAL(hilControlsChanged(quint64, float, float, float, float, quint8, quint8)), connect(_vehicle->uas(), &UAS::hilControlsChanged, this, &QGCFlightGearLink::updateControls);
this, SLOT(updateControls(quint64,float,float,float,float,quint8,quint8)));
connect(this, SIGNAL(hilStateChanged(quint64, float, float, float, float,float, float, double, double, double, float, float, float, float, float, float, float, float)), connect(this, &QGCFlightGearLink::hilStateChanged, _vehicle->uas(), &UAS::sendHilState);
_vehicle->uas(), SLOT(sendHilState(quint64, float, float, float, float,float, float, double, double, double, float, float, float, float, float, float, float, float))); connect(this, &QGCFlightGearLink::sensorHilGpsChanged, _vehicle->uas(), &UAS::sendHilGps);
connect(this, SIGNAL(sensorHilGpsChanged(quint64, double, double, double, int, float, float, float, float, float, float, float, int)), connect(this, &QGCFlightGearLink::sensorHilRawImuChanged, _vehicle->uas(), &UAS::sendHilSensors);
_vehicle->uas(), SLOT(sendHilGps(quint64, double, double, double, int, float, float, float, float, float, float, float, int))); connect(this, &QGCFlightGearLink::sensorHilOpticalFlowChanged, _vehicle->uas(), &UAS::sendHilOpticalFlow);
connect(this, SIGNAL(sensorHilRawImuChanged(quint64,float,float,float,float,float,float,float,float,float,float,float,float,float,quint32)),
_vehicle->uas(), SLOT(sendHilSensors(quint64,float,float,float,float,float,float,float,float,float,float,float,float,float,quint32)));
connect(this, SIGNAL(sensorHilOpticalFlowChanged(quint64, qint16, qint16, float,float, quint8, float)),
_vehicle->uas(), SLOT(sendHilOpticalFlow(quint64, qint16, qint16, float, float, quint8, float)));
// Start a new QProcess to run FlightGear in // Start a new QProcess to run FlightGear in
_fgProcess = new QProcess(this); _fgProcess = new QProcess(this);
Q_CHECK_PTR(_fgProcess); Q_CHECK_PTR(_fgProcess);
_fgProcess->moveToThread(this); _fgProcess->moveToThread(this);
connect(_fgProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(processError(QProcess::ProcessError))); connect(_fgProcess, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
#ifdef DEBUG_FLIGHTGEAR_CONNECT this, &QGCFlightGearLink::processError);
connect(_fgProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(_printFgfsOutput()));
connect(_fgProcess, SIGNAL(readyReadStandardError()), this, SLOT(_printFgfsError())); //#ifdef DEBUG_FLIGHTGEAR_CONNECT
#endif connect(_fgProcess, &QProcess::readyReadStandardOutput, this, &QGCFlightGearLink::_printFgfsOutput);
connect(_fgProcess, &QProcess::readyReadStandardError, this, &QGCFlightGearLink::_printFgfsError);
//#endif
if (!_fgProcessWorkingDirPath.isEmpty()) { if (!_fgProcessWorkingDirPath.isEmpty()) {
_fgProcess->setWorkingDirectory(_fgProcessWorkingDirPath); _fgProcess->setWorkingDirectory(_fgProcessWorkingDirPath);
...@@ -491,14 +489,15 @@ qint64 QGCFlightGearLink::bytesAvailable() ...@@ -491,14 +489,15 @@ qint64 QGCFlightGearLink::bytesAvailable()
**/ **/
bool QGCFlightGearLink::disconnectSimulation() bool QGCFlightGearLink::disconnectSimulation()
{ {
disconnect(_fgProcess, SIGNAL(error(QProcess::ProcessError)), disconnect(_fgProcess, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
this, SLOT(processError(QProcess::ProcessError))); this, &QGCFlightGearLink::processError);
disconnect(_vehicle->uas(), SIGNAL(hilControlsChanged(quint64, float, float, float, float, quint8, quint8)), this, SLOT(updateControls(quint64,float,float,float,float,quint8,quint8)));
disconnect(this, SIGNAL(hilStateChanged(quint64, float, float, float, float,float, float, double, double, double, float, float, float, float, float, float, float, float)), _vehicle->uas(), SLOT(sendHilState(quint64, float, float, float, float,float, float, double, double, double, float, float, float, float, float, float, float, float))); disconnect(_vehicle->uas(), &UAS::hilControlsChanged, this, &QGCFlightGearLink::updateControls);
disconnect(this, SIGNAL(sensorHilGpsChanged(quint64, double, double, double, int, float, float, float, float, float, float, float, int)), _vehicle->uas(), SLOT(sendHilGps(quint64, double, double, double, int, float, float, float, float, float, float, float, int)));
disconnect(this, SIGNAL(sensorHilRawImuChanged(quint64,float,float,float,float,float,float,float,float,float,float,float,float,float,quint32)), _vehicle->uas(), SLOT(sendHilSensors(quint64,float,float,float,float,float,float,float,float,float,float,float,float,float,quint32))); disconnect(this, &QGCFlightGearLink::hilStateChanged, _vehicle->uas(), &UAS::sendHilState);
disconnect(this, SIGNAL(sensorHilOpticalFlowChanged(quint64, qint16, qint16, float,float, quint8, float)), disconnect(this, &QGCFlightGearLink::sensorHilGpsChanged, _vehicle->uas(), &UAS::sendHilGps);
_vehicle->uas(), SLOT(sendHilOpticalFlow(quint64, qint16, qint16, float, float, quint8, float))); disconnect(this, &QGCFlightGearLink::sensorHilRawImuChanged, _vehicle->uas(), &UAS::sendHilSensors);
disconnect(this, &QGCFlightGearLink::sensorHilOpticalFlowChanged, _vehicle->uas(), &UAS::sendHilOpticalFlow);
if (_fgProcess) if (_fgProcess)
{ {
......
...@@ -80,20 +80,19 @@ void QGCJSBSimLink::run() ...@@ -80,20 +80,19 @@ void QGCJSBSimLink::run()
socket->moveToThread(this); socket->moveToThread(this);
connectState = socket->bind(host, port, QAbstractSocket::ReuseAddressHint); connectState = socket->bind(host, port, QAbstractSocket::ReuseAddressHint);
QObject::connect(socket, SIGNAL(readyRead()), this, SLOT(readBytes())); QObject::connect(socket, &QUdpSocket::readyRead, this, &QGCJSBSimLink::readBytes);
process = new QProcess(this); process = new QProcess(this);
connect(_vehicle->uas(), SIGNAL(hilControlsChanged(quint64, float, float, float, float, quint8, quint8)), this, SLOT(updateControls(quint64,float,float,float,float,quint8,quint8))); connect(_vehicle->uas(), &UAS::hilControlsChanged, this, &QGCJSBSimLink::updateControls);
connect(this, SIGNAL(hilStateChanged(quint64,float,float,float,float,float,float,double,double,double,float,float,float,float,float,float,float,float)), _vehicle->uas(), SLOT(sendHilState(quint64,float,float,float,float,float,float,double,double,double,float,float,float,float,float,float,float,float))); connect(this, &QGCJSBSimLink::hilStateChanged, _vehicle->uas(), &UAS::sendHilState);
_vehicle->uas()->startHil(); _vehicle->uas()->startHil();
//connect(&refreshTimer, SIGNAL(timeout()), this, SLOT(sendUAVUpdate())); //connect(&refreshTimer, SIGNAL(timeout()), this, SLOT(sendUAVUpdate()));
// Catch process error // Catch process error
QObject::connect( process, SIGNAL(error(QProcess::ProcessError)), connect(process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
this, SLOT(processError(QProcess::ProcessError))); this, &QGCJSBSimLink::processError);
// Start Flightgear // Start Flightgear
QStringList arguments; QStringList arguments;
...@@ -358,10 +357,10 @@ qint64 QGCJSBSimLink::bytesAvailable() ...@@ -358,10 +357,10 @@ qint64 QGCJSBSimLink::bytesAvailable()
**/ **/
bool QGCJSBSimLink::disconnectSimulation() bool QGCJSBSimLink::disconnectSimulation()
{ {
disconnect(process, SIGNAL(error(QProcess::ProcessError)), disconnect(_vehicle->uas(), &UAS::hilControlsChanged, this, &QGCJSBSimLink::updateControls);
this, SLOT(processError(QProcess::ProcessError))); disconnect(this, &QGCJSBSimLink::hilStateChanged, _vehicle->uas(), &UAS::sendHilState);
disconnect(_vehicle->uas(), SIGNAL(hilControlsChanged(quint64, float, float, float, float, quint8, quint8)), this, SLOT(updateControls(quint64,float,float,float,float,quint8,quint8))); disconnect(process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
disconnect(this, SIGNAL(hilStateChanged(quint64,float,float,float,float,float,float,double,double,double,float,float,float,float,float,float,float,float)), _vehicle->uas(), SLOT(sendHilState(quint64,float,float,float,float,float,float,double,double,double,float,float,float,float,float,float,float,float))); this, &QGCJSBSimLink::processError);
if (process) if (process)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment