From 5ebf6f8b0b77730c3f3cc0a90bd924dd9c170276 Mon Sep 17 00:00:00 2001 From: NielsCoding Date: Sun, 30 Oct 2022 21:58:08 +0100 Subject: refresh automatic --- client/Client.cpp | 3 + client/Client.h | 3 +- client/client.pro.user | 260 +++++++++++++++++++++++++++++++++++++++++++++++++ client/mainwindow.cpp | 8 +- 4 files changed, 272 insertions(+), 2 deletions(-) create mode 100644 client/client.pro.user (limited to 'client') diff --git a/client/Client.cpp b/client/Client.cpp index cf4b3eb..16b9bf3 100644 --- a/client/Client.cpp +++ b/client/Client.cpp @@ -34,6 +34,7 @@ void Client::ClientEcho() { connect(socket, &QTcpSocket::disconnected, [&]() { socket->disconnectFromHost(); lineCounter = 0; + refreshChart=true; }); timer->start(1000); @@ -52,6 +53,8 @@ void Client::timeFunction() { socket->connectToHost(networkAddress, tcpPortAddress); socket->write(msgToSend); + + } void Client::missingRecords() { diff --git a/client/Client.h b/client/Client.h index 433aecf..cb6e6b8 100644 --- a/client/Client.h +++ b/client/Client.h @@ -21,7 +21,7 @@ public: 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 - + bool refreshChart; private: void missingRecords(); @@ -37,6 +37,7 @@ private: uint8_t totalRecords = 1; // total records to ask wheather station uint8_t offsetRecords = 0; // offset from reqeusting records + }; #endif // CLIENT_H diff --git a/client/client.pro.user b/client/client.pro.user new file mode 100644 index 0000000..0490100 --- /dev/null +++ b/client/client.pro.user @@ -0,0 +1,260 @@ + + + + + + EnvironmentId + {aa240e53-c124-4cf0-84a8-30bfe8a2cf83} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + false + true + false + 0 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + true + true + Builtin.DefaultTidyAndClazy + 4 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop Qt 6.4.0 MinGW 64-bit + Desktop Qt 6.4.0 MinGW 64-bit + qt.qt6.640.win64_mingw_kit + 0 + 0 + 0 + + 0 + D:\Github2\avans-whether-station\build-client-Desktop_Qt_6_4_0_MinGW_64_bit-Debug + D:/Github2/avans-whether-station/build-client-Desktop_Qt_6_4_0_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + D:\Github2\avans-whether-station\build-client-Desktop_Qt_6_4_0_MinGW_64_bit-Release + D:/Github2/avans-whether-station/build-client-Desktop_Qt_6_4_0_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + + + 0 + D:\Github2\avans-whether-station\build-client-Desktop_Qt_6_4_0_MinGW_64_bit-Profile + D:/Github2/avans-whether-station/build-client-Desktop_Qt_6_4_0_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + true + + 2 + + ProjectExplorer.CustomExecutableRunConfiguration + + false + true + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp index dcffed6..6f2337d 100644 --- a/client/mainwindow.cpp +++ b/client/mainwindow.cpp @@ -25,6 +25,12 @@ MainWindow::~MainWindow() void MainWindow::timeFunction() { client.timeFunction(); + if(client.refreshChart==true){ + drawGraph(); + client.refreshChart=false; + } + + } void MainWindow::on_actionConnection_triggered() @@ -35,7 +41,7 @@ void MainWindow::on_actionConnection_triggered() void MainWindow::on_actionRefresh_triggered() { - drawGraph(); + // drawGraph(); } void MainWindow::on_actionDisconnenct_triggered() -- cgit v1.2.3