Subversion Repositories Projects

Rev

Rev 166 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
158 KeyOz 1
/***************************************************************************
2
 *   Copyright (C) 2008 by Manuel Schrape                                  *
3
 *   manuel.schrape@gmx.de                                                 *
4
 *                                                                         *
5
 *   This program is free software; you can redistribute it and/or modify  *
6
 *   it under the terms of the GNU General Public License as published by  *
7
 *   the Free Software Foundation; either version 2 of the License.        *
8
 *                                                                         *
9
 *   This program is distributed in the hope that it will be useful,       *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12
 *   GNU General Public License for more details.                          *
13
 *                                                                         *
14
 *   You should have received a copy of the GNU General Public License     *
15
 *   along with this program; if not, write to the                         *
16
 *   Free Software Foundation, Inc.,                                       *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 ***************************************************************************/
19
 
20
 
21
#ifndef MKTOOL_H
22
#define MKTOOL_H
23
 
24
#include <QMainWindow>
25
#include <QSettings>
26
#include <QString>
27
#include <QTimer>
28
#include <QComboBox>
29
#include <QIcon>
30
#include <QProcess>
31
 
32
#include <qwt_plot_curve.h>
33
#include <qwt_plot_grid.h>
34
#include <qwt_legend.h>
35
#include <qwt_plot.h>
36
#include "ui_mktool.h"
167 KeyOz 37
#include "wdg_Settings.h"
158 KeyOz 38
 
39
#include "../SerialPort/ManageSerialPort.h"
40
#include "../cSettings.h"
41
 
42
class QextSerialPort;
43
 
44
class MKTool : public QMainWindow, public Ui::dlg_mktool_UI
45
{
46
      Q_OBJECT
47
 
48
public:
49
      MKTool();
50
      ~MKTool();
51
 
52
private:
159 KeyOz 53
    bool AllowSend;
158 KeyOz 54
    // Object für Serielport
55
    ManageSerialPort *serialPort;
56
 
57
    // Settings-Object
58
    cSettings *Settings;
59
 
167 KeyOz 60
    // Settings-Widget
61
    wdg_Settings *f_Settings;
62
 
158 KeyOz 63
    // Default-Ticker
64
    QTimer *Ticker;
65
 
66
    // Die Tabs des Hauptfensters
67
    QWidget *TabWidgets[6];
68
 
69
    // Analogwert-Beschreibungen
70
    QLabel *lb_Analog[MaxAnalog];
71
 
72
    // Analogwerte
73
    int AnalogData[MaxAnalog];
74
 
75
    // Plots für die Analogwerte
76
    QwtPlotCurve *Plot[MaxAnalog];
77
 
78
    // Datenspeicher für die Plots
79
    double aData[MaxAnalog][MaxPlot];
80
    double aID[MaxPlot];
81
    int NextPlot;
82
 
83
    // Ticker-Event-Array
84
    bool TickerEvent[MaxTickerEvents];
85
    bool TickerDiv;
86
 
159 KeyOz 87
    int LCD_Page;
88
    int LCD_MAX_Page;
89
 
158 KeyOz 90
    // Alle Icons
91
    QIcon Icons[30];
92
 
93
//    QByteArray allDataReceived;
94
 
95
    // Object für das Datenfile;
96
    QFile  *CSVFile;
97
 
98
    sMode Mode;
99
    sRxData RxData;
100
 
101
    QString RXS;
102
    QString LastSend;
103
 
167 KeyOz 104
    // Softwareupdate
162 KeyOz 105
    QProcess *Update;
158 KeyOz 106
 
107
    char TX_Data[150];
108
 
109
    int ParameterSet[11][MaxParameter];
110
 
111
    // Programm Initialisieren
112
    void init_GUI();
113
    void init_Objects();
114
    void init_Connections();
115
    void init_Arrays();
116
    void init_Icons();
117
    void init_Plot();
118
 
119
    // Daten-Plotter
120
    void update_Plot();
121
    void config_Plot();
122
 
123
    // Daten Senden, Empfangen und verarbeiten
159 KeyOz 124
    void send_Data(char CMD, int Address, char Data[150],unsigned int Length, bool Resend = true);
158 KeyOz 125
    void new_RXData(sRxData RX);
126
 
127
    // Debugdaten anzeigen und speichern.
128
    void show_DebugData();
129
    void write_CSV();
130
 
131
    // Programmeinstellungen speichern
167 KeyOz 132
    void set_Preferences();
158 KeyOz 133
 
134
private slots:
135
    void slot_ac_Config();
159 KeyOz 136
    void slot_ac_Preferences();
158 KeyOz 137
    void slot_ac_StartPlotter();
138
    void slot_ac_View();
139
    void slot_ac_MehrDaten();
166 KeyOz 140
    void slot_ac_KeineDaten();
158 KeyOz 141
    void slot_ac_About();
142
    void slot_ac_GetLabels();
143
    void slot_ac_Motortest();
166 KeyOz 144
    void slot_pb_HexFile();
158 KeyOz 145
 
146
    // Default-Ticker
147
    void slot_Ticker();
148
 
159 KeyOz 149
    void slot_LCD_UP();
150
    void slot_LCD_DOWN();
151
 
158 KeyOz 152
    void slot_Motortest(int Motor1, int Motor2, int Motor3, int Motor4);
153
 
154
    void slot_pb_Update();
155
 
156
    void slot_UpdateShell();
157
 
158
    // Seriell-Port Slots
159
    void slot_newDataReceived(const QByteArray &dataReceived);
160
    void slot_OpenPort();
161
 
162
    void slot_TabChanged(int Tab);
163
 
164
    void slot_RecordCSV();
165
 
166
    void slot_ScrollPlot(int Pos);
167
 
168
    void slot_GetParameter();
169
    void slot_SetParameter();
170
};
171
 
172
#endif