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