Repository navigation
Expand file tree
/
Copy pathhtra_server_main_timer.cpp
More file actions
65 lines (54 loc) · 2.34 KB
/
Copy pathhtra_server_main_timer.cpp
File metadata and controls
65 lines (54 loc) · 2.34 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include "htra_server_main_timer.h"
HtraServerMainTimer::HtraServerMainTimer(
IHtraDevice &device,
QObject *parent) :
QObject(parent),
m_device(device),
provider(m_device),
builder(),
packetSource(builder, provider) {
htraTelemetryServer = new HtraTelemetryServer(
QCoreApplication::applicationDirPath() +
"/etc/client_server/config.ini",
"HtraTelemetryServer",
100,
packetSource,
this
);
proxyServer = new HtraProxyServer(
QCoreApplication::applicationDirPath() +
"/etc/client_server/config.ini",
"HtraProxyServer",
m_device,
this);
connect(&m_device, SIGNAL(translateDataReady()), htraTelemetryServer, SLOT(sendTelemetry()));
m_loggerTimer = new QTimer(this);
m_loggerTimer->setInterval(250);
connect(m_loggerTimer, SIGNAL(timeout()), SLOT(onLogerTimer()));
m_loggerTimer->start();
}
void HtraServerMainTimer::onLogerTimer() {
QString text;
text += "--------------------------------------\n";
text += QString::asprintf("Center freq : %f\n", m_device.centerFreq());
text += QString::asprintf("Level : %f\n", m_device.level());
text += QString::asprintf("Span : %f\n", m_device.span());
text += QString::asprintf("RBW : %f\n", m_device.rbw());
text += QString::asprintf("VBW : %f\n", m_device.vbw());
text += QString::asprintf("Count : %d\n", m_device.sweepCount());
text += "--------------------------------------\n";
text += QString::asprintf("Type pick : %s\n",
PowerPickType::getPickSearchType(m_device.pickSearchType())
.toLatin1()
.data());
text += QString::asprintf("Center pick freq : %f\n", m_device.pickSearchCenter());
text += QString::asprintf("Width pick : %f\n", m_device.pickSearchWidth());
text += QString::asprintf("Pick level : %f\n", m_device.pick());
text += "--------------------------------------\n";
text += QString::asprintf("Per try : %f\n", m_device.perTry());
text += "Switch Mode : " + proxyServer->RFprocessor->mode + "\n";
text += "--------------------------------------\n";
QTextStream out(stdout);
out << text;
out.flush();
}