Subversion Repositories Projects

Rev

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