diff options
| author | lonkaars <loek@pipeframe.xyz> | 2022-10-11 19:21:52 +0200 | 
|---|---|---|
| committer | lonkaars <loek@pipeframe.xyz> | 2022-10-11 19:21:52 +0200 | 
| commit | fbb6a5a1570666ad283afac6e545c578e65475b8 (patch) | |
| tree | 5efe464ac2c41ae9c932043451606bf2b3036db7 | |
| parent | b455848ee62b06ba73801cff477c6ff214c4053e (diff) | |
client merge done
| -rw-r--r-- | client/client.pro | 26 | ||||
| -rw-r--r-- | client/esp/MyTcpSocket.pro | 28 | ||||
| -rw-r--r-- | client/esp/main.cpp | 29 | ||||
| -rw-r--r-- | client/main.cpp | 59 | ||||
| -rw-r--r-- | client/mytcpsocket.cpp (renamed from client/esp/mytcpsocket.cpp) | 0 | ||||
| -rw-r--r-- | client/mytcpsocket.h (renamed from client/esp/mytcpsocket.h) | 0 | ||||
| -rw-r--r-- | client/timetest.cpp (renamed from client/esp/timetest.cpp) | 0 | ||||
| -rw-r--r-- | client/timetest.h (renamed from client/esp/timetest.h) | 0 | ||||
| -rw-r--r-- | client/ui_dbconnector.h | 162 | ||||
| -rw-r--r-- | client/ui_mainwindow.h | 143 | 
10 files changed, 350 insertions, 97 deletions
| diff --git a/client/client.pro b/client/client.pro index 0de0a33..d680fba 100644 --- a/client/client.pro +++ b/client/client.pro @@ -1,23 +1,23 @@ -QT += core gui sql charts +QT += core gui sql charts network  HEADERS += \ -    dbconnector.h \ -    main.h \ -    mainwindow.h -#   chart.h \ -#   chartview.h +	dbconnector.h \ +	main.h \ +	mainwindow.h \ +	mytcpsocket.h \ +	timetest.h  SOURCES += \ -    dbconnector.cpp \ -    main.cpp \ -    mainwindow.cpp -#   chart.cpp \ -#   chartview.cpp +	dbconnector.cpp \ +	main.cpp \ +	mainwindow.cpp \ +	mytcpsocket.cpp \ +	timetest.cpp  FORMS += \ -    dbconnector.ui \ -    mainwindow.ui +	dbconnector.ui \ +	mainwindow.ui  INSTALLS += target  CONFIG += force_debug_info diff --git a/client/esp/MyTcpSocket.pro b/client/esp/MyTcpSocket.pro deleted file mode 100644 index eb1a19e..0000000 --- a/client/esp/MyTcpSocket.pro +++ /dev/null @@ -1,28 +0,0 @@ -QT += core -QT -= gui -QT += network - -TARGET = QTcpSocket - -CONFIG += console -CONFIG -= app_bundle - - -TEMPLATE = app -# You can make your code fail to compile if it uses deprecated APIs. -# In order to do so, uncomment the following line. -#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0 - -SOURCES += \ -        main.cpp \ -        mytcpsocket.cpp \ -        timetest.cpp - -# Default rules for deployment. -qnx: target.path = /tmp/$${TARGET}/bin -else: unix:!android: target.path = /opt/$${TARGET}/bin -!isEmpty(target.path): INSTALLS += target - -HEADERS += \ -    mytcpsocket.h \ -    timetest.h diff --git a/client/esp/main.cpp b/client/esp/main.cpp deleted file mode 100644 index 753b946..0000000 --- a/client/esp/main.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include <QCoreApplication> -#include "mytcpsocket.h" -#include "timetest.h" - -int main(int argc, char *argv[]) -{ -    QCoreApplication a(argc, argv); -//   qint16 startTime= 46; -TimeTest time; - - -//while(1){ - -// -//    qint16  minuut = time.myfunction(); - -//    if(minuut == startTime) -//    { -//        qDebug() << "Tijd: " << minuut; -//        startTime+=1; - -//    } -//} -MyTcpSocket s; -s.doConnect(); - - -   return a.exec(); -} diff --git a/client/main.cpp b/client/main.cpp index 84706bf..0f6b816 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -14,50 +14,55 @@  #include "mainwindow.h"  #include "main.h"  #include "ui_mainwindow.h" +#include "mytcpsocket.h" +#include "timetest.h"  QSqlDatabase dbRef = QSqlDatabase();  int main(int argc, char *argv[])  { -    QApplication a(argc, argv); -    MainWindow w; -    dbRef = QSqlDatabase::addDatabase("QMYSQL"); +	QApplication a(argc, argv); +	TimeTest time; +	MyTcpSocket s; +	// s.doConnect(); +	MainWindow w; +	dbRef = QSqlDatabase::addDatabase("QMYSQL"); -    w.show(); -    return a.exec(); +	w.show(); +	return a.exec();  }  /* QT_CHARTS_USE_NAMESPACE  int main(int argc, char *argv[])  { -    QApplication a(argc, argv); +	QApplication a(argc, argv);  //![1] -    QLineSeries *series = new QLineSeries(); -    for (int i = 0; i < 500; i++) { -        QPointF p((qreal) i, qSin(M_PI / 50 * i) * 100); -        p.ry() += QRandomGenerator::global()->bounded(20); -        *series << p; -    } +	QLineSeries *series = new QLineSeries(); +	for (int i = 0; i < 500; i++) { +		QPointF p((qreal) i, qSin(M_PI / 50 * i) * 100); +		p.ry() += QRandomGenerator::global()->bounded(20); +		*series << p; +	}  //![1] -    Chart *chart = new Chart(); -    chart->addSeries(series); -    chart->setTitle("Zoom in/out example"); -    chart->setAnimationOptions(QChart::SeriesAnimations); -    chart->legend()->hide(); -    chart->createDefaultAxes(); +	Chart *chart = new Chart(); +	chart->addSeries(series); +	chart->setTitle("Zoom in/out example"); +	chart->setAnimationOptions(QChart::SeriesAnimations); +	chart->legend()->hide(); +	chart->createDefaultAxes(); -    ChartView *chartView = new ChartView(chart); -    chartView->setRenderHint(QPainter::Antialiasing); +	ChartView *chartView = new ChartView(chart); +	chartView->setRenderHint(QPainter::Antialiasing); -    QMainWindow window; -    window.setCentralWidget(chartView); -    window.resize(400, 300); -    window.grabGesture(Qt::PanGesture); -    window.grabGesture(Qt::PinchGesture); -    window.show(); +	QMainWindow window; +	window.setCentralWidget(chartView); +	window.resize(400, 300); +	window.grabGesture(Qt::PanGesture); +	window.grabGesture(Qt::PinchGesture); +	window.show(); -    return a.exec(); +	return a.exec();  } */ diff --git a/client/esp/mytcpsocket.cpp b/client/mytcpsocket.cpp index 92dd67a..92dd67a 100644 --- a/client/esp/mytcpsocket.cpp +++ b/client/mytcpsocket.cpp diff --git a/client/esp/mytcpsocket.h b/client/mytcpsocket.h index 4a7e543..4a7e543 100644 --- a/client/esp/mytcpsocket.h +++ b/client/mytcpsocket.h diff --git a/client/esp/timetest.cpp b/client/timetest.cpp index 2e575f2..2e575f2 100644 --- a/client/esp/timetest.cpp +++ b/client/timetest.cpp diff --git a/client/esp/timetest.h b/client/timetest.h index aa1d8a5..aa1d8a5 100644 --- a/client/esp/timetest.h +++ b/client/timetest.h diff --git a/client/ui_dbconnector.h b/client/ui_dbconnector.h new file mode 100644 index 0000000..afb6f11 --- /dev/null +++ b/client/ui_dbconnector.h @@ -0,0 +1,162 @@ +/******************************************************************************** +** 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 new file mode 100644 index 0000000..8854685 --- /dev/null +++ b/client/ui_mainwindow.h @@ -0,0 +1,143 @@ +/******************************************************************************** +** 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 |