diff options
Diffstat (limited to 'client')
| -rw-r--r-- | client/Client.cpp | 65 | ||||
| -rw-r--r-- | client/Client.h | 45 | ||||
| -rw-r--r-- | client/HandleMessage.cpp | 47 | ||||
| -rw-r--r-- | client/HandleMessage.h | 26 | ||||
| -rw-r--r-- | client/client.pro | 14 | ||||
| -rw-r--r-- | client/client.pro.user | 260 | ||||
| -rw-r--r-- | client/dialog.cpp | 14 | ||||
| -rw-r--r-- | client/dialog.h | 22 | ||||
| -rw-r--r-- | client/dialog.ui | 18 | ||||
| -rw-r--r-- | client/main.cpp | 7 | ||||
| -rw-r--r-- | client/mainwindow.cpp | 6 | ||||
| -rw-r--r-- | client/mainwindow.h | 5 | ||||
| -rw-r--r-- | client/mainwindow.ui | 6 | ||||
| -rw-r--r-- | client/mytcpsocket.cpp | 44 | ||||
| -rw-r--r-- | client/mytcpsocket.h | 32 | ||||
| -rw-r--r-- | client/settingsmenu.cpp | 47 | ||||
| -rw-r--r-- | client/settingsmenu.h | 34 | ||||
| -rw-r--r-- | client/settingsmenu.ui | 144 | ||||
| -rw-r--r-- | client/timetest.cpp | 18 | ||||
| -rw-r--r-- | client/timetest.h | 27 | ||||
| -rw-r--r-- | client/ui_dbconnector.h | 163 | ||||
| -rw-r--r-- | client/ui_mainwindow.h | 110 | 
22 files changed, 1013 insertions, 141 deletions
| diff --git a/client/Client.cpp b/client/Client.cpp new file mode 100644 index 0000000..46952b6 --- /dev/null +++ b/client/Client.cpp @@ -0,0 +1,65 @@ +#include "Client.h" + + + +Client::Client(QObject *parent) : QObject(parent) +{ +    // initislise timer and socket +    socket = new QTcpSocket(this); +    timer = new QTimer(this); +} +Client::~Client() +{ +    // delete if called again +    delete socket; +    delete timer; +} + +void Client::ClientEcho() +{ +    QTime time1 = QTime::currentTime(); +    NextMinute = time1.minute()+1; + +    connect(timer, SIGNAL(timeout()),this,SLOT(timeFunction())); // connect timer to time every minute + +    // connect to readyread to receive data; +    connect(socket,&QTcpSocket::readyRead, [&]() { +        QTextStream T(socket); +        QString text = T.readAll(); //  reads all data +       Handlemsg.ParseToSQL(Handlemsg.ParseMessage(text, (totalRecords-'0'))); + + +    }); + +    timer->start(1000); +} + +void Client::timeFunction() +{ +    if(_missingRecords>1){ +        totalRecords = _missingRecords; +    } +    else{ +        totalRecords=1; +    } +    QByteArray msgToSend= (msg.toUtf8() + totalRecords + offsetRecords +'\n'); + +    QTime time = QTime::currentTime(); +    qint16 currentMinute = time.minute(); + +    if(currentMinute==NextMinute){ +        socket->connectToHost(networkAddress, tcpPortAddress); + +        socket->write(msgToSend); +        NextMinute++; +    } +} + +void Client::missingRecords() +{ +    QSqlQuery queryTimeData; +    queryTimeData.exec("SELECT (unix_timestamp(now()) - unix_timestamp(`time`))/60 as delta FROM `WSdb`.`tblMain` limit 1"); + +    _missingRecords = queryTimeData.value(0).toInt(); + +} 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 diff --git a/client/HandleMessage.cpp b/client/HandleMessage.cpp new file mode 100644 index 0000000..aa73828 --- /dev/null +++ b/client/HandleMessage.cpp @@ -0,0 +1,47 @@ +#include "HandleMessage.h" + + +HandleMessage::HandleMessage(QObject *parent) : QObject(parent) +{ + +} + +QString HandleMessage::ParseMessage(const QString Msg , int totalRecords ) +{ +    QString message= Msg.section('\n',2,(3+totalRecords)); + +    return message; + +} + +void HandleMessage::ParseToSQL(QString input) +{ +    QSqlQuery queryInsertData; +    QString output = "INSERT INTO `WSdb`.`tblMain` () VALUES "; +    QStringList data; +    QStringList list = input.split("\n"); +    for (int i = 0; i < list.size(); ++i) { + +        output += "("; + +        data=list[i].split(","); + +        for (int j = 1; j < data.size(); ++j) { +            bool valid; +            output.append(QString::number(data[j].toInt(&valid, 16))); +            if (j <= data[j].size()) { +                output.append(","); +            } + +        } +        output.append(")"); + +        if (i+1 < list.size()){ +            output.append(","); +        } +    } +   queryInsertData.exec(output); +} + + + diff --git a/client/HandleMessage.h b/client/HandleMessage.h new file mode 100644 index 0000000..bfc5063 --- /dev/null +++ b/client/HandleMessage.h @@ -0,0 +1,26 @@ +#ifndef HANDLEMESSAGE_H +#define HANDLEMESSAGE_H + +#include <QDebug> +#include <QObject> +#include <QString> +#include <QVector> +#include <QSqlQuery> + +class HandleMessage : public QObject +{ +    Q_OBJECT +public: +    HandleMessage(QObject *parent = 0); + +    QString ParseMessage(const QString  , int); +    void ParseToSQL(QString); + + + +private: + +}; + + +#endif // HANDLEMESSAGE_H diff --git a/client/client.pro b/client/client.pro index 71ab6d5..76f2b56 100644 --- a/client/client.pro +++ b/client/client.pro @@ -1,20 +1,18 @@  QT += core gui sql charts network  HEADERS += \ -	csv_import.h \ +	Client.h \ +	HandleMessage.h \  	dbconnector.h \  	main.h \ -	mainwindow.h \ -	mytcpsocket.h \ -	timetest.h +	mainwindow.h  SOURCES += \ -	csv_import.cpp \ +	Client.cpp \ +	HandleMessage.cpp \  	dbconnector.cpp \  	main.cpp \ -	mainwindow.cpp \ -	mytcpsocket.cpp \ -	timetest.cpp +	mainwindow.cpp  FORMS += \ diff --git a/client/client.pro.user b/client/client.pro.user new file mode 100644 index 0000000..7ccbc7b --- /dev/null +++ b/client/client.pro.user @@ -0,0 +1,260 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE QtCreatorProject> +<!-- Written by QtCreator 8.0.1, 2022-10-29T18:40:37. --> +<qtcreator> + <data> +  <variable>EnvironmentId</variable> +  <value type="QByteArray">{aa240e53-c124-4cf0-84a8-30bfe8a2cf83}</value> + </data> + <data> +  <variable>ProjectExplorer.Project.ActiveTarget</variable> +  <value type="qlonglong">0</value> + </data> + <data> +  <variable>ProjectExplorer.Project.EditorSettings</variable> +  <valuemap type="QVariantMap"> +   <value type="bool" key="EditorConfiguration.AutoIndent">true</value> +   <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> +   <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value> +   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> +    <value type="QString" key="language">Cpp</value> +    <valuemap type="QVariantMap" key="value"> +     <value type="QByteArray" key="CurrentPreferences">CppGlobal</value> +    </valuemap> +   </valuemap> +   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> +    <value type="QString" key="language">QmlJS</value> +    <valuemap type="QVariantMap" key="value"> +     <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value> +    </valuemap> +   </valuemap> +   <value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value> +   <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value> +   <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> +   <value type="int" key="EditorConfiguration.IndentSize">4</value> +   <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value> +   <value type="int" key="EditorConfiguration.MarginColumn">80</value> +   <value type="bool" key="EditorConfiguration.MouseHiding">true</value> +   <value type="bool" key="EditorConfiguration.MouseNavigation">true</value> +   <value type="int" key="EditorConfiguration.PaddingMode">1</value> +   <value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value> +   <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> +   <value type="bool" key="EditorConfiguration.ShowMargin">false</value> +   <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> +   <value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value> +   <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> +   <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> +   <value type="int" key="EditorConfiguration.TabSize">8</value> +   <value type="bool" key="EditorConfiguration.UseGlobal">true</value> +   <value type="bool" key="EditorConfiguration.UseIndenter">false</value> +   <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> +   <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> +   <value type="bool" key="EditorConfiguration.cleanIndentation">true</value> +   <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> +   <value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value> +   <value type="bool" key="EditorConfiguration.inEntireDocument">false</value> +   <value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value> +  </valuemap> + </data> + <data> +  <variable>ProjectExplorer.Project.PluginSettings</variable> +  <valuemap type="QVariantMap"> +   <valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks"> +    <value type="bool" key="AutoTest.Framework.Boost">true</value> +    <value type="bool" key="AutoTest.Framework.CTest">false</value> +    <value type="bool" key="AutoTest.Framework.Catch">true</value> +    <value type="bool" key="AutoTest.Framework.GTest">true</value> +    <value type="bool" key="AutoTest.Framework.QtQuickTest">true</value> +    <value type="bool" key="AutoTest.Framework.QtTest">true</value> +   </valuemap> +   <valuemap type="QVariantMap" key="AutoTest.CheckStates"/> +   <value type="int" key="AutoTest.RunAfterBuild">0</value> +   <value type="bool" key="AutoTest.UseGlobal">true</value> +   <valuemap type="QVariantMap" key="ClangTools"> +    <value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value> +    <value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value> +    <value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value> +    <value type="int" key="ClangTools.ParallelJobs">4</value> +    <valuelist type="QVariantList" key="ClangTools.SelectedDirs"/> +    <valuelist type="QVariantList" key="ClangTools.SelectedFiles"/> +    <valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/> +    <value type="bool" key="ClangTools.UseGlobalSettings">true</value> +   </valuemap> +  </valuemap> + </data> + <data> +  <variable>ProjectExplorer.Project.Target.0</variable> +  <valuemap type="QVariantMap"> +   <value type="QString" key="DeviceType">Desktop</value> +   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.4.0 MinGW 64-bit</value> +   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.4.0 MinGW 64-bit</value> +   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.640.win64_mingw_kit</value> +   <value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> +   <value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> +   <value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> +   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> +    <value type="int" key="EnableQmlDebugging">0</value> +    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\Github2\avans-whether-station\build-client-Desktop_Qt_6_4_0_MinGW_64_bit-Debug</value> +    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/Github2/avans-whether-station/build-client-Desktop_Qt_6_4_0_MinGW_64_bit-Debug</value> +    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> +     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> +      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> +      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> +      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> +      <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/> +     </valuemap> +     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> +      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> +      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> +     </valuemap> +     <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> +    </valuemap> +    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> +     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> +      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> +      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> +      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> +     </valuemap> +     <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> +    </valuemap> +    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> +    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> +    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/> +    <value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value> +    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> +    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value> +    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> +    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> +   </valuemap> +   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> +    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\Github2\avans-whether-station\build-client-Desktop_Qt_6_4_0_MinGW_64_bit-Release</value> +    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/Github2/avans-whether-station/build-client-Desktop_Qt_6_4_0_MinGW_64_bit-Release</value> +    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> +     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> +      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> +      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> +      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> +      <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/> +     </valuemap> +     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> +      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> +      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> +     </valuemap> +     <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> +    </valuemap> +    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> +     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> +      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> +      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> +      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> +     </valuemap> +     <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> +    </valuemap> +    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> +    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> +    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/> +    <value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value> +    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> +    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value> +    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> +    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> +    <value type="int" key="QtQuickCompiler">0</value> +   </valuemap> +   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> +    <value type="int" key="EnableQmlDebugging">0</value> +    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\Github2\avans-whether-station\build-client-Desktop_Qt_6_4_0_MinGW_64_bit-Profile</value> +    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/Github2/avans-whether-station/build-client-Desktop_Qt_6_4_0_MinGW_64_bit-Profile</value> +    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> +     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> +      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> +      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> +      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> +      <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/> +     </valuemap> +     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> +      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> +      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> +     </valuemap> +     <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> +    </valuemap> +    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> +     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> +      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> +      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> +      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> +     </valuemap> +     <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> +    </valuemap> +    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> +    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> +    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/> +    <value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value> +    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> +    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value> +    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> +    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> +    <value type="int" key="QtQuickCompiler">0</value> +    <value type="int" key="SeparateDebugInfo">0</value> +   </valuemap> +   <value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">3</value> +   <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> +    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> +     <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value> +     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> +    </valuemap> +    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> +    <valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/> +    <value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value> +    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> +   </valuemap> +   <value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> +   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> +    <value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value> +    <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value> +    <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> +    <valuelist type="QVariantList" key="CustomOutputParsers"/> +    <value type="int" key="PE.EnvironmentAspect.Base">2</value> +    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> +    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value> +    <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value> +    <value type="bool" key="RunConfiguration.UseCppDebugger">false</value> +    <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> +    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> +    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> +   </valuemap> +   <value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value> +  </valuemap> + </data> + <data> +  <variable>ProjectExplorer.Project.TargetCount</variable> +  <value type="qlonglong">1</value> + </data> + <data> +  <variable>ProjectExplorer.Project.Updater.FileVersion</variable> +  <value type="int">22</value> + </data> + <data> +  <variable>Version</variable> +  <value type="int">22</value> + </data> +</qtcreator> diff --git a/client/dialog.cpp b/client/dialog.cpp new file mode 100644 index 0000000..58c3e72 --- /dev/null +++ b/client/dialog.cpp @@ -0,0 +1,14 @@ +#include "dialog.h" +#include "ui_dialog.h" + +Dialog::Dialog(QWidget *parent) : +    QDialog(parent), +    ui(new Ui::Dialog) +{ +    ui->setupUi(this); +} + +Dialog::~Dialog() +{ +    delete ui; +} diff --git a/client/dialog.h b/client/dialog.h new file mode 100644 index 0000000..17537d1 --- /dev/null +++ b/client/dialog.h @@ -0,0 +1,22 @@ +#ifndef DIALOG_H +#define DIALOG_H + +#include <QDialog> + +namespace Ui { +class Dialog; +} + +class Dialog : public QDialog +{ +    Q_OBJECT + +public: +    explicit Dialog(QWidget *parent = nullptr); +    ~Dialog(); + +private: +    Ui::Dialog *ui; +}; + +#endif // DIALOG_H diff --git a/client/dialog.ui b/client/dialog.ui new file mode 100644 index 0000000..9fbffd2 --- /dev/null +++ b/client/dialog.ui @@ -0,0 +1,18 @@ +<ui version="4.0"> + <class>Dialog</class> + <widget name="Dialog" class="QDialog"> +  <property name="geometry"> +   <rect> +    <x>0</x> +    <y>0</y> +    <width>400</width> +    <height>300</height> +   </rect> +  </property> +  <property name="windowTitle"> +   <string>Dialog</string> +  </property> + </widget> + <resources/> + <connections/> +</ui> diff --git a/client/main.cpp b/client/main.cpp index 0a1c4e4..267248c 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -14,19 +14,12 @@  #include "mainwindow.h"  #include "main.h"  #include "ui_mainwindow.h" -#include "mytcpsocket.h" -#include "timetest.h" -#include "csv_import.h" -#include <QDebug>  QSqlDatabase dbRef = QSqlDatabase();  int main(int argc, char *argv[])  {  	QApplication a(argc, argv); -	TimeTest time; -	MyTcpSocket s; -	// s.doConnect();      MainWindow w;      dbRef = QSqlDatabase::addDatabase("QMYSQL"); diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp index e1736e6..49fcc26 100644 --- a/client/mainwindow.cpp +++ b/client/mainwindow.cpp @@ -11,6 +11,7 @@ MainWindow::MainWindow(QWidget *parent)      , ui(new Ui::MainWindow)  {      ui->setupUi(this); +    client.ClientEcho();  }  MainWindow::~MainWindow() @@ -19,6 +20,11 @@ MainWindow::~MainWindow()      delete ui;  } +void MainWindow::timeFunction() +{ +    client.timeFunction(); +} +  void MainWindow::on_actionConnection_triggered()  {      _dbConenctor = new dbConnector(this); diff --git a/client/mainwindow.h b/client/mainwindow.h index 25e22ec..6bcc329 100644 --- a/client/mainwindow.h +++ b/client/mainwindow.h @@ -13,6 +13,7 @@  #include <QWidgetSet>  #include "main.h" +#include "Client.h"  QT_BEGIN_NAMESPACE @@ -33,7 +34,7 @@ private slots:  //    void on_actionAbout_triggered();  //    void on_pushButton_clicked(); - +    void timeFunction();      void on_actionConnection_triggered();      void on_actionRefresh_triggered(); @@ -42,7 +43,7 @@ private slots:  private:      Ui::MainWindow *ui; - +    Client client;      dbConnector *_dbConenctor;      QChart *_pChart; diff --git a/client/mainwindow.ui b/client/mainwindow.ui index a31ffdc..bbcdf9c 100644 --- a/client/mainwindow.ui +++ b/client/mainwindow.ui @@ -17,8 +17,8 @@     <widget class="QLabel" name="label">      <property name="geometry">       <rect> -      <x>270</x> -      <y>190</y> +      <x>260</x> +      <y>240</y>        <width>181</width>        <height>51</height>       </rect> @@ -34,7 +34,7 @@       <x>0</x>       <y>0</y>       <width>800</width> -     <height>24</height> +     <height>26</height>      </rect>     </property>     <widget class="QMenu" name="menuAbouy"> diff --git a/client/mytcpsocket.cpp b/client/mytcpsocket.cpp deleted file mode 100644 index 92dd67a..0000000 --- a/client/mytcpsocket.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include <mytcpsocket.h> - -MyTcpSocket::MyTcpSocket(QObject *parent) : -    QObject(parent) -{ -} - -void MyTcpSocket::doConnect() -{ -    socket = new QTcpSocket(this); - -    connect(socket, SIGNAL(connected()),this, SLOT(connected())); -    connect(socket, SIGNAL(disconnected()),this, SLOT(disconnected())); -   // connect(socket, SIGNAL(bytesWritten(qint64)),this, SLOT(bytesWritten(qint64))); -    connect(socket, SIGNAL(readyRead()),this, SLOT(readyRead())); -    qDebug() << "connectig..."; - -    socket->connectToHost("192.168.137.141",80); - -    if(!socket->waitForConnected(5000)){ -        qDebug()<<"Error: "<< socket->errorString(); -    } -} - -void MyTcpSocket::connected(){ -    qDebug() << "connected..."; - -    socket->write("Weerdata: Temp:?\r\n\r\n\r\n\r\n"); - -} -void MyTcpSocket::disconnected(){ -    qDebug() << "disconnected..."; - -} - -void MyTcpSocket::bytesWritten(qint64 bytes){ -    qDebug() << bytes << "bytes written..."; - -} -void MyTcpSocket::readyRead(){ -    qDebug() << "reading..."; - -    qDebug() << socket->readAll(); -} diff --git a/client/mytcpsocket.h b/client/mytcpsocket.h deleted file mode 100644 index 4a7e543..0000000 --- a/client/mytcpsocket.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef MYTCPSOCKET_H -#define MYTCPSOCKET_H - -#include <QObject> -#include <QTcpSocket> -#include <QAbstractSocket> -#include <QDebug> - -class MyTcpSocket : public QObject -{ - Q_OBJECT -public: -    explicit MyTcpSocket(QObject *parent = 0); - -    void doConnect(); -signals: -public slots: -    void connected(); -    void disconnected(); -    void bytesWritten(qint64 bytes); -    void readyRead(); -private: -    QTcpSocket *socket; - - - - - -}; - - -#endif // MYTCPSOCKET_H diff --git a/client/settingsmenu.cpp b/client/settingsmenu.cpp new file mode 100644 index 0000000..139c616 --- /dev/null +++ b/client/settingsmenu.cpp @@ -0,0 +1,47 @@ +#include "settingsmenu.h" +//#include "ui_SettingsMenu.h" +#include "main.h" + +#include "mainwindow.h" + +SettingsMenu::SettingsMenu(QWidget *parent) : +    QDialog(parent), +    ui(new Ui::SettingsMenu) +{ +    _dbip = "localhost"; +    ui->setupUi(this); +} + +SettingsMenu::~SettingsMenu() +{ +    delete ui; +} + +void SettingsMenu::on_pushButton_cancel_clicked() +{ +    SettingsMenu::~SettingsMenu(); +} + +void SettingsMenu::on_pushButton_login_clicked() +{ +    _dbip = ui->lineEdit_adress->text(); +    _dbName = ui->lineEdit_database->text(); +    QString username = ui->lineEdit_username->text(); +    QString password = ui->lineEdit_password->text(); + +    dbRef.setHostName(_dbip); +    dbRef.setUserName(username); +    dbRef.setPassword(password); +    dbRef.setDatabaseName(_dbName); + +    if(dbRef.open()){ +        QMessageBox::information(this, "Connection", "GREAT SUCCES!"); +        SettingsMenu::~SettingsMenu(); +    } else { +        QMessageBox::warning(this, "No connection", "Failed to connect"); +    } +} + + + + diff --git a/client/settingsmenu.h b/client/settingsmenu.h new file mode 100644 index 0000000..881906d --- /dev/null +++ b/client/settingsmenu.h @@ -0,0 +1,34 @@ +#pragma once + +#include <QDialog> + +#include <QMessageBox> +//#include <QtSql> +//#include <QSqlDatabase> + + +namespace Ui { +class SettingsMenu; +} + +class SettingsMenu : public QDialog +{ +    Q_OBJECT + +public: +    explicit SettingsMenu(QWidget *parent = nullptr); +    ~SettingsMenu(); + +private slots: + +    void on_pushButton_cancel_clicked(); + +    void on_pushButton_login_clicked(); + +private: +    Ui::SettingsMenu *ui; + +    QString _dbName = ""; +    QString _dbip = ""; +    QString _ESPip = ""; +}; diff --git a/client/settingsmenu.ui b/client/settingsmenu.ui new file mode 100644 index 0000000..0de180f --- /dev/null +++ b/client/settingsmenu.ui @@ -0,0 +1,144 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>SettingsMenu</class> + <widget class="QDialog" name="SettingsMenu"> +  <property name="geometry"> +   <rect> +    <x>0</x> +    <y>0</y> +    <width>362</width> +    <height>273</height> +   </rect> +  </property> +  <property name="windowTitle"> +   <string>Dialog</string> +  </property> +  <widget class="QWidget" name="formLayoutWidget"> +   <property name="geometry"> +    <rect> +     <x>60</x> +     <y>60</y> +     <width>241</width> +     <height>173</height> +    </rect> +   </property> +   <layout class="QFormLayout" name="formLayout"> +    <item row="0" column="0"> +     <widget class="QLabel" name="label_3"> +      <property name="text"> +       <string>Adress</string> +      </property> +     </widget> +    </item> +    <item row="0" column="1"> +     <widget class="QLineEdit" name="lineEdit_adress"> +      <property name="text"> +       <string>localhost</string> +      </property> +      <property name="placeholderText"> +       <string>Hostname/IP-Adress</string> +      </property> +     </widget> +    </item> +    <item row="1" column="0"> +     <widget class="QLabel" name="label_4"> +      <property name="text"> +       <string>Database</string> +      </property> +     </widget> +    </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> +     </widget> +    </item> +    <item row="2" column="0" colspan="2"> +     <widget class="Line" name="line"> +      <property name="orientation"> +       <enum>Qt::Horizontal</enum> +      </property> +     </widget> +    </item> +    <item row="3" column="0"> +     <widget class="QLabel" name="label"> +      <property name="text"> +       <string>Username</string> +      </property> +     </widget> +    </item> +    <item row="3" column="1"> +     <widget class="QLineEdit" name="lineEdit_username"> +      <property name="text"> +       <string>root</string> +      </property> +      <property name="echoMode"> +       <enum>QLineEdit::PasswordEchoOnEdit</enum> +      </property> +      <property name="placeholderText"> +       <string>Username</string> +      </property> +     </widget> +    </item> +    <item row="4" column="0"> +     <widget class="QLabel" name="label_2"> +      <property name="text"> +       <string>Password</string> +      </property> +     </widget> +    </item> +    <item row="4" column="1"> +     <widget class="QLineEdit" name="lineEdit_password"> +      <property name="font"> +       <font> +        <underline>false</underline> +        <strikeout>false</strikeout> +        <kerning>true</kerning> +       </font> +      </property> +      <property name="text"> +       <string>Ab12345!</string> +      </property> +      <property name="echoMode"> +       <enum>QLineEdit::Password</enum> +      </property> +      <property name="placeholderText"> +       <string>Password</string> +      </property> +     </widget> +    </item> +    <item row="5" column="0"> +     <widget class="QLabel" name="connectLabel"> +      <property name="text"> +       <string>Connect</string> +      </property> +     </widget> +    </item> +    <item row="5" column="1"> +     <layout class="QHBoxLayout" name="horizontalLayout"> +      <item> +       <widget class="QPushButton" name="pushButton_login"> +        <property name="text"> +         <string>Login</string> +        </property> +       </widget> +      </item> +      <item> +       <widget class="QPushButton" name="pushButton_cancel"> +        <property name="text"> +         <string>Cancel</string> +        </property> +       </widget> +      </item> +     </layout> +    </item> +   </layout> +  </widget> + </widget> + <resources/> + <connections/> +</ui> diff --git a/client/timetest.cpp b/client/timetest.cpp deleted file mode 100644 index 2e575f2..0000000 --- a/client/timetest.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "timetest.h" - -TimeTest::TimeTest(QObject *parent) : QObject(parent) -{ -    timer = new QTimer(this); -    connect(timer, SIGNAL(timeout()),this,SLOT(myfunction())); -    timer->start(5000); -} - -qint16 TimeTest::myfunction() -{ -    QTime time = QTime::currentTime(); -   qint16 time_text = time.minute(); - -   return time_text; - - -} diff --git a/client/timetest.h b/client/timetest.h deleted file mode 100644 index aa1d8a5..0000000 --- a/client/timetest.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef TIMETEST_H -#define TIMETEST_H -#include <QTimer> -#include <QDebug> -#include <QObject> -#include <QDateTime> - -class TimeTest : public QObject -{ -    Q_OBJECT -public: -    explicit TimeTest(QObject *parent = 0); - -signals: -public slots: -    qint16 myfunction(); - -private: -    QTimer *timer; - - - - -}; - - -#endif // TIMETEST_H diff --git a/client/ui_dbconnector.h b/client/ui_dbconnector.h new file mode 100644 index 0000000..dec4d7b --- /dev/null +++ b/client/ui_dbconnector.h @@ -0,0 +1,163 @@ +/******************************************************************************** +** 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->setText(QCoreApplication::translate("dbConnector", "WSdb", 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(QCoreApplication::translate("dbConnector", "Ab12345!", nullptr)); +        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..69c476b --- /dev/null +++ b/client/ui_mainwindow.h @@ -0,0 +1,110 @@ +/******************************************************************************** +** 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/QLabel> +#include <QtWidgets/QMainWindow> +#include <QtWidgets/QMenu> +#include <QtWidgets/QMenuBar> +#include <QtWidgets/QStatusBar> +#include <QtWidgets/QWidget> + +QT_BEGIN_NAMESPACE + +class Ui_MainWindow +{ +public: +    QAction *actionRefresh; +    QAction *actionLOAD; +    QAction *actionQuerry; +    QAction *actionConnection; +    QAction *actionDisconnenct; +    QWidget *centralwidget; +    QLabel *label; +    QMenuBar *menubar; +    QMenu *menuAbouy; +    QMenu *menuDatabase; +    QStatusBar *statusbar; + +    void setupUi(QMainWindow *MainWindow) +    { +        if (MainWindow->objectName().isEmpty()) +            MainWindow->setObjectName(QString::fromUtf8("MainWindow")); +        MainWindow->resize(800, 600); +        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")); +        centralwidget = new QWidget(MainWindow); +        centralwidget->setObjectName(QString::fromUtf8("centralwidget")); +        label = new QLabel(centralwidget); +        label->setObjectName(QString::fromUtf8("label")); +        label->setGeometry(QRect(270, 190, 181, 51)); +        MainWindow->setCentralWidget(centralwidget); +        menubar = new QMenuBar(MainWindow); +        menubar->setObjectName(QString::fromUtf8("menubar")); +        menubar->setGeometry(QRect(0, 0, 800, 24)); +        menuAbouy = new QMenu(menubar); +        menuAbouy->setObjectName(QString::fromUtf8("menuAbouy")); +        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(menuDatabase->menuAction()); +        menuAbouy->addAction(actionRefresh); +        menuDatabase->addAction(actionConnection); +        menuDatabase->addAction(actionDisconnenct); + +        retranslateUi(MainWindow); + +        QMetaObject::connectSlotsByName(MainWindow); +    } // setupUi + +    void retranslateUi(QMainWindow *MainWindow) +    { +        MainWindow->setWindowTitle(QCoreApplication::translate("MainWindow", "MainWindow", nullptr)); +        actionRefresh->setText(QCoreApplication::translate("MainWindow", "Refresh", nullptr)); +#if QT_CONFIG(shortcut) +        actionRefresh->setShortcut(QCoreApplication::translate("MainWindow", "Ctrl+R", nullptr)); +#endif // QT_CONFIG(shortcut) +        actionLOAD->setText(QCoreApplication::translate("MainWindow", "Load", nullptr)); +        actionQuerry->setText(QCoreApplication::translate("MainWindow", "Query", nullptr)); +        actionConnection->setText(QCoreApplication::translate("MainWindow", "Connect", nullptr)); +#if QT_CONFIG(shortcut) +        actionConnection->setShortcut(QCoreApplication::translate("MainWindow", "Ctrl+O", nullptr)); +#endif // QT_CONFIG(shortcut) +        actionDisconnenct->setText(QCoreApplication::translate("MainWindow", "Disconnenct", nullptr)); +        label->setText(QCoreApplication::translate("MainWindow", "Please load data first", nullptr)); +        menuAbouy->setTitle(QCoreApplication::translate("MainWindow", "Home", 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 |