-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
128 lines (103 loc) · 4.59 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/******************************************************************************
* *File: mainwindow.h *
* *Date: 2013-09-29 *
* *Version: 1.0 *
* *Author(s): Jochen Bauer <[email protected]> *
* Lukas Kern <[email protected]> *
* Carsten Klein <[email protected]> *
* *
* *License information: *
* *
* Copyright (C) [2013] [Jochen Bauer, Lukas Kern, Carsten Klein] *
* *
* This file is part of PLCANALYZER. PLCANALYZER is free software; you can *
* redistribute it and/or modify it under the terms of the GNU General *
* Public License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301, USA. *
* *
* *Program name: PLCANALYZER *
* *What this program does: Connects to most SIMATIC S7/S5 Controllers *
* * Reads memory areas *
* * Draws a graph over time for operands *
* *Have fun! *
******************************************************************************/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
//moved from initial mainwindow.cpp due to strange linux compile errors
#include "ui_mainwindow.h"
#include <QMainWindow>
#include <QProcess>
#include <QDebug>
#include <QTextEdit>
#include <iostream>
#include "stdoutredirector.h"
#include "s7connection.h"
#include "xmlsettingshandler.h"
#include "connectionsettings.h"
#include <QColor>
#include "filestream.h"
#include "qcustomplot.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
ConSets* currentConsets;
S7Connection MyS7Connection;
Ui::MainWindow *ui;
ConnectionSettings ConDiag;
QVector<ConSlot> MySlot;
private slots:
void on_Button_Connect_clicked();
// uncommented due to obsolescence
// void on_Button_Get_Val_clicked();
void ChangeSettings(ConSets* NewConSets);
void TimeOut();
void on_pushButton_ConSets_clicked();
void on_Button_read_slots_clicked();
void changeSlots(const QVector<ConSlot> &newConSlots);
void on_pushButton_clicked();
//Menu entries
void on_actionNewProject_triggered();
void on_actionOpenProject_triggered();
void on_actionSaveProject_triggered();
void on_actionAbout_QT_triggered();
void on_actionAbout_triggered();
void on_actionHelp_triggered();
void on_clearGraphs_clicked();
signals:
private:
int recordings;
int amountOfPoints;
QVector<double> x; // 1d Vector
QVector<QVector<double>> y; // 2d Vectot
QTimer* timer;
xmlSettingsHandler* xmlSettings;
QTextEdit* debugText;
//Lists for the OperandValues
QList<QLabel*> labelsOperand;
QList<QLineEdit*> lineEditsOperandValue;
//Compare funqtions for the qsort algorithm
static bool labelPointerLessThan(QLabel* label1, QLabel* label2);
static bool lineEditPointerLessThan(QLineEdit* le1, QLineEdit* le2);
// Binary file logger
BinWriter myWriter;
// About Dialog
QDialog* aboutDialog;
// Help Widget
QWidget* helpWidget;
};
#endif // MAINWINDOW_H