Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
170 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"
37
#include "wdg_Settings.h"
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:
53
    bool AllowSend;
54
 
55
    // Object für Serielport
56
    ManageSerialPort *serialPort;
57
 
58
    // Settings-Object (Programmeinstellungen)
59
    cSettings *Settings;
60
 
61
    // Settings-Widget (FC-Settings)
62
    wdg_Settings *f_Settings;
63
 
64
    // Default-Ticker
65
    QTimer *Ticker;
66
 
67
    // Kopie der Tabs des Hauptfensters
68
    QWidget *TabWidgets[6];
69
 
70
    // Analogwert-Beschreibungen
71
    QLabel *lb_Analog[MaxAnalog];
72
 
73
    // Analogwerte
74
    int AnalogData[MaxAnalog];
75
 
76
    // Plots für die Analogwerte
77
    QwtPlotCurve *Plot[MaxAnalog];
78
 
79
    // Datenspeicher für die Plots
80
    double aData[MaxAnalog][MaxPlot];
81
    double aID[MaxPlot];
82
    int NextPlot;
83
 
84
    // Ticker-Event-Array
85
    bool TickerEvent[MaxTickerEvents];
86
    bool TickerDiv;
87
 
88
    // Aktuelle und Max-Anzahl der LCD-Seiten
89
    int LCD_Page;
90
    int LCD_MAX_Page;
91
 
92
    // Object für das Datenfile;
93
    QFile  *CSVFile;
94
 
95
    sMode Mode;
96
    sRxData RxData;
97
 
98
    QString RXS;
99
    QString LastSend;
100
 
101
    // Softwareupdate
102
    QProcess *Update;
103
 
104
    // Sendedatenbuffer
105
    char TX_Data[150];
106
 
107
    // FC-Settings
108
    int FCSettings[MaxParameter];
109
 
110
    // Programm Initialisieren
111
    void init_GUI();
112
    void init_Objects();
113
    void init_Connections();
114
    void init_Arrays();
115
    void init_Plot();
116
 
117
    // Daten-Plotter
118
    void update_Plot();
119
    void config_Plot();
120
 
121
    // Daten Senden, Empfangen und verarbeiten
122
    void send_Data(char CMD, int Address, char Data[150],unsigned int Length, bool Resend = true);
123
    void new_RXData(sRxData RX);
124
 
125
    // Debugdaten anzeigen und speichern.
126
    void show_DebugData();
127
    void write_CSV();
128
 
129
    // Programmeinstellungen speichern
130
    void set_Preferences();
131
 
132
private slots:
133
    void slot_ac_Config();
134
    void slot_ac_Preferences();
135
    void slot_ac_StartPlotter();
136
    void slot_ac_View();
137
    void slot_ac_MehrDaten();
138
    void slot_ac_KeineDaten();
139
    void slot_ac_About();
140
    void slot_ac_GetLabels();
141
    void slot_ac_Motortest();
142
    void slot_pb_HexFile();
143
 
144
    // Default-Ticker
145
    void slot_Ticker();
146
 
147
    // LCD-Seite vor / zurück
148
    void slot_LCD_UP();
149
    void slot_LCD_DOWN();
150
 
151
    void slot_Motortest(int Motor1, int Motor2, int Motor3, int Motor4);
152
 
153
    // Firmeware-Update
154
    void slot_pb_Update();
155
    void slot_UpdateShell();
156
 
157
    // Seriell-Port Slots
158
    void slot_newDataReceived(const QByteArray &dataReceived);
159
    void slot_OpenPort();
160
 
161
    void slot_TabChanged(int Tab);
162
 
163
    void slot_RecordCSV();
164
 
165
    void slot_ScrollPlot(int Pos);
166
 
167
    // FC-Settings lesen / Schreiben
168
    void slot_GetFCSettings();
169
    void slot_SetFCSettings();
170
};
171
 
172
#endif