Subversion Repositories Projects

Rev

Rev 538 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
538 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
#ifndef GLOBAL_H
20
#define GLOBAL_H
21
 
22
#include <QString>
23
#include <QSize>
24
#include <QPoint>
25
#include <QColor>
26
#include <QBitArray>
27
 
28
#include "Parameter_Positions.h"
29
 
30
#ifdef _WIN32_
31
static const QString OS_PORT = "COM1";
32
#else
33
static const QString OS_PORT = "/dev/ttyUSB0";
34
#endif
35
 
36
//#define _EEEPC_
37
 
38
// Version des Seriellen Protokoll
39
static const int VERSION_SERIAL_MAJOR = 10;
40
static const int VERSION_SERIAL_MINOR = 0;
41
 
42
// Basis-Addressen der verschiedenen Hardware
43
static const int ADDRESS_ALL    = 0;
44
static const int ADDRESS_FC     = 1;
45
static const int ADDRESS_NC     = 2;
46
static const int ADDRESS_MK3MAG = 3;
47
 
48
static const int SETTINGS_ID = 2;
49
 
50
static const int SLEEP = 500000;
51
 
52
#ifdef _EEEPC_
53
    static const int MeterSize = 125;
54
    static const int TICKER = 5000;
55
#else
56
    static const int MeterSize = 160;
57
    static const int TICKER = 2000;
58
#endif
59
 
60
static const QString QA_NAME = "QMK-Groundstation";
548 KeyOz 61
static const QString QA_VERSION_NR = "1.0.1";
538 KeyOz 62
 
63
#ifdef _BETA_
64
    static const QString QA_VERSION = QA_VERSION_NR + " (BETA)";
65
    static const QString QA_HWVERSION = "FlightCtrl v0.75a & NaviCtrl v0.15c";
66
#else
67
    static const QString QA_VERSION = QA_VERSION_NR;
68
    static const QString QA_HWVERSION = "FlightCtrl v0.75a & NaviCtrl v0.15c";
69
#endif
70
 
71
#ifdef Q_OS_LINUX
72
    static const QString QA_OS = "Linux";
73
#else
74
    #ifdef Q_OS_DARWIN
75
        static const QString QA_OS = "OSX";
76
    #else
77
        #ifdef Q_OS_WIN32
78
            static const QString QA_OS = "Windows";
79
        #else
80
            static const QString QA_OS = "n/a";
81
        #endif
82
    #endif
83
#endif
84
 
85
 
86
static const QString QA_DATE = "19.07.2009";
87
static const QString QA_YEAR = "2008-2009";
88
static const QString QA_AUTHOR = "Manuel Schrape";
89
static const QString QA_EMAIL  = "manuel.schrape@gmx.de";
90
 
91
static const QString QA_ABOUT =
92
    "<HTML>"
93
    "<p><b><font size=8>" + QA_NAME + "</font></b></p>"
94
    "<br />"
95
    "Version " + QA_VERSION + " - " + QA_DATE + " on " + QA_OS + ""
96
    "<br /><br /><b>kompatibel zu " + QA_HWVERSION + "</b>"
97
    "<br /><br />"
98
    "(C) " + QA_YEAR + " by " + QA_AUTHOR + " - "
99
    "<a href=\"mailto:" + QA_EMAIL + "\">" + QA_EMAIL + "</a> <br /><br />"
100
    "Groundstation-Programm f&uuml;r den Mikrokopter zum <br>Parametrieren und Debug-Werte anzeigen, aufzeichnen & Visualisieren."
101
    "<br /><br /> Dieses Programm wird unter den Bedingungen der GPL v2 ver&ouml;ffentlicht."
102
    "</HTML>";
103
 
104
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"};
105
 
106
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};
107
 
108
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};
109
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};
110
 
111
static const QString HardwareType[] = {"Default", "FlightCtrl", "NaviCtrl", "MK3Mag"};
112
 
113
static const int MaxTickerEvents = 5;
114
 
115
static const int MaxAnalog    = 32;
116
static const int MaxPlot      = 50000;
117
 
118
static const int MaxNaviPos   = 2000;
119
 
120
struct sMotor
121
{
122
    int Speed[12];
123
};
124
 
125
struct sMode
126
{
127
    int ID;
128
    int VERSION_MAJOR;
129
    int VERSION_MINOR;
130
    int VERSION_PATCH;
131
    int VERSION_SERIAL_MAJOR;
132
    int VERSION_SERIAL_MINOR;
133
    QString Hardware;
134
    QString Version;
135
};
136
 
137
struct sRxData
138
{
139
    char *Input;
140
    QString String;
141
    int Decode[150];
142
    int DecLen;
143
};
144
 
145
struct sGPS_Pos
146
{
147
    long Longitude;
148
    long Latitude;
149
    long Altitude;
150
};
151
 
152
struct sNaviData
153
{
154
    sGPS_Pos Current;
155
    sGPS_Pos Target;
156
    sGPS_Pos Home;
157
 
158
 
159
    long Longitude;
160
    long Latitude;
161
    long Altitude;
162
};
163
 
164
struct sNaviString
165
{
166
    QString Longitude;
167
    QString Latitude;
168
    QString Altitude;
169
};
170
 
171
struct sWayPoint
172
{
173
    double Longitude;
174
    double Latitude;
175
    double Altitude;
176
    int Time;
177
};
178
 
179
#endif