-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainclass.cpp
68 lines (62 loc) · 2.61 KB
/
mainclass.cpp
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
66
/***************************************************************************
mainclass.cpp - description
-------------------
begin : aug 2021
copyright : (C) 2021 by Jaime Robles
user : jaime@robles.es
***************************************************************************/
/*****************************************************************************
* This file is part of KLogServer *
* *
* KLogsServer is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* KLogserver is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with KLogServer. If not, see <https://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include "mainclass.h"
MainClass::MainClass(QObject *parent) : QObject(parent)
{
fileManager = new FileManager;
udpserver = new UDPServer;
udpserver->setNetworkInterface("lo0");
//udpserver->setPort (12060);
udpserver->setPort (2237);
if (udpserver->start())
{
qDebug() << Q_FUNC_INFO << ": Started OK";
}
else
{
qDebug() << Q_FUNC_INFO << ": Start NOK";
}
//Qt::ConnectionType ctype = Qt::DirectConnection;
//connect(udpserver, SIGNAL(logged_qso(QSO)), this, SLOT(slotWSJTXQSOReceived(QSO)), ctype);
}
void MainClass::setPort (const int _p)
{
if (udpserver->setPort (_p))
{
udpserver->stop();
udpserver->start();
}
}
void MainClass::setInterface (const QString &_i)
{
if (_i.length ()>0)
{
if (udpserver->setNetworkInterface (_i))
{
udpserver->stop();
udpserver->start();
}
}
}