Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
279 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 <qwt_compass.h>
37
#include <qwt_compass_rose.h>
38
#include <qwt_dial_needle.h>
39
 
40
#include "ui_mktool.h"
41
#include "wdg_Settings.h"
42
#include "dlg_LCD.h"
43
 
44
#include "../Classes/cConnection.h"
45
#include "../Classes/cSettings.h"
46
#include "../Classes/cServer.h"
47
#include "../Classes/cQMK_Server.h"
48
#include "../Classes/cAttitude.h"
49
#include "../Classes/cSpeedMeter.h"
50
#include "../Logger/Logger.h"
51
#include "../typedefs.h"
52
 
53
class QextSerialPort;
54
 
55
class MKTool : public QMainWindow, public Ui::dlg_mktool_UI
56
{
57
      Q_OBJECT
58
 
59
public:
60
      MKTool();
61
      ~MKTool();
62
 
63
private:
64
 
65
    // Object für Kopter-Verbindung
66
    cConnection *Conn;
67
 
68
    // Settings-Object (Programmeinstellungen)
69
    cSettings *Settings;
70
 
71
    // Settings-Widget (FC-Settings)
72
    wdg_Settings *f_Settings;
73
 
74
    // HTTP-Server-Object für Google Earth
75
    cServer *GE_Server;
76
 
77
    // QMK-Serverobjekt
78
    cQMK_Server *QMK_Server;
79
 
80
    // LCD-Dialog
81
    dlg_LCD *f_LCD;
82
 
83
    //TCP-Socket
84
    QTcpSocket *TcpSocket;
85
 
86
    // Default-Ticker
87
    QTimer *Ticker;
88
 
89
    // Kopie der Tabs des Hauptfensters
90
    QWidget *TabWidgets[7];
91
 
92
    // Analogwert-Beschreibungen
93
    QLabel *lb_Analog[MaxAnalog];
94
 
95
    // Analogwerte
96
    int AnalogData[MaxAnalog];
97
 
98
    // Plots für die Analogwerte
99
    QwtPlotCurve *Plot[MaxAnalog];    
100
 
101
    // Datenspeicher für die Plots
102
    double aData[MaxAnalog][MaxPlot];
103
    double aID[MaxPlot];
104
    int NextPlot;
105
 
106
    AttitudeIndicator *Attitude;
107
    cSpeedMeter * SpeedMeter;
108
 
109
    // Ticker-Event-Array
110
    bool TickerEvent[MaxTickerEvents];
111
    bool TickerDiv;
112
 
113
    // Aktuelle und Max-Anzahl der LCD-Seiten
114
    int LCD_Page;
115
    int LCD_MAX_Page;
116
 
117
    //Logger für CVS und andere
118
    Logger * logger;
119
 
120
    sMode Mode;
121
    sRxData RxData;
122
    sNaviData Navi;
123
 
124
    QString RXS;
125
    QString LastSend;
126
 
127
    // Softwareupdate
128
    QProcess *Update;
129
 
130
    // Sendedatenbuffer
131
    char TX_Data[150];
132
 
133
    // FC-Settings
134
    int FCSettings[MaxParameter];
135
 
136
    // Programm Initialisieren
137
    void init_GUI();
138
    void init_Objects();
139
    void init_Connections();
140
    void init_Arrays();
141
    void init_Plot();
142
 
143
    // Daten-Plotter
144
    void update_Plot();
145
    void config_Plot();
146
 
147
    void new_NaviData(sRxData RX);
148
    void parse_TargetKML();
149
 
150
    // Debugdaten anzeigen und speichern.
151
    void show_DebugData();
152
    void update_Log();
153
 
154
    // Programmeinstellungen speichern
155
    void set_Preferences();
156
 
157
private slots:
158
    void slot_QMKS_Connect();
159
    void slot_QMKS_Connected();
160
    void slot_QMKS_Disconnected(int Error);
161
 
162
    void slot_showTerminal(int Typ, QString Text);
163
 
164
    void slot_ac_Hardware();
165
    void slot_rb_Hardware();
166
 
167
    void slot_ac_StartServer();
168
 
169
    void slot_Test();
170
 
171
    void slot_ac_Config();
172
    void slot_ac_Preferences();
173
    void slot_ac_StartPlotter();
174
    void slot_ac_View();
175
    void slot_ac_FastDebug();
176
    void slot_ac_NoDebug();
177
    void slot_ac_FastNavi();
178
    void slot_ac_NoNavi();
179
    void slot_ac_About();
180
    void slot_ac_GetLabels();
181
    void slot_ac_Motortest();
182
    void slot_ac_LCD();
183
 
184
    void slot_pb_HexFile();
185
    void slot_pb_SendWaypoint();
186
 
187
    // Default-Ticker
188
    void slot_Ticker();
189
 
190
    // LCD-Seite vor / zurück
191
    void slot_LCD_UP();
192
    void slot_LCD_DOWN();
193
 
194
    void slot_Motortest(int Motor1, int Motor2, int Motor3, int Motor4);
195
 
196
    // Firmeware-Update
197
    void slot_pb_Update();
198
    void slot_UpdateShell();
199
 
200
    // Seriell-Port Slots
201
    void slot_newData(sRxData RX);
202
    void slot_OpenPort();
203
 
204
    void slot_TabChanged(int Tab);
205
 
206
    void slot_RecordLog();
207
 
208
    void slot_ScrollPlot(int Pos);
209
 
210
    // FC-Settings lesen / Schreiben
211
    void slot_GetFCSettings();
212
    void slot_SetFCSettings();
213
};
214
 
215
#endif