Subversion Repositories Projects

Rev

Rev 167 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 167 Rev 199
1
/***************************************************************************
1
/***************************************************************************
2
 *   Copyright (C) 2008 by Manuel Schrape                                  *
2
 *   Copyright (C) 2008 by Manuel Schrape                                  *
3
 *   manuel.schrape@gmx.de                                                 *
3
 *   manuel.schrape@gmx.de                                                 *
4
 *                                                                         *
4
 *                                                                         *
5
 *   This program is free software; you can redistribute it and/or modify  *
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  *
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.        *
7
 *   the Free Software Foundation; either version 2 of the License.        *
8
 *                                                                         *
8
 *                                                                         *
9
 *   This program is distributed in the hope that it will be useful,       *
9
 *   This program is distributed in the hope that it will be useful,       *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12
 *   GNU General Public License for more details.                          *
12
 *   GNU General Public License for more details.                          *
13
 *                                                                         *
13
 *                                                                         *
14
 *   You should have received a copy of the GNU General Public License     *
14
 *   You should have received a copy of the GNU General Public License     *
15
 *   along with this program; if not, write to the                         *
15
 *   along with this program; if not, write to the                         *
16
 *   Free Software Foundation, Inc.,                                       *
16
 *   Free Software Foundation, Inc.,                                       *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 ***************************************************************************/
18
 ***************************************************************************/
19
#ifndef GLOBAL_H
19
#ifndef GLOBAL_H
20
#define GLOBAL_H
20
#define GLOBAL_H
21
 
21
 
22
#include <QString>
22
#include <QString>
23
#include <QSize>
23
#include <QSize>
24
#include <QPoint>
24
#include <QPoint>
25
#include <QColor>
25
#include <QColor>
26
#include <QBitArray>
26
#include <QBitArray>
27
 
27
 
28
#include "Parameter_Positions.h"
28
#include "Parameter_Positions.h"
29
 
29
 
30
// Version des Seriellen Protokoll
30
// Version des Seriellen Protokoll
31
static const int VERSION_SERIAL_MAJOR = 10;
31
static const int VERSION_SERIAL_MAJOR = 10;
32
static const int VERSION_SERIAL_MINOR = 0;
32
static const int VERSION_SERIAL_MINOR = 0;
33
 
33
 
34
// Basis-Addressen der verschiedenen Hardware
34
// Basis-Addressen der verschiedenen Hardware
35
static const int ADDRESS_ALL    = 0;
35
static const int ADDRESS_ALL    = 0;
36
static const int ADDRESS_FC     = 1;
36
static const int ADDRESS_FC     = 1;
37
static const int ADDRESS_NC     = 2;
37
static const int ADDRESS_NC     = 2;
38
static const int ADDRESS_MK3MAG = 3;
38
static const int ADDRESS_MK3MAG = 3;
39
 
39
 
40
static const int SETTINGS_ID = 2;
40
static const int SETTINGS_ID = 2;
-
 
41
 
-
 
42
static const int Sleep = 500000;
41
 
43
 
42
static const QString QA_NAME = "QMK-Groundstation";
44
static const QString QA_NAME = "QMK-Groundstation";
43
static const QString QA_VERSION = "0.5.8c";
45
static const QString QA_VERSION = "0.6.3";
44
static const QString QA_DATE = "14.12.2008";
46
static const QString QA_DATE = "03.01.2009";
45
static const QString QA_YEAR = "2008";
47
static const QString QA_YEAR = "2008-2009";
46
static const QString QA_AUTHOR = "Manuel Schrape";
48
static const QString QA_AUTHOR = "Manuel Schrape";
47
static const QString QA_EMAIL  = "manuel.schrape@gmx.de";
49
static const QString QA_EMAIL  = "manuel.schrape@gmx.de";
48
 
50
 
49
static const QString QA_ABOUT =
51
static const QString QA_ABOUT =
50
    "<HTML>"
52
    "<HTML>"
51
    "<p><b><font size=8>" + QA_NAME + "</font></b></p>"
53
    "<p><b><font size=8>" + QA_NAME + "</font></b></p>"
52
    "<br />"
54
    "<br />"
53
    "Version " + QA_VERSION + " - " + QA_DATE + ""
55
    "Version " + QA_VERSION + " - " + QA_DATE + ""
54
    "<br /><br />"
56
    "<br /><br />"
55
    "(C) " + QA_YEAR + " by " + QA_AUTHOR + " - "
57
    "(C) " + QA_YEAR + " by " + QA_AUTHOR + " - "
56
    "<a href=\"mailto:" + QA_EMAIL + "\">" + QA_EMAIL + "</a> <br /><br />"
58
    "<a href=\"mailto:" + QA_EMAIL + "\">" + QA_EMAIL + "</a> <br /><br />"
57
    "Groundstation-Programm f&uuml;r den Mikrokopter zum <br>Parametrieren und Debug-Werte anzeigen, aufzeichnen & Visualisieren."
59
    "Groundstation-Programm f&uuml;r den Mikrokopter zum <br>Parametrieren und Debug-Werte anzeigen, aufzeichnen & Visualisieren."
58
    "<br /><br /> Dieses Programm wird unter den Bedingungen der GPL v2 ver&ouml;ffentlicht."
60
    "<br /><br /> Dieses Programm wird unter den Bedingungen der GPL v2 ver&ouml;ffentlicht."
59
    "</HTML>";
61
    "</HTML>";
60
 
62
 
