diff options
-rw-r--r-- | client/dbconnector.cpp | 11 | ||||
-rw-r--r-- | client/dbconnector.h | 4 | ||||
-rw-r--r-- | client/dbconnector.ui | 5 | ||||
-rw-r--r-- | client/main.cpp | 9 | ||||
-rw-r--r-- | client/mainwindow.cpp | 104 | ||||
-rw-r--r-- | client/mainwindow.h | 20 | ||||
-rw-r--r-- | client/mainwindow.ui | 63 | ||||
-rw-r--r-- | client/ui_dbconnector.h | 162 | ||||
-rw-r--r-- | client/ui_mainwindow.h | 143 | ||||
-rw-r--r-- | scripts/db-add.sql | 194 |
10 files changed, 320 insertions, 395 deletions
diff --git a/client/dbconnector.cpp b/client/dbconnector.cpp index 5ed1efc..186f8f7 100644 --- a/client/dbconnector.cpp +++ b/client/dbconnector.cpp @@ -2,7 +2,7 @@ #include "ui_dbconnector.h" #include "main.h" -//#include "mainwindow.h" +#include "mainwindow.h" dbConnector::dbConnector(QWidget *parent) : QDialog(parent), @@ -26,19 +26,16 @@ void dbConnector::on_pushButton_login_clicked() QString hostname = ui->lineEdit_adress->text(); QString username = ui->lineEdit_username->text(); QString password = ui->lineEdit_password->text(); - QString databaseName = "thecrapbox"; + QString databaseName = ui->lineEdit_database->text(); -// QSqlDatabase db = MainWindow.loginDb(adress, username, password); - -// QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL"); -// return; dbRef.setHostName(hostname); dbRef.setUserName(username); dbRef.setPassword(password); - dbRef.setDatabaseName("thecrapbox"); + dbRef.setDatabaseName(databaseName); if(dbRef.open()){ QMessageBox::information(this, "Connection", "GREAT SUCCES!"); + dbConnector::~dbConnector(); } else { QMessageBox::warning(this, "No connection", "Failed to connect"); } diff --git a/client/dbconnector.h b/client/dbconnector.h index cd722eb..db8ac4e 100644 --- a/client/dbconnector.h +++ b/client/dbconnector.h @@ -6,7 +6,6 @@ //#include <QtSql> //#include <QSqlDatabase> -//#include "database.h" namespace Ui { class dbConnector; @@ -21,7 +20,6 @@ public: ~dbConnector(); private slots: -// void on_pushButton_clicked(); void on_pushButton_cancel_clicked(); @@ -29,6 +27,4 @@ private slots: private: Ui::dbConnector *ui; - -// Database database; }; diff --git a/client/dbconnector.ui b/client/dbconnector.ui index 21d241f..1159faf 100644 --- a/client/dbconnector.ui +++ b/client/dbconnector.ui @@ -49,6 +49,9 @@ </item> <item row="1" column="1"> <widget class="QLineEdit" name="lineEdit_database"> + <property name="text"> + <string>WSdb</string> + </property> <property name="placeholderText"> <string>Database name</string> </property> @@ -98,7 +101,7 @@ </font> </property> <property name="text"> - <string/> + <string>Ab12345!</string> </property> <property name="echoMode"> <enum>QLineEdit::Password</enum> diff --git a/client/main.cpp b/client/main.cpp index 0f6b816..8561786 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -9,8 +9,8 @@ #include <iostream> #include <stdio.h> -#include "chart.h" -#include "chartview.h" +//#include "chart.h" +//#include "chartview.h" #include "mainwindow.h" #include "main.h" #include "ui_mainwindow.h" @@ -25,8 +25,9 @@ int main(int argc, char *argv[]) TimeTest time; MyTcpSocket s; // s.doConnect(); - MainWindow w; - dbRef = QSqlDatabase::addDatabase("QMYSQL"); + MainWindow w; + + dbRef = QSqlDatabase::addDatabase("QMYSQL"); w.show(); return a.exec(); diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp index 955307e..e1736e6 100644 --- a/client/mainwindow.cpp +++ b/client/mainwindow.cpp @@ -4,11 +4,12 @@ #include "ui_mainwindow.h" #include "main.h" +#include <QDebug> + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { -// db = QSqlDatabase::addDatabase("QMYSQL"); ui->setupUi(this); } @@ -18,33 +19,98 @@ MainWindow::~MainWindow() delete ui; } -void MainWindow::on_actionAbout_triggered() +void MainWindow::on_actionConnection_triggered() { - QMessageBox::warning(this, "Oops..", "Task Failed succesfully ;)"); + _dbConenctor = new dbConnector(this); + _dbConenctor->show(); } +void MainWindow::on_actionRefresh_triggered() +{ + drawGraph(); +} -void MainWindow::on_pushButton_clicked() +void MainWindow::on_actionDisconnenct_triggered() { -// dbRef = QSqlDatabase::addDatabase("QMYSQL"); -// dbRef.setHostName("localhost"); -// dbRef.setUserName("root"); -// dbRef.setPassword("Ab12345!"); -// dbRef.setDatabaseName("thecrapbox"); + dbRef.close(); +} + + +void MainWindow::drawGraph(){ + QLineSeries *seriesTemperature = new QLineSeries(); + QLineSeries *seriesHumidity = new QLineSeries(); + QLineSeries *seriesPressure = new QLineSeries(); + + if(dbRef.open()){ - QMessageBox::information(this, "Connection", "GREAT SUCCES!"); - pQueryModel = new QSqlQueryModel(); - pQueryModel->setQuery("SELECT * FROM opleiding;"); - ui->tableView->setModel(pQueryModel); + QSqlQuery queryGraphData; +// queryGraphData.exec("select `tblMain`.`ID`, `temperature`, `humidity`, `pressure` FROM `tblMain` ORDER BY `tblMain`.`ID` DESC limit 16;"); + queryGraphData.exec("select * FROM `tblMain` ORDER BY `tblMain`.`ID` DESC limit 190;"); + + for (int i = 0; queryGraphData.next(); ++i) { +// int time = queryGraphData.value(4).toTime().hour()*100 + queryGraphData.value(4).toTime().minute(); + int time = i; +// seriesPressure->append(queryGraphData.value(0).toInt(), queryGraphData.value(1).toFloat()); +// seriesTemperature->append(i, queryGraphData.value(1).toInt()); +// seriesHumidity->append(i, queryGraphData.value(2).toFloat()); +// seriesPressure->append(i, queryGraphData.value(3).toInt()); + + seriesTemperature->append(time, queryGraphData.value(1).toFloat()); + seriesHumidity->append(time, queryGraphData.value(2).toFloat()); + seriesPressure->append(time, (queryGraphData.value(3).toFloat()*100)); + +// qDebug() << time; + } + +// QPen pen(QRgb(0x57FF00)); +// pen.setWidth(5); +// seriesHumidity->setPen(pen); + + + QChart *chartTemperature = new QChart(); + chartTemperature->legend()->hide(); + chartTemperature->addSeries(seriesTemperature); + chartTemperature->createDefaultAxes(); + chartTemperature->setTitle("Temperature!"); + QChartView *chartView1 = new QChartView(chartTemperature); + + QChart *chartHumidity = new QChart(); + chartHumidity->legend()->hide(); + chartHumidity->addSeries(seriesHumidity); + chartHumidity->createDefaultAxes(); + chartHumidity->setTitle("Humidity!"); + QChartView *chartView2 = new QChartView(chartHumidity); + + QChart *chartPressure = new QChart(); + chartPressure->legend()->hide(); + chartPressure->addSeries(seriesPressure); + chartPressure->createDefaultAxes(); + chartPressure->setTitle("Pressure!"); + QChartView *chartView3 = new QChartView(chartPressure); + + + QWidget *window = new QWidget; + QGridLayout *layout = new QGridLayout(window); + layout->addWidget(chartView1, 0 ,0); + layout->addWidget(chartView2, 1 ,0); + layout->addWidget(chartView3, 2 ,0); + + layout->setVerticalSpacing(0); + layout->setHorizontalSpacing(0); + layout->setContentsMargins(0,0,0,0); + + + +// window->show(); + + MainWindow::setCentralWidget(window); + } else { QMessageBox::warning(this, "No connection", "Failed to connect"); } -} - -void MainWindow::on_actionConnection_triggered() -{ - _dbConenctor = new dbConnector(this); - _dbConenctor->show(); +// delete seriesTemperature; +// delete seriesHumidity; +// delete seriesPressure; } diff --git a/client/mainwindow.h b/client/mainwindow.h index 1e73657..25e22ec 100644 --- a/client/mainwindow.h +++ b/client/mainwindow.h @@ -8,6 +8,10 @@ #include <QMessageBox> #include <QtSql> #include <QSqlDatabase> +#include <QtCharts> +#include <QWidget> +#include <QWidgetSet> + #include "main.h" @@ -23,20 +27,26 @@ public: MainWindow(QWidget *parent = nullptr); ~MainWindow(); + virtual void drawGraph(); + private slots: - void on_actionAbout_triggered(); +// void on_actionAbout_triggered(); - void on_pushButton_clicked(); +// void on_pushButton_clicked(); void on_actionConnection_triggered(); + void on_actionRefresh_triggered(); + + void on_actionDisconnenct_triggered(); + private: Ui::MainWindow *ui; dbConnector *_dbConenctor; -// QSqlDatabase db; - QSqlQueryModel *pQueryModel; + QChart *_pChart; +// QLineSeries *_pSeries; + QChartView *_pChartView; -// Database database; }; diff --git a/client/mainwindow.ui b/client/mainwindow.ui index f827c85..a31ffdc 100644 --- a/client/mainwindow.ui +++ b/client/mainwindow.ui @@ -14,36 +14,18 @@ <string>MainWindow</string> </property> <widget class="QWidget" name="centralwidget"> - <widget class="QPushButton" name="pushButton"> - <property name="enabled"> - <bool>true</bool> - </property> + <widget class="QLabel" name="label"> <property name="geometry"> <rect> - <x>310</x> - <y>0</y> - <width>121</width> - <height>41</height> + <x>270</x> + <y>190</y> + <width>181</width> + <height>51</height> </rect> </property> <property name="text"> - <string>DoesSomething</string> - </property> - </widget> - <widget class="QWidget" name="verticalLayoutWidget"> - <property name="geometry"> - <rect> - <x>-10</x> - <y>40</y> - <width>801</width> - <height>401</height> - </rect> + <string>Please load data first</string> </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QTableView" name="tableView"/> - </item> - </layout> </widget> </widget> <widget class="QMenuBar" name="menubar"> @@ -52,45 +34,33 @@ <x>0</x> <y>0</y> <width>800</width> - <height>21</height> + <height>24</height> </rect> </property> <widget class="QMenu" name="menuAbouy"> <property name="title"> <string>Home</string> </property> - <addaction name="actionAbout"/> <addaction name="actionRefresh"/> </widget> - <widget class="QMenu" name="menuTEMP"> - <property name="title"> - <string>TEMP</string> - </property> - <addaction name="actionLOAD"/> - <addaction name="actionQuerry"/> - </widget> <widget class="QMenu" name="menuDatabase"> <property name="title"> <string>Database</string> </property> <addaction name="actionConnection"/> <addaction name="actionDisconnenct"/> - <addaction name="actionStatus"/> </widget> <addaction name="menuAbouy"/> - <addaction name="menuTEMP"/> <addaction name="menuDatabase"/> </widget> <widget class="QStatusBar" name="statusbar"/> - <action name="actionAbout"> - <property name="text"> - <string>About</string> - </property> - </action> <action name="actionRefresh"> <property name="text"> <string>Refresh</string> </property> + <property name="shortcut"> + <string>Ctrl+R</string> + </property> </action> <action name="actionLOAD"> <property name="text"> @@ -106,22 +76,15 @@ <property name="text"> <string>Connect</string> </property> + <property name="shortcut"> + <string>Ctrl+O</string> + </property> </action> <action name="actionDisconnenct"> <property name="text"> <string>Disconnenct</string> </property> </action> - <action name="actionQuerry_2"> - <property name="text"> - <string>Querry</string> - </property> - </action> - <action name="actionStatus"> - <property name="text"> - <string>Status</string> - </property> - </action> </widget> <resources/> <connections/> diff --git a/client/ui_dbconnector.h b/client/ui_dbconnector.h deleted file mode 100644 index afb6f11..0000000 --- a/client/ui_dbconnector.h +++ /dev/null @@ -1,162 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'dbconnector.ui' -** -** Created by: Qt User Interface Compiler version 5.15.6 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_DBCONNECTOR_H -#define UI_DBCONNECTOR_H - -#include <QtCore/QVariant> -#include <QtWidgets/QApplication> -#include <QtWidgets/QDialog> -#include <QtWidgets/QFormLayout> -#include <QtWidgets/QFrame> -#include <QtWidgets/QHBoxLayout> -#include <QtWidgets/QLabel> -#include <QtWidgets/QLineEdit> -#include <QtWidgets/QPushButton> -#include <QtWidgets/QWidget> - -QT_BEGIN_NAMESPACE - -class Ui_dbConnector -{ -public: - QWidget *formLayoutWidget; - QFormLayout *formLayout; - QLabel *label_3; - QLineEdit *lineEdit_adress; - QLabel *label_4; - QLineEdit *lineEdit_database; - QFrame *line; - QLabel *label; - QLineEdit *lineEdit_username; - QLabel *label_2; - QLineEdit *lineEdit_password; - QLabel *connectLabel; - QHBoxLayout *horizontalLayout; - QPushButton *pushButton_login; - QPushButton *pushButton_cancel; - - void setupUi(QDialog *dbConnector) - { - if (dbConnector->objectName().isEmpty()) - dbConnector->setObjectName(QString::fromUtf8("dbConnector")); - dbConnector->resize(362, 273); - formLayoutWidget = new QWidget(dbConnector); - formLayoutWidget->setObjectName(QString::fromUtf8("formLayoutWidget")); - formLayoutWidget->setGeometry(QRect(60, 60, 241, 173)); - formLayout = new QFormLayout(formLayoutWidget); - formLayout->setObjectName(QString::fromUtf8("formLayout")); - formLayout->setContentsMargins(0, 0, 0, 0); - label_3 = new QLabel(formLayoutWidget); - label_3->setObjectName(QString::fromUtf8("label_3")); - - formLayout->setWidget(0, QFormLayout::LabelRole, label_3); - - lineEdit_adress = new QLineEdit(formLayoutWidget); - lineEdit_adress->setObjectName(QString::fromUtf8("lineEdit_adress")); - - formLayout->setWidget(0, QFormLayout::FieldRole, lineEdit_adress); - - label_4 = new QLabel(formLayoutWidget); - label_4->setObjectName(QString::fromUtf8("label_4")); - - formLayout->setWidget(1, QFormLayout::LabelRole, label_4); - - lineEdit_database = new QLineEdit(formLayoutWidget); - lineEdit_database->setObjectName(QString::fromUtf8("lineEdit_database")); - - formLayout->setWidget(1, QFormLayout::FieldRole, lineEdit_database); - - line = new QFrame(formLayoutWidget); - line->setObjectName(QString::fromUtf8("line")); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - - formLayout->setWidget(2, QFormLayout::SpanningRole, line); - - label = new QLabel(formLayoutWidget); - label->setObjectName(QString::fromUtf8("label")); - - formLayout->setWidget(3, QFormLayout::LabelRole, label); - - lineEdit_username = new QLineEdit(formLayoutWidget); - lineEdit_username->setObjectName(QString::fromUtf8("lineEdit_username")); - lineEdit_username->setEchoMode(QLineEdit::PasswordEchoOnEdit); - - formLayout->setWidget(3, QFormLayout::FieldRole, lineEdit_username); - - label_2 = new QLabel(formLayoutWidget); - label_2->setObjectName(QString::fromUtf8("label_2")); - - formLayout->setWidget(4, QFormLayout::LabelRole, label_2); - - lineEdit_password = new QLineEdit(formLayoutWidget); - lineEdit_password->setObjectName(QString::fromUtf8("lineEdit_password")); - QFont font; - font.setUnderline(false); - font.setStrikeOut(false); - font.setKerning(true); - lineEdit_password->setFont(font); - lineEdit_password->setEchoMode(QLineEdit::Password); - - formLayout->setWidget(4, QFormLayout::FieldRole, lineEdit_password); - - connectLabel = new QLabel(formLayoutWidget); - connectLabel->setObjectName(QString::fromUtf8("connectLabel")); - - formLayout->setWidget(5, QFormLayout::LabelRole, connectLabel); - - horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); - pushButton_login = new QPushButton(formLayoutWidget); - pushButton_login->setObjectName(QString::fromUtf8("pushButton_login")); - - horizontalLayout->addWidget(pushButton_login); - - pushButton_cancel = new QPushButton(formLayoutWidget); - pushButton_cancel->setObjectName(QString::fromUtf8("pushButton_cancel")); - - horizontalLayout->addWidget(pushButton_cancel); - - - formLayout->setLayout(5, QFormLayout::FieldRole, horizontalLayout); - - - retranslateUi(dbConnector); - - QMetaObject::connectSlotsByName(dbConnector); - } // setupUi - - void retranslateUi(QDialog *dbConnector) - { - dbConnector->setWindowTitle(QCoreApplication::translate("dbConnector", "Dialog", nullptr)); - label_3->setText(QCoreApplication::translate("dbConnector", "Adress", nullptr)); - lineEdit_adress->setText(QCoreApplication::translate("dbConnector", "localhost", nullptr)); - lineEdit_adress->setPlaceholderText(QCoreApplication::translate("dbConnector", "Hostname/IP-Adress", nullptr)); - label_4->setText(QCoreApplication::translate("dbConnector", "Database", nullptr)); - lineEdit_database->setPlaceholderText(QCoreApplication::translate("dbConnector", "Database name", nullptr)); - label->setText(QCoreApplication::translate("dbConnector", "Username", nullptr)); - lineEdit_username->setText(QCoreApplication::translate("dbConnector", "root", nullptr)); - lineEdit_username->setPlaceholderText(QCoreApplication::translate("dbConnector", "Username", nullptr)); - label_2->setText(QCoreApplication::translate("dbConnector", "Password", nullptr)); - lineEdit_password->setText(QString()); - lineEdit_password->setPlaceholderText(QCoreApplication::translate("dbConnector", "Password", nullptr)); - connectLabel->setText(QCoreApplication::translate("dbConnector", "Connect", nullptr)); - pushButton_login->setText(QCoreApplication::translate("dbConnector", "Login", nullptr)); - pushButton_cancel->setText(QCoreApplication::translate("dbConnector", "Cancel", nullptr)); - } // retranslateUi - -}; - -namespace Ui { - class dbConnector: public Ui_dbConnector {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_DBCONNECTOR_H diff --git a/client/ui_mainwindow.h b/client/ui_mainwindow.h deleted file mode 100644 index 8854685..0000000 --- a/client/ui_mainwindow.h +++ /dev/null @@ -1,143 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'mainwindow.ui' -** -** Created by: Qt User Interface Compiler version 5.15.6 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_MAINWINDOW_H -#define UI_MAINWINDOW_H - -#include <QtCore/QVariant> -#include <QtWidgets/QAction> -#include <QtWidgets/QApplication> -#include <QtWidgets/QHeaderView> -#include <QtWidgets/QMainWindow> -#include <QtWidgets/QMenu> -#include <QtWidgets/QMenuBar> -#include <QtWidgets/QPushButton> -#include <QtWidgets/QStatusBar> -#include <QtWidgets/QTableView> -#include <QtWidgets/QVBoxLayout> -#include <QtWidgets/QWidget> - -QT_BEGIN_NAMESPACE - -class Ui_MainWindow -{ -public: - QAction *actionAbout; - QAction *actionRefresh; - QAction *actionLOAD; - QAction *actionQuerry; - QAction *actionConnection; - QAction *actionDisconnenct; - QAction *actionQuerry_2; - QAction *actionStatus; - QWidget *centralwidget; - QPushButton *pushButton; - QWidget *verticalLayoutWidget; - QVBoxLayout *verticalLayout; - QTableView *tableView; - QMenuBar *menubar; - QMenu *menuAbouy; - QMenu *menuTEMP; - QMenu *menuDatabase; - QStatusBar *statusbar; - - void setupUi(QMainWindow *MainWindow) - { - if (MainWindow->objectName().isEmpty()) - MainWindow->setObjectName(QString::fromUtf8("MainWindow")); - MainWindow->resize(800, 600); - actionAbout = new QAction(MainWindow); - actionAbout->setObjectName(QString::fromUtf8("actionAbout")); - actionRefresh = new QAction(MainWindow); - actionRefresh->setObjectName(QString::fromUtf8("actionRefresh")); - actionLOAD = new QAction(MainWindow); - actionLOAD->setObjectName(QString::fromUtf8("actionLOAD")); - actionQuerry = new QAction(MainWindow); - actionQuerry->setObjectName(QString::fromUtf8("actionQuerry")); - actionConnection = new QAction(MainWindow); - actionConnection->setObjectName(QString::fromUtf8("actionConnection")); - actionDisconnenct = new QAction(MainWindow); - actionDisconnenct->setObjectName(QString::fromUtf8("actionDisconnenct")); - actionQuerry_2 = new QAction(MainWindow); - actionQuerry_2->setObjectName(QString::fromUtf8("actionQuerry_2")); - actionStatus = new QAction(MainWindow); - actionStatus->setObjectName(QString::fromUtf8("actionStatus")); - centralwidget = new QWidget(MainWindow); - centralwidget->setObjectName(QString::fromUtf8("centralwidget")); - pushButton = new QPushButton(centralwidget); - pushButton->setObjectName(QString::fromUtf8("pushButton")); - pushButton->setEnabled(true); - pushButton->setGeometry(QRect(310, 0, 121, 41)); - verticalLayoutWidget = new QWidget(centralwidget); - verticalLayoutWidget->setObjectName(QString::fromUtf8("verticalLayoutWidget")); - verticalLayoutWidget->setGeometry(QRect(-10, 40, 801, 401)); - verticalLayout = new QVBoxLayout(verticalLayoutWidget); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); - verticalLayout->setContentsMargins(0, 0, 0, 0); - tableView = new QTableView(verticalLayoutWidget); - tableView->setObjectName(QString::fromUtf8("tableView")); - - verticalLayout->addWidget(tableView); - - MainWindow->setCentralWidget(centralwidget); - menubar = new QMenuBar(MainWindow); - menubar->setObjectName(QString::fromUtf8("menubar")); - menubar->setGeometry(QRect(0, 0, 800, 21)); - menuAbouy = new QMenu(menubar); - menuAbouy->setObjectName(QString::fromUtf8("menuAbouy")); - menuTEMP = new QMenu(menubar); - menuTEMP->setObjectName(QString::fromUtf8("menuTEMP")); - menuDatabase = new QMenu(menubar); - menuDatabase->setObjectName(QString::fromUtf8("menuDatabase")); - MainWindow->setMenuBar(menubar); - statusbar = new QStatusBar(MainWindow); - statusbar->setObjectName(QString::fromUtf8("statusbar")); - MainWindow->setStatusBar(statusbar); - - menubar->addAction(menuAbouy->menuAction()); - menubar->addAction(menuTEMP->menuAction()); - menubar->addAction(menuDatabase->menuAction()); - menuAbouy->addAction(actionAbout); - menuAbouy->addAction(actionRefresh); - menuTEMP->addAction(actionLOAD); - menuTEMP->addAction(actionQuerry); - menuDatabase->addAction(actionConnection); - menuDatabase->addAction(actionDisconnenct); - menuDatabase->addAction(actionStatus); - - retranslateUi(MainWindow); - - QMetaObject::connectSlotsByName(MainWindow); - } // setupUi - - void retranslateUi(QMainWindow *MainWindow) - { - MainWindow->setWindowTitle(QCoreApplication::translate("MainWindow", "MainWindow", nullptr)); - actionAbout->setText(QCoreApplication::translate("MainWindow", "About", nullptr)); - actionRefresh->setText(QCoreApplication::translate("MainWindow", "Refresh", nullptr)); - actionLOAD->setText(QCoreApplication::translate("MainWindow", "Load", nullptr)); - actionQuerry->setText(QCoreApplication::translate("MainWindow", "Query", nullptr)); - actionConnection->setText(QCoreApplication::translate("MainWindow", "Connect", nullptr)); - actionDisconnenct->setText(QCoreApplication::translate("MainWindow", "Disconnenct", nullptr)); - actionQuerry_2->setText(QCoreApplication::translate("MainWindow", "Querry", nullptr)); - actionStatus->setText(QCoreApplication::translate("MainWindow", "Status", nullptr)); - pushButton->setText(QCoreApplication::translate("MainWindow", "DoesSomething", nullptr)); - menuAbouy->setTitle(QCoreApplication::translate("MainWindow", "Home", nullptr)); - menuTEMP->setTitle(QCoreApplication::translate("MainWindow", "TEMP", nullptr)); - menuDatabase->setTitle(QCoreApplication::translate("MainWindow", "Database", nullptr)); - } // retranslateUi - -}; - -namespace Ui { - class MainWindow: public Ui_MainWindow {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_MAINWINDOW_H diff --git a/scripts/db-add.sql b/scripts/db-add.sql new file mode 100644 index 0000000..6b202aa --- /dev/null +++ b/scripts/db-add.sql @@ -0,0 +1,194 @@ +INSERT INTO `WSdb`.`tblMain` (temperature, humidity) VALUES +-- 20.6, 77.7, 0.59, now() +(23.6,57), +(23.6,57), +(23.6,56), +(23.6,56), +(23.5,58), +(23.4,59), +(23.4,59), +(23.4,60), +(23.4,60), +(23.4,60), +(23.3,60), +(23.3,60), +(23.3,60), +(23.2,60), +(23.4,60), +(23.3,60), +(23.2,60), +(23.2,59), +(23.1,59), +(23.1,59), +(23.0,59), +(23.0,59), +(22.9,59), +(22.9,59), +(22.9,58), +(22.8,58), +(22.8,58), +(22.8,58), +(22.8,58), +(22.7,58), +(22.7,58), +(22.7,58), +(22.6,58), +(22.6,58), +(22.6,58), +(22.6,58), +(22.5,58), +(22.5,58), +(22.5,58), +(22.4,58), +(22.4,58), +(22.4,58), +(22.4,57), +(22.4,57), +(22.3,57), +(22.3,57), +(22.3,57), +(22.3,57), +(22.3,57), +(22.4,57), +(22.7,57), +(22.9,57), +(23.0,57), +(23.2,57), +(23.2,57), +(23.1,59), +(23.0,59), +(23.0,59), +(23.2,58), +(23.4,58), +(23.4,58), +(23.5,57), +(23.6,57), +(23.7,57), +(23.7,57), +(23.8,57), +(23.9,57), +(23.8,59), +(23.8,59), +(23.7,58), +(23.6,58), +(23.5,58), +(23.5,58), +(23.4,57), +(23.5,59), +(23.8,58), +(23.7,59), +(23.7,59), +(23.7,59), +(23.9,59), +(23.8,57), +(23.7,56), +(23.5,55), +(23.4,54), +(23.4,54), +(23.6,53), +(23.6,56), +(23.7,55), +(23.7,54), +(23.8,54), +(23.8,54), +(23.8,55), +(23.7,55), +(23.6,55), +(23.5,55), +(23.5,56), +(23.4,56), +(23.4,58), +(23.3,59), +(23.4,63), +(23.4,63), +(23.4,63), +(23.4,63), +(23.4,63), +(23.3,64), +(23.2,63), +(23.2,62), +(23.1,62), +(23.1,61), +(23.0,61), +(22.9,61), +(22.9,61), +(22.9,61), +(22.8,60), +(22.8,60), +(22.8,60), +(22.7,60), +(22.7,60), +(22.6,60), +(22.6,60), +(22.5,59), +(22.5,59), +(22.5,59), +(22.4,59), +(22.4,59), +(22.4,59), +(22.4,59), +(22.4,59), +(22.4,58), +(22.3,58), +(22.3,58), +(22.3,58), +(22.3,58), +(22.2,58), +(22.2,58), +(22.2,58), +(22.2,58), +(22.2,58), +(22.1,58), +(22.1,58), +(22.1,58), +(22.1,57), +(22.0,57), +(22.0,57), +(22.0,57), +(22.1,58), +(22.4,57), +(22.5,58), +(22.6,58), +(22.7,58), +(22.8,58), +(22.9,58), +(22.9,58), +(22.8,57), +(22.7,57), +(22.7,57), +(22.9,57), +(22.9,57), +(23.0,58), +(23.2,58), +(23.3,58), +(23.2,59), +(23.2,59), +(23.2,58), +(23.4,58), +(23.6,59), +(23.7,59), +(23.9,59), +(24.0,58), +(23.9,55), +(23.9,54), +(23.9,55), +(24.0,55), +(24.2,55), +(24.2,55), +(24.1,56), +(24.0,55), +(24.0,56), +(23.9,57), +(23.9,56), +(24.0,55), +(24.1,55), +(23.9,56), +(23.9,56), +(23.9,56), +(23.9,56), +(23.8,56), +(23.8,56), +(23.7,56), +(23.7,56), +(23.6,58), +(23.6,59); |