From 7fe10f756bc2d76a57f28a0350539ae2b614a3ae Mon Sep 17 00:00:00 2001 From: UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> Date: Sun, 30 Oct 2022 17:34:33 +0100 Subject: removed hardcoded `WSdb` --- .gitignore | 1 + client/Client.cpp | 2 +- client/HandleMessage.cpp | 3 +- client/client.pro.user | 260 +++++++++++++++++++++++++++++++++++++++++++++++ client/consts.h | 2 + client/dbconnector.cpp | 8 ++ client/dbconnector.h | 6 +- client/mainwindow.cpp | 3 - 8 files changed, 277 insertions(+), 8 deletions(-) create mode 100644 client/client.pro.user diff --git a/.gitignore b/.gitignore index e4eb018..312a36e 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ shared/main copyright temp/ **/.DS_Store + diff --git a/client/Client.cpp b/client/Client.cpp index 4d948fa..87afe99 100644 --- a/client/Client.cpp +++ b/client/Client.cpp @@ -56,7 +56,7 @@ void Client::timeFunction() void Client::missingRecords() { QSqlQuery queryTimeData; - queryTimeData.exec("SELECT (unix_timestamp(now()) - unix_timestamp(`time`))/60 as delta FROM `WSdb`.`tblMain` limit 1"); + queryTimeData.exec( "SELECT (unix_timestamp(now()) - unix_timestamp(`time`))/60 as delta FROM `tblMain` limit 1"); _missingRecords = queryTimeData.value(0).toInt(); diff --git a/client/HandleMessage.cpp b/client/HandleMessage.cpp index aa73828..3d8823b 100644 --- a/client/HandleMessage.cpp +++ b/client/HandleMessage.cpp @@ -1,6 +1,5 @@ #include "HandleMessage.h" - HandleMessage::HandleMessage(QObject *parent) : QObject(parent) { @@ -17,7 +16,7 @@ QString HandleMessage::ParseMessage(const QString Msg , int totalRecords ) void HandleMessage::ParseToSQL(QString input) { QSqlQuery queryInsertData; - QString output = "INSERT INTO `WSdb`.`tblMain` () VALUES "; + QString output = "INSERT INTO `tblMain` (`temperature`, `humidity`, `pressure`) VALUES "; QStringList data; QStringList list = input.split("\n"); for (int i = 0; i < list.size(); ++i) { diff --git a/client/client.pro.user b/client/client.pro.user new file mode 100644 index 0000000..f6998e7 --- /dev/null +++ b/client/client.pro.user @@ -0,0 +1,260 @@ + + + + + + EnvironmentId + {ea03b890-8d0a-4e25-9c8a-4324595ed9f6} + + + 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 + degoede + degoede + {1e436ae3-d7a2-4102-aca0-911720324ec1} + 0 + 0 + 0 + + 0 + /Users/jregnier/gitOnline/avans-whether-station-Qt/build-client-degoede-Debug + /Users/jregnier/gitOnline/avans-whether-station-Qt/build-client-degoede-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 + + + /Users/jregnier/gitOnline/avans-whether-station-Qt/build-client-degoede-Release + /Users/jregnier/gitOnline/avans-whether-station-Qt/build-client-degoede-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 + /Users/jregnier/gitOnline/avans-whether-station-Qt/build-client-degoede-Profile + /Users/jregnier/gitOnline/avans-whether-station-Qt/build-client-degoede-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/consts.h b/client/consts.h index 7ee81c8..a73fea7 100644 --- a/client/consts.h +++ b/client/consts.h @@ -1,5 +1,7 @@ #pragma once +#include "../shared/wifi.h" + // delay between new record request in seconds #define WS_CLIENT_STATION_POLL_INTERVAL 10 diff --git a/client/dbconnector.cpp b/client/dbconnector.cpp index 256ed53..bbffc58 100644 --- a/client/dbconnector.cpp +++ b/client/dbconnector.cpp @@ -51,3 +51,11 @@ void dbConnector::on_pushButton_login_clicked() QMessageBox::warning(this, "No connection", "Failed to connect"); } } + +QString dbConnector::getdbName(){ + return _dbName; +} + +QString dbConnector::getEspHost(){ + return _espHost; +} diff --git a/client/dbconnector.h b/client/dbconnector.h index 5b9b1cf..82b4f21 100644 --- a/client/dbconnector.h +++ b/client/dbconnector.h @@ -5,8 +5,7 @@ #include //#include //#include - -#define WS_ESP8266_WLAN_IP "129.168.0.1" +#include "consts.h" namespace Ui { class dbConnector; @@ -20,6 +19,9 @@ public: explicit dbConnector(QWidget *parent = nullptr); ~dbConnector(); + static QString getdbName(); + static QString getEspHost(); + private slots: void on_pushButton_cancel_clicked(); diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp index 5f76ad8..dcffed6 100644 --- a/client/mainwindow.cpp +++ b/client/mainwindow.cpp @@ -108,8 +108,5 @@ void MainWindow::drawGraph(){ } else { QMessageBox::warning(this, "No connection", "Failed to connect"); } -// delete seriesTemperature; -// delete seriesHumidity; -// delete seriesPressure; } -- cgit v1.2.3 From 84341bc53bca3da581ba59f66bf4174420c83d3a Mon Sep 17 00:00:00 2001 From: UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> Date: Sun, 30 Oct 2022 17:38:50 +0100 Subject: Delete client.pro.user --- client/client.pro.user | 260 ------------------------------------------------- 1 file changed, 260 deletions(-) delete mode 100644 client/client.pro.user diff --git a/client/client.pro.user b/client/client.pro.user deleted file mode 100644 index f6998e7..0000000 --- a/client/client.pro.user +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - EnvironmentId - {ea03b890-8d0a-4e25-9c8a-4324595ed9f6} - - - 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 - degoede - degoede - {1e436ae3-d7a2-4102-aca0-911720324ec1} - 0 - 0 - 0 - - 0 - /Users/jregnier/gitOnline/avans-whether-station-Qt/build-client-degoede-Debug - /Users/jregnier/gitOnline/avans-whether-station-Qt/build-client-degoede-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 - - - /Users/jregnier/gitOnline/avans-whether-station-Qt/build-client-degoede-Release - /Users/jregnier/gitOnline/avans-whether-station-Qt/build-client-degoede-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 - /Users/jregnier/gitOnline/avans-whether-station-Qt/build-client-degoede-Profile - /Users/jregnier/gitOnline/avans-whether-station-Qt/build-client-degoede-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 - - -- cgit v1.2.3