diff --git a/ground/openpilotgcs/src/plugins/hitlv2/aerosimrc/src/plugin.cpp b/ground/openpilotgcs/src/plugins/hitlv2/aerosimrc/src/plugin.cpp index e2100f608..18ba2c15d 100644 --- a/ground/openpilotgcs/src/plugins/hitlv2/aerosimrc/src/plugin.cpp +++ b/ground/openpilotgcs/src/plugins/hitlv2/aerosimrc/src/plugin.cpp @@ -40,7 +40,7 @@ QList videoModes; QTime ledTimer; UdpSender *sndr; -UdpReciever *rcvr; +UdpReceiver *rcvr; const float RAD2DEG = (float)(180.0 / M_PI); const float DEG2RAD = (float)(M_PI / 180.0); @@ -104,7 +104,7 @@ SIM_DLL_EXPORT void AeroSIMRC_Plugin_Init(pluginInit *p) sndr = new UdpSender(ini->getOutputMap(), ini->isFromTX()); sndr->init(ini->remoteHost(), ini->remotePort()); - rcvr = new UdpReciever(ini->getInputMap(), ini->isToRX()); + rcvr = new UdpReceiver(ini->getInputMap(), ini->isToRX()); rcvr->init(ini->localHost(), ini->localPort()); // run thread diff --git a/ground/openpilotgcs/src/plugins/hitlv2/aerosimrc/src/udpconnect.cpp b/ground/openpilotgcs/src/plugins/hitlv2/aerosimrc/src/udpconnect.cpp index 06e77b163..0448a705a 100644 --- a/ground/openpilotgcs/src/plugins/hitlv2/aerosimrc/src/udpconnect.cpp +++ b/ground/openpilotgcs/src/plugins/hitlv2/aerosimrc/src/udpconnect.cpp @@ -112,12 +112,12 @@ void UdpSender::sendDatagram(const simToPlugin *stp) //----------------------------------------------------------------------------- -UdpReciever::UdpReciever(const QList map, +UdpReceiver::UdpReceiver(const QList map, bool isRX, QObject *parent) : QThread(parent) { - qDebug() << this << "UdpReciever::UdpReciever thread:" << thread(); + qDebug() << this << "UdpReceiver::UdpReceiver thread:" << thread(); stopped = false; inSocket = NULL; @@ -130,17 +130,17 @@ UdpReciever::UdpReciever(const QList map, packetsRecived = 1; } -UdpReciever::~UdpReciever() +UdpReceiver::~UdpReceiver() { - qDebug() << this << "UdpReciever::~UdpReciever"; + qDebug() << this << "UdpReceiver::~UdpReceiver"; if (inSocket) delete inSocket; } // public -void UdpReciever::init(const QString &localHost, quint16 localPort) +void UdpReceiver::init(const QString &localHost, quint16 localPort) { - qDebug() << this << "UdpReciever::init"; + qDebug() << this << "UdpReceiver::init"; inSocket = new QUdpSocket(); qDebug() << this << "inSocket constructed" << inSocket->thread(); @@ -148,21 +148,21 @@ void UdpReciever::init(const QString &localHost, quint16 localPort) inSocket->bind(QHostAddress(localHost), localPort); } -void UdpReciever::run() +void UdpReceiver::run() { - qDebug() << this << "UdpReciever::run start"; + qDebug() << this << "UdpReceiver::run start"; while (!stopped) onReadyRead(); - qDebug() << this << "UdpReciever::run ended"; + qDebug() << this << "UdpReceiver::run ended"; } -void UdpReciever::stop() +void UdpReceiver::stop() { - qDebug() << this << "UdpReciever::stop"; + qDebug() << this << "UdpReceiver::stop"; stopped = true; } -void UdpReciever::setChannels(pluginToSim *pts) +void UdpReceiver::setChannels(pluginToSim *pts) { QMutexLocker locker(&mutex); @@ -183,7 +183,7 @@ void UdpReciever::setChannels(pluginToSim *pts) } } -void UdpReciever::getFlighStatus(quint8 &arm, quint8 &mod) +void UdpReceiver::getFlighStatus(quint8 &arm, quint8 &mod) { QMutexLocker locker(&mutex); @@ -192,7 +192,7 @@ void UdpReciever::getFlighStatus(quint8 &arm, quint8 &mod) } // private -void UdpReciever::onReadyRead() +void UdpReceiver::onReadyRead() { if (!inSocket->waitForReadyRead(8)) // 1/60fps ~= 16.7ms, 1/120fps ~= 8.3ms return; @@ -209,7 +209,7 @@ void UdpReciever::onReadyRead() } } -void UdpReciever::processDatagram(QByteArray &datagram) +void UdpReceiver::processDatagram(QByteArray &datagram) { QDataStream stream(datagram); stream.setFloatingPointPrecision(QDataStream::SinglePrecision); diff --git a/ground/openpilotgcs/src/plugins/hitlv2/aerosimrc/src/udpconnect.h b/ground/openpilotgcs/src/plugins/hitlv2/aerosimrc/src/udpconnect.h index 82b944e77..ead07f046 100644 --- a/ground/openpilotgcs/src/plugins/hitlv2/aerosimrc/src/udpconnect.h +++ b/ground/openpilotgcs/src/plugins/hitlv2/aerosimrc/src/udpconnect.h @@ -57,12 +57,12 @@ private: }; -class UdpReciever : public QThread +class UdpReceiver : public QThread { // Q_OBJECT public: - explicit UdpReciever(const QList map, bool isRX, QObject *parent = 0); - ~UdpReciever(); + explicit UdpReceiver(const QList map, bool isRX, QObject *parent = 0); + ~UdpReceiver(); void init(const QString &localHost, quint16 localPort); void run(); void stop();