diff options
author | UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> | 2022-10-30 10:57:11 +0100 |
---|---|---|
committer | UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> | 2022-10-30 10:57:50 +0100 |
commit | 8952e19f00e0930e53e3731fd30be5e2600d9fd6 (patch) | |
tree | 2770bfd4319402c88b6872d1f8699252329c6603 /client/Client.h | |
parent | 6d9df6fe97502a852b68c8c8e6781d7208170cae (diff) | |
parent | 60f954dbaa399f8f0bcaeeb307953fc3b37b9dc7 (diff) |
finish merge
Diffstat (limited to 'client/Client.h')
-rw-r--r-- | client/Client.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/client/Client.h b/client/Client.h new file mode 100644 index 0000000..10af3e1 --- /dev/null +++ b/client/Client.h @@ -0,0 +1,45 @@ +#ifndef CLIENT_H +#define CLIENT_H +#include <QTcpSocket> +#include <QTextStream> +#include <QTimer> +#include <QDateTime> +#include <QSqlQuery> + +#include "HandleMessage.h" + +// class client for wheather station +class Client : public QObject +{ + Q_OBJECT +public: + Client(QObject *parent = 0); + virtual ~Client(); + +public slots: + void ClientEcho(); // function to ask data from wheather station + void timeFunction(); // function to look every second what time currently is en handle if minute is passed + +private: + void missingRecords(); + + int _missingRecords; + QTcpSocket *socket; // tcpsocket for communicating + QTimer *timer; // timer to read every second what time it curruntly is. + + qint16 NextMinute; // timing for next minute + // qint16 currentMinute; // timing for currentMinute + HandleMessage Handlemsg; // add HandleMessage to Client.h + + int tcpPortAddress = 80; // port of communication via tcp + QString networkAddress = "192.168.137.76"; // network address for commincation via tcp + + QString msg = "last-records "; // part of mesage to send to wheather staion + char totalRecords = '1'; // total records to ask wheather station + char offsetRecords = '0'; // offset from reqeusting records + + + +}; + +#endif // CLIENT_H |