61
static const QString Def_AnalogNames[] = {"Integral Nick", "Integral Roll", "ACC Nick", "ACC Roll", "Gyro Gier", "Hoehen-Wert", "ACC Z", "GAS", "Kompass-Value", "Spannung", "Empfang", "Ersatzkompass", "Motor Vorne", "Motor Hinten", "Motor Links", "Motor Rechts", "Analog 16", "Distance", "OSD-Bar", "MK3Mag", "Servo", "Nick", "Roll", "Analog 23", "Analog 24",  "Analog 25",  "Analog 26",  "Kalman Max",  "Analog 28",  "Kalman K", "GPS Nick", "GPS Roll"};
63
static const QString Def_AnalogNames[] = {"Integral Nick", "Integral Roll", "ACC Nick", "ACC Roll", "Gyro Gier", "Hoehen-Wert", "ACC Z", "GAS", "Kompass-Value", "Spannung", "Empfang", "Ersatzkompass", "Motor Vorne", "Motor Hinten", "Motor Links", "Motor Rechts", "Analog 16", "Distance", "OSD-Bar", "MK3Mag", "Servo", "Nick", "Roll", "Analog 23", "Analog 24",  "Analog 25",  "Analog 26",  "Kalman Max",  "Analog 28",  "Kalman K", "GPS Nick", "GPS Roll"};
62
 
64
 
63
static const QRgb Def_Colors[] = {0x00FF0000, 0x0000FF00, 0x00FFFF00, 0x000000FF, 0x00FF00FF, 0x0000FFFF, 0x00FFFFFF, 0x00660000, 0x00006600, 0x00666600, 0x00000066, 0x00660066, 0x000066, 0x00666666, 0x00990000, 0x00009900, 0x00999900, 0x00000099, 0x00990099, 0x00009999, 0x00999999, 0x00CC0000, 0x0000CC00, 0x00CCCC00, 0x000000CC, 0x00CC00CC, 0x0000CCCC, 0x00CCCCCC, 0x0066FF99, 0x009966FF, 0x00FF9966, 0x0099FF66};
65
static const QRgb Def_Colors[] = {0x00FF0000, 0x0000FF00, 0x00FFFF00, 0x000000FF, 0x00FF00FF, 0x0000FFFF, 0x00FFFFFF, 0x00660000, 0x00006600, 0x00666600, 0x00000066, 0x00660066, 0x000066, 0x00666666, 0x00990000, 0x00009900, 0x00999900, 0x00000099, 0x00990099, 0x00009999, 0x00999999, 0x00CC0000, 0x0000CC00, 0x00CCCC00, 0x000000CC, 0x00CC00CC, 0x0000CCCC, 0x00CCCCCC, 0x0066FF99, 0x009966FF, 0x00FF9966, 0x0099FF66};
64
 
66
 
65
static const bool Def_Plot_Show[] = {1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0};
67
static const bool Def_Plot_Show[] = {1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0};
66
static const bool Def_Log[]       = {1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0};
68
static const bool Def_Log[]       = {1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0};
67
 
69
 
68
static const QString HardwareType[] = {"Default", "FlightCtrl", "NaviCtrl", "MK3Mag"};
70
static const QString HardwareType[] = {"Default", "FlightCtrl", "NaviCtrl", "MK3Mag"};
69
 
71
 
70
static const int MaxTickerEvents = 5;
72
static const int MaxTickerEvents = 5;
71
 
73
 
72
static const int MaxAnalog    = 32;
74
static const int MaxAnalog    = 32;
73
static const int MaxPlot      = 50000;
75
static const int MaxPlot      = 50000;
-
 
76
 
-
 
77
static const int MaxNaviPos   = 2000;
74
 
78
 
75
struct sMode
79
struct sMode
76
{
80
{
77
    int ID;
81
    int ID;
78
    int VERSION_MAJOR;
82
    int VERSION_MAJOR;
79
    int VERSION_MINOR;
83
    int VERSION_MINOR;
80
    int VERSION_PATCH;
84
    int VERSION_PATCH;
81
    int VERSION_SERIAL_MAJOR;
85
    int VERSION_SERIAL_MAJOR;
82
    int VERSION_SERIAL_MINOR;
86
    int VERSION_SERIAL_MINOR;
83
    QString Hardware;
87
    QString Hardware;
84
    QString Version;
88
    QString Version;
85
};
89
};
86
 
90
 
87
struct sRxData
91
struct sRxData
88
{
92
{
89
    char *Input;
93
    char *Input;
90
    QString String;
94
    QString String;
91
    int Decode[150];
95
    int Decode[150];
-
 
96
    int DecLen;
-
 
97
};
-
 
98
 
-
 
99
struct sGPS_Pos
-
 
100
{
-
 
101
    long Longitude;
-
 
102
    long Latitude;
-
 
103
    long Altitude;
-
 
104
};
-
 
105
 
-
 
106
struct sNaviData
-
 
107
{
-
 
108
    sGPS_Pos Current;
-
 
109
    sGPS_Pos Target;
-
 
110
    sGPS_Pos Home;
-
 
111
 
-
 
112
 
-
 
113
    long Longitude;
-
 
114
    long Latitude;
-
 
115
    long Altitude;
-
 
116
};
-
 
117
 
-
 
118
struct sNaviString
-
 
119
{
-
 
120
    QString Longitude;
-
 
121
    QString Latitude;
-
 
122
    QString Altitude;
92
};
123
};
93
 
124
 
94
#endif
125
#endif
95
 
126