1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 08:04:49 -05:00

Compare commits

..

No commits in common. "31330cc14f2acd3ae7b7a693747a3685f2c4b9e8" and "ad74a9294e50faa59723013f92377cea45043810" have entirely different histories.

25 changed files with 19 additions and 117 deletions

View File

@ -52,7 +52,6 @@ AFC::AFC(WebAPIAdapterInterface *webAPIAdapterInterface) :
{
setObjectName(m_featureId);
m_worker = new AFCWorker(webAPIAdapterInterface);
m_worker->moveToThread(&m_thread);
m_state = StIdle;
m_errorMessage = "AFC error";
m_networkManager = new QNetworkAccessManager();

View File

@ -46,7 +46,6 @@ AFCWorker::AFCWorker(WebAPIAdapterInterface *webAPIAdapterInterface) :
m_freqTracker(nullptr),
m_trackerDeviceFrequency(0),
m_trackerChannelOffset(0),
m_updateTimer(this),
m_mutex(QMutex::Recursive)
{
qDebug("AFCWorker::AFCWorker");

View File

@ -46,7 +46,6 @@ APRS::APRS(WebAPIAdapterInterface *webAPIAdapterInterface) :
qDebug("APRS::APRS: webAPIAdapterInterface: %p", webAPIAdapterInterface);
setObjectName(m_featureId);
m_worker = new APRSWorker(this, webAPIAdapterInterface);
m_worker->moveToThread(&m_thread);
m_state = StIdle;
m_errorMessage = "APRS error";
connect(&m_updatePipesTimer, SIGNAL(timeout()), this, SLOT(updatePipes()));

View File

@ -522,7 +522,6 @@ APRSGUI::APRSGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feat
connect(ui->motionTable->horizontalHeader(), SIGNAL(sectionMoved(int, int, int)), SLOT(motionTable_sectionMoved(int, int, int)));
connect(ui->motionTable->horizontalHeader(), SIGNAL(sectionResized(int, int, int)), SLOT(motionTable_sectionResized(int, int, int)));
m_weatherChart.setTheme(QChart::ChartThemeDark);
m_weatherChart.legend()->hide();
ui->weatherChart->setChart(&m_weatherChart);
ui->weatherChart->setRenderHint(QPainter::Antialiasing);
@ -531,7 +530,6 @@ APRSGUI::APRSGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feat
m_weatherChart.layout()->setContentsMargins(0, 0, 0, 0);
m_weatherChart.setMargins(QMargins(1, 1, 1, 1));
m_telemetryChart.setTheme(QChart::ChartThemeDark);
m_telemetryChart.legend()->hide();
ui->telemetryChart->setChart(&m_telemetryChart);
ui->telemetryChart->setRenderHint(QPainter::Antialiasing);
@ -540,7 +538,6 @@ APRSGUI::APRSGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feat
m_telemetryChart.layout()->setContentsMargins(0, 0, 0, 0);
m_telemetryChart.setMargins(QMargins(1, 1, 1, 1));
m_motionChart.setTheme(QChart::ChartThemeDark);
m_motionChart.legend()->hide();
ui->motionChart->setChart(&m_motionChart);
ui->motionChart->setRenderHint(QPainter::Antialiasing);

View File

@ -38,8 +38,7 @@ APRSWorker::APRSWorker(APRS *aprs, WebAPIAdapterInterface *webAPIAdapterInterfac
m_msgQueueToFeature(nullptr),
m_msgQueueToGUI(nullptr),
m_running(false),
m_mutex(QMutex::Recursive),
m_socket(this)
m_mutex(QMutex::Recursive)
{
connect(&m_socket, SIGNAL(readyRead()),this, SLOT(recv()));
connect(&m_socket, SIGNAL(connected()), this, SLOT(connected()));
@ -66,32 +65,18 @@ bool APRSWorker::startWork()
{
QMutexLocker mutexLocker(&m_mutex);
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
connect(thread(), SIGNAL(started()), this, SLOT(started()));
connect(thread(), SIGNAL(finished()), this, SLOT(finished()));
m_running = true;
return m_running;
}
// startWork() is called from main thread. Timers need to be started on worker thread
void APRSWorker::started()
{
disconnect(thread(), SIGNAL(started()), this, SLOT(started()));
}
void APRSWorker::stopWork()
{
QMutexLocker mutexLocker(&m_mutex);
disconnect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
}
void APRSWorker::finished()
{
// Close any existing connection
if (m_socket.isOpen()) {
m_socket.close();
}
m_running = false;
disconnect(thread(), SIGNAL(finished()), this, SLOT(finished()));
// Close any existing connection
if (m_socket.isOpen())
m_socket.close();
}
void APRSWorker::handleInputMessages()

View File

@ -20,6 +20,7 @@
#define INCLUDE_FEATURE_APRSWORKER_H_
#include <QObject>
#include <QTimer>
#include <QTcpSocket>
#include "util/message.h"
@ -86,8 +87,6 @@ private:
void send(const char *data, int length);
private slots:
void started();
void finished();
void handleInputMessages();
void connected();
void disconnected();

View File

@ -55,7 +55,6 @@ DemodAnalyzer::DemodAnalyzer(WebAPIAdapterInterface *webAPIAdapterInterface) :
qDebug("DemodAnalyzer::DemodAnalyzer: webAPIAdapterInterface: %p", webAPIAdapterInterface);
setObjectName(m_featureId);
m_worker = new DemodAnalyzerWorker();
m_worker->moveToThread(&m_thread);
m_worker->setScopeVis(&m_scopeVis);
m_state = StIdle;
m_errorMessage = "DemodAnalyzer error";

View File

@ -52,7 +52,6 @@ GS232Controller::GS232Controller(WebAPIAdapterInterface *webAPIAdapterInterface)
qDebug("GS232Controller::GS232Controller: webAPIAdapterInterface: %p", webAPIAdapterInterface);
setObjectName(m_featureId);
m_worker = new GS232ControllerWorker();
m_worker->moveToThread(&m_thread);
m_state = StIdle;
m_errorMessage = "GS232Controller error";
m_selectedPipe = nullptr;

View File

@ -20,6 +20,7 @@
#include <cmath>
#include <QDebug>
#include <QTimer>
#include <QSerialPort>
#include <QRegularExpression>
@ -35,9 +36,6 @@ GS232ControllerWorker::GS232ControllerWorker() :
m_running(false),
m_mutex(QMutex::Recursive),
m_device(nullptr),
m_serialPort(this),
m_socket(this),
m_pollTimer(this),
m_lastAzimuth(-1.0f),
m_lastElevation(-1.0f),
m_spidSetOutstanding(false),

View File

@ -52,7 +52,6 @@ PERTester::PERTester(WebAPIAdapterInterface *webAPIAdapterInterface) :
qDebug("PERTester::PERTester: webAPIAdapterInterface: %p", webAPIAdapterInterface);
setObjectName(m_featureId);
m_worker = new PERTesterWorker();
m_worker->moveToThread(&m_thread);
m_state = StIdle;
m_errorMessage = "PERTester error";
m_networkManager = new QNetworkAccessManager();
@ -131,9 +130,7 @@ bool PERTester::handleMessage(const Message& cmd)
{
MsgReportWorker& report = (MsgReportWorker&) cmd;
if (report.getMessage() == "Complete")
{
stop();
}
m_state = StIdle;
else
{
m_state = StError;

View File

@ -42,8 +42,6 @@ PERTesterWorker::PERTesterWorker() :
m_running(false),
m_mutex(QMutex::Recursive),
m_rxUDPSocket(nullptr),
m_txUDPSocket(this),
m_txTimer(this),
m_tx(0),
m_rxMatched(0),
m_rxUnmatched(0)
@ -68,35 +66,22 @@ bool PERTesterWorker::startWork()
{
qDebug() << "PERTesterWorker::startWork";
QMutexLocker mutexLocker(&m_mutex);
connect(thread(), SIGNAL(started()), this, SLOT(started()));
connect(thread(), SIGNAL(finished()), this, SLOT(finished()));
m_running = true;
return m_running;
}
// startWork() is called from main thread. Timers/sockets need to be started on worker thread
void PERTesterWorker::started()
{
openUDP(m_settings);
// Automatically restart if previous run had finished, otherwise continue
if (m_tx >= m_settings.m_packetCount)
resetStats();
connect(&m_txTimer, SIGNAL(timeout()), this, SLOT(tx()));
m_txTimer.start(m_settings.m_interval * 1000.0);
disconnect(thread(), SIGNAL(started()), this, SLOT(started()));
m_running = true;
return m_running;
}
void PERTesterWorker::stopWork()
{
qDebug() << "PERTesterWorker::stopWork";
}
void PERTesterWorker::finished()
{
QMutexLocker mutexLocker(&m_mutex);
m_txTimer.stop();
closeUDP();
disconnect(&m_txTimer, SIGNAL(timeout()), this, SLOT(tx()));
disconnect(thread(), SIGNAL(finished()), this, SLOT(finished()));
m_running = false;
}
@ -329,6 +314,7 @@ void PERTesterWorker::tx()
void PERTesterWorker::testComplete()
{
stopWork();
if (m_msgQueueToFeature != nullptr)
m_msgQueueToFeature->push(PERTester::MsgReportWorker::create("Complete"));
qDebug() << "PERTesterWorker::tx: Test complete";

View File

@ -89,8 +89,6 @@ private:
void resetStats();
private slots:
void started();
void finished();
void handleInputMessages();
void rx();
void tx();

View File

@ -43,7 +43,6 @@ RigCtlServer::RigCtlServer(WebAPIAdapterInterface *webAPIAdapterInterface) :
qDebug("RigCtlServer::RigCtlServer: webAPIAdapterInterface: %p", webAPIAdapterInterface);
setObjectName(m_featureId);
m_worker = new RigCtlServerWorker(webAPIAdapterInterface);
m_worker->moveToThread(&m_thread);
m_state = StIdle;
m_errorMessage = "RigCtlServer error";
m_networkManager = new QNetworkAccessManager();

View File

@ -20,6 +20,7 @@
#define INCLUDE_FEATURE_RIGCTLSERVERWORKER_H_
#include <QObject>
#include <QTimer>
#include "util/message.h"
#include "util/messagequeue.h"

View File

@ -51,7 +51,6 @@ SatelliteTracker::SatelliteTracker(WebAPIAdapterInterface *webAPIAdapterInterfac
qDebug("SatelliteTracker::SatelliteTracker: webAPIAdapterInterface: %p", webAPIAdapterInterface);
setObjectName(m_featureId);
m_worker = new SatelliteTrackerWorker(this, webAPIAdapterInterface);
m_worker->moveToThread(&m_thread);
m_state = StIdle;
m_errorMessage = "SatelliteTracker error";
m_networkManager = new QNetworkAccessManager();

View File

@ -57,7 +57,6 @@ SatelliteTrackerWorker::SatelliteTrackerWorker(SatelliteTracker* satelliteTracke
m_msgQueueToGUI(nullptr),
m_running(false),
m_mutex(QMutex::Recursive),
m_pollTimer(this),
m_recalculatePasses(true),
m_flipRotation(false),
m_extendedAzRotation(false)
@ -80,16 +79,6 @@ bool SatelliteTrackerWorker::startWork()
{
QMutexLocker mutexLocker(&m_mutex);
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
connect(thread(), SIGNAL(started()), this, SLOT(started()));
connect(thread(), SIGNAL(finished()), this, SLOT(finished()));
m_recalculatePasses = true;
m_running = true;
return m_running;
}
// startWork() is called from main thread. Timers need to be started on worker thread
void SatelliteTrackerWorker::started()
{
m_pollTimer.start((int)round(m_settings.m_updatePeriod*1000.0));
// Resume doppler timers
QHashIterator<QString, SatWorkerState *> itr(m_workerState);
@ -100,17 +89,15 @@ void SatelliteTrackerWorker::started()
if (satWorkerState->m_dopplerTimer.interval() > 0)
satWorkerState->m_dopplerTimer.start();
}
disconnect(thread(), SIGNAL(started()), this, SLOT(started()));
m_recalculatePasses = true;
m_running = true;
return m_running;
}
void SatelliteTrackerWorker::stopWork()
{
QMutexLocker mutexLocker(&m_mutex);
disconnect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
}
void SatelliteTrackerWorker::finished()
{
m_pollTimer.stop();
// Stop doppler timers
QHashIterator<QString, SatWorkerState *> itr(m_workerState);
@ -120,7 +107,6 @@ void SatelliteTrackerWorker::finished()
itr.value()->m_dopplerTimer.stop();
}
m_running = false;
disconnect(thread(), SIGNAL(finished()), this, SLOT(finished()));
}
void SatelliteTrackerWorker::handleInputMessages()

View File

@ -130,8 +130,6 @@ private:
void calculateRotation(SatWorkerState *satWorkerState);
private slots:
void started();
void finished();
void handleInputMessages();
void update();
void aos(SatWorkerState *satWorkerState);

View File

@ -44,7 +44,6 @@ SimplePTT::SimplePTT(WebAPIAdapterInterface *webAPIAdapterInterface) :
{
setObjectName(m_featureId);
m_worker = new SimplePTTWorker(webAPIAdapterInterface);
m_worker->moveToThread(&m_thread);
m_state = StIdle;
m_errorMessage = "SimplePTT error";
m_networkManager = new QNetworkAccessManager();

View File

@ -34,7 +34,6 @@ SimplePTTWorker::SimplePTTWorker(WebAPIAdapterInterface *webAPIAdapterInterface)
m_msgQueueToGUI(nullptr),
m_running(false),
m_tx(false),
m_updateTimer(this),
m_mutex(QMutex::Recursive)
{
qDebug("SimplePTTWorker::SimplePTTWorker");

View File

@ -49,7 +49,6 @@ StarTracker::StarTracker(WebAPIAdapterInterface *webAPIAdapterInterface) :
qDebug("StarTracker::StarTracker: webAPIAdapterInterface: %p", webAPIAdapterInterface);
setObjectName(m_featureId);
m_worker = new StarTrackerWorker(this, webAPIAdapterInterface);
m_worker->moveToThread(&m_thread);
m_state = StIdle;
m_errorMessage = "StarTracker error";
connect(&m_updatePipesTimer, SIGNAL(timeout()), this, SLOT(updatePipes()));

View File

@ -52,7 +52,6 @@ StarTrackerWorker::StarTrackerWorker(StarTracker* starTracker, WebAPIAdapterInte
m_msgQueueToGUI(nullptr),
m_running(false),
m_mutex(QMutex::Recursive),
m_pollTimer(this),
m_tcpServer(nullptr),
m_clientConnection(nullptr),
m_solarFlux(0.0f)
@ -75,30 +74,17 @@ bool StarTrackerWorker::startWork()
{
QMutexLocker mutexLocker(&m_mutex);
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
connect(thread(), SIGNAL(started()), this, SLOT(started()));
connect(thread(), SIGNAL(finished()), this, SLOT(finished()));
m_pollTimer.start((int)round(m_settings.m_updatePeriod*1000.0));
m_running = true;
return m_running;
}
// startWork() is called from main thread. Timers/sockets need to be started on worker thread
void StarTrackerWorker::started()
{
m_pollTimer.start((int)round(m_settings.m_updatePeriod*1000.0));
disconnect(thread(), SIGNAL(started()), this, SLOT(started()));
}
void StarTrackerWorker::stopWork()
{
QMutexLocker mutexLocker(&m_mutex);
disconnect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
}
void StarTrackerWorker::finished()
{
restartServer(false, 0);
m_pollTimer.stop();
disconnect(thread(), SIGNAL(finished()), this, SLOT(finished()));
m_running = false;
}

View File

@ -97,8 +97,6 @@ private:
void sendToMap(QList<MessageQueue*> *mapMessageQueues, QString id, QString image, QString text, double lat, double lon, double rotation=0.0);
private slots:
void started();
void finished();
void handleInputMessages();
void update();
void acceptConnection();

View File

@ -51,7 +51,6 @@ VORLocalizer::VORLocalizer(WebAPIAdapterInterface *webAPIAdapterInterface) :
{
setObjectName(m_featureId);
m_worker = new VorLocalizerWorker(webAPIAdapterInterface);
m_worker->moveToThread(&m_thread);
m_state = StIdle;
m_errorMessage = "VORLocalizer error";
m_networkManager = new QNetworkAccessManager();

View File

@ -42,9 +42,7 @@ VorLocalizerWorker::VorLocalizerWorker(WebAPIAdapterInterface *webAPIAdapterInte
m_msgQueueToFeature(nullptr),
m_availableChannels(nullptr),
m_running(false),
m_updateTimer(this),
m_mutex(QMutex::Recursive),
m_rrTimer(this)
m_mutex(QMutex::Recursive)
{
qDebug("VorLocalizerWorker::VorLocalizerWorker");
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
@ -66,29 +64,17 @@ bool VorLocalizerWorker::startWork()
QMutexLocker mutexLocker(&m_mutex);
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
connect(&m_rrTimer, SIGNAL(timeout()), this, SLOT(rrNextTurn()));
connect(thread(), SIGNAL(started()), this, SLOT(started()));
connect(thread(), SIGNAL(finished()), this, SLOT(finished()));
m_rrTimer.start(m_settings.m_rrTime * 1000);
m_running = true;
return m_running;
}
// startWork() is called from main thread. Timers/sockets need to be started on worker thread
void VorLocalizerWorker::started()
{
m_rrTimer.start(m_settings.m_rrTime * 1000);
disconnect(thread(), SIGNAL(started()), this, SLOT(started()));
}
void VorLocalizerWorker::stopWork()
{
QMutexLocker mutexLocker(&m_mutex);
disconnect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
}
void VorLocalizerWorker::finished()
{
m_rrTimer.stop();
disconnect(&m_rrTimer, SIGNAL(timeout()), this, SLOT(rrNextTurn()));
disconnect(thread(), SIGNAL(finished()), this, SLOT(finished()));
disconnect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
m_running = false;
}

View File

@ -167,8 +167,6 @@ private:
static void getChannelsByDevice(const QHash<ChannelAPI*, VORLocalizerSettings::AvailableChannel> *availableChannels, std::vector<RRTurnPlan>& m_deviceChannels);
private slots:
void started();
void finished();
void handleInputMessages();
void updateHardware();
void rrNextTurn();