-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfrequencypoller.cpp
More file actions
26 lines (22 loc) · 1.01 KB
/
frequencypoller.cpp
File metadata and controls
26 lines (22 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "frequencypoller.h"
#include "mainwindow.h"
FrequencyPoller::FrequencyPoller(QObject *parent)
: QObject{parent}
{
qDebug() << "FrequencyPoller constructor called";
poll_timer = new QTimer(this);
/* connect(sender, &Sender::valueChanged, receiver, &Receiver::updateValue); */
connect(poll_timer, &QTimer::timeout, this, QOverload<>::of(&FrequencyPoller::poll_rig_frequency) );
/* Connect this FreqPoller object to the hamlib connector slot */
MainWindow* pMainWindow = static_cast<MainWindow *>(parent);
connect(this, &FrequencyPoller::freq_ready, pMainWindow->getHamlibPointer(), &HamlibConnector::autoupdate_frequency);
connect(this, &FrequencyPoller::smeter_ready, pMainWindow->getHamlibPointer(), &HamlibConnector::autoupdate_smeter);
poll_timer->start(250);
}
// Slot - timer connected to this one
void FrequencyPoller::poll_rig_frequency() {
// static int i = 0;
// qDebug() << "poll_rig_frequency() called " << i++;
// emit freq_ready();
emit smeter_ready();
}