Rev 234 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 234 | Rev 246 | ||
---|---|---|---|
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 | #ifdef _WIN32_ |
30 | #ifdef _WIN32_ |
31 | static const QString OS_PORT = "COM1"; |
31 | static const QString OS_PORT = "COM1"; |
32 | #else |
32 | #else |
33 | static const QString OS_PORT = "/dev/ttyUSB0"; |
33 | static const QString OS_PORT = "/dev/ttyUSB0"; |
34 | #endif |
34 | #endif |
35 | 35 | ||
36 | //#define _EEEPC_ |
36 | //#define _EEEPC_ |
37 | 37 | ||
38 | #ifdef _EEEPC_ |
38 | #ifdef _EEEPC_ |
39 | static const int MeterSize = 125; |
39 | static const int MeterSize = 125; |
40 | #else |
40 | #else |
41 | static const int MeterSize = 160; |
41 | static const int MeterSize = 160; |
42 | #endif |
42 | #endif |
43 | 43 | ||
44 | // Version des Seriellen Protokoll |
44 | // Version des Seriellen Protokoll |
45 | static const int VERSION_SERIAL_MAJOR = 10; |
45 | static const int VERSION_SERIAL_MAJOR = 10; |
46 | static const int VERSION_SERIAL_MINOR = 0; |
46 | static const int VERSION_SERIAL_MINOR = 0; |
47 | 47 | ||
48 | // Basis-Addressen der verschiedenen Hardware |
48 | // Basis-Addressen der verschiedenen Hardware |
49 | static const int ADDRESS_ALL = 0; |
49 | static const int ADDRESS_ALL = 0; |
50 | static const int ADDRESS_FC = 1; |
50 | static const int ADDRESS_FC = 1; |
51 | static const int ADDRESS_NC = 2; |
51 | static const int ADDRESS_NC = 2; |
52 | static const int ADDRESS_MK3MAG = 3; |
52 | static const int ADDRESS_MK3MAG = 3; |
53 | 53 | ||
54 | static const int SETTINGS_ID = 2; |
54 | static const int SETTINGS_ID = 2; |
55 | 55 | ||
56 | static const int SLEEP = 500000; |
56 | static const int SLEEP = 500000; |
57 | 57 | ||
58 | static const QString QA_NAME = "QMK-Groundstation"; |
58 | static const QString QA_NAME = "QMK-Groundstation"; |
- | 59 | static const QString QA_VERSION_NR = "0.7.0m"; |
|
- | 60 | ||
59 | #ifdef _BETA_ |
61 | #ifdef _BETA_ |
60 | static const QString QA_VERSION = "0.7.0g (BETA)"; |
62 | static const QString QA_VERSION = QA_VERSION_NR + " (BETA)"; |
- | 63 | static const QString QA_HWVERSION = "FlightCtrl v0.72f & NaviCtrl v0.13a"; |
|
61 | #else |
64 | #else |
62 | static const QString QA_VERSION = "0.7.0g"; |
65 | static const QString QA_VERSION = QA_VERSION_NR; |
- | 66 | static const QString QA_HWVERSION = "FlightCtrl v0.71h & NaviCtrl v0.12i"; |
|
63 | #endif |
67 | #endif |
- | 68 | ||
64 | static const QString QA_DATE = "28.01.2009"; |
69 | static const QString QA_DATE = "03.02.2009"; |
65 | static const QString QA_YEAR = "2008-2009"; |
70 | static const QString QA_YEAR = "2008-2009"; |
66 | static const QString QA_AUTHOR = "Manuel Schrape"; |
71 | static const QString QA_AUTHOR = "Manuel Schrape"; |
67 | static const QString QA_EMAIL = "manuel.schrape@gmx.de"; |
72 | static const QString QA_EMAIL = "manuel.schrape@gmx.de"; |
68 | 73 | ||
69 | static const QString QA_ABOUT = |
74 | static const QString QA_ABOUT = |
70 | "<HTML>" |
75 | "<HTML>" |
71 | "<p><b><font size=8>" + QA_NAME + "</font></b></p>" |
76 | "<p><b><font size=8>" + QA_NAME + "</font></b></p>" |
72 | "<br />" |
77 | "<br />" |
73 | "Version " + QA_VERSION + " - " + QA_DATE + "" |
78 | "Version " + QA_VERSION + " - " + QA_DATE + "" |
- | 79 | "<br /><b>kompatibel zu " + QA_HWVERSION + "</b>" |
|
74 | "<br /><br />" |
80 | "<br /><br />" |
75 | "(C) " + QA_YEAR + " by " + QA_AUTHOR + " - " |
81 | "(C) " + QA_YEAR + " by " + QA_AUTHOR + " - " |
76 | "<a href=\"mailto:" + QA_EMAIL + "\">" + QA_EMAIL + "</a> <br /><br />" |
82 | "<a href=\"mailto:" + QA_EMAIL + "\">" + QA_EMAIL + "</a> <br /><br />" |
77 | "Groundstation-Programm für den Mikrokopter zum <br>Parametrieren und Debug-Werte anzeigen, aufzeichnen & Visualisieren." |
83 | "Groundstation-Programm für den Mikrokopter zum <br>Parametrieren und Debug-Werte anzeigen, aufzeichnen & Visualisieren." |
78 | "<br /><br /> Dieses Programm wird unter den Bedingungen der GPL v2 veröffentlicht." |
84 | "<br /><br /> Dieses Programm wird unter den Bedingungen der GPL v2 veröffentlicht." |
79 | "</HTML>"; |
85 | "</HTML>"; |
80 | 86 | ||
81 | 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"}; |
87 | 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"}; |
82 | 88 | ||
83 | 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}; |
89 | 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}; |
84 | 90 | ||
85 | 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}; |
91 | 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}; |
86 | 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}; |
92 | 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}; |
87 | 93 | ||
88 | static const QString HardwareType[] = {"Default", "FlightCtrl", "NaviCtrl", "MK3Mag"}; |
94 | static const QString HardwareType[] = {"Default", "FlightCtrl", "NaviCtrl", "MK3Mag"}; |
89 | 95 | ||
90 | static const int MaxTickerEvents = 5; |
96 | static const int MaxTickerEvents = 5; |
91 | 97 | ||
92 | static const int MaxAnalog = 32; |
98 | static const int MaxAnalog = 32; |
93 | static const int MaxPlot = 50000; |
99 | static const int MaxPlot = 50000; |
94 | 100 | ||
95 | static const int MaxNaviPos = 2000; |
101 | static const int MaxNaviPos = 2000; |
96 | 102 | ||
97 | struct sMode |
103 | struct sMode |
98 | { |
104 | { |
99 | int ID; |
105 | int ID; |
100 | int VERSION_MAJOR; |
106 | int VERSION_MAJOR; |
101 | int VERSION_MINOR; |
107 | int VERSION_MINOR; |
102 | int VERSION_PATCH; |
108 | int VERSION_PATCH; |
103 | int VERSION_SERIAL_MAJOR; |
109 | int VERSION_SERIAL_MAJOR; |
104 | int VERSION_SERIAL_MINOR; |
110 | int VERSION_SERIAL_MINOR; |
105 | QString Hardware; |
111 | QString Hardware; |
106 | QString Version; |
112 | QString Version; |
107 | }; |
113 | }; |
108 | 114 | ||
109 | struct sRxData |
115 | struct sRxData |
110 | { |
116 | { |
111 | char *Input; |
117 | char *Input; |
112 | QString String; |
118 | QString String; |
113 | int Decode[150]; |
119 | int Decode[150]; |
114 | int DecLen; |
120 | int DecLen; |
115 | }; |
121 | }; |
116 | 122 | ||
117 | struct sGPS_Pos |
123 | struct sGPS_Pos |
118 | { |
124 | { |
119 | long Longitude; |
125 | long Longitude; |
120 | long Latitude; |
126 | long Latitude; |
121 | long Altitude; |
127 | long Altitude; |
122 | }; |
128 | }; |
123 | 129 | ||
124 | struct sNaviData |
130 | struct sNaviData |
125 | { |
131 | { |
126 | sGPS_Pos Current; |
132 | sGPS_Pos Current; |
127 | sGPS_Pos Target; |
133 | sGPS_Pos Target; |
128 | sGPS_Pos Home; |
134 | sGPS_Pos Home; |
129 | 135 | ||
130 | 136 | ||
131 | long Longitude; |
137 | long Longitude; |
132 | long Latitude; |
138 | long Latitude; |
133 | long Altitude; |
139 | long Altitude; |
134 | }; |
140 | }; |
135 | 141 | ||
136 | struct sNaviString |
142 | struct sNaviString |
137 | { |
143 | { |
138 | QString Longitude; |
144 | QString Longitude; |
139 | QString Latitude; |
145 | QString Latitude; |
140 | QString Altitude; |
146 | QString Altitude; |
141 | }; |
147 | }; |
142 | 148 | ||
143 | #endif |
149 | #endif |
144 | 150 |