File: global.h

package info (click to toggle)
mtrack 0.3-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 972 kB
  • ctags: 414
  • sloc: ansic: 4,898; makefile: 86
file content (299 lines) | stat: -rw-r--r-- 6,915 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
/*
 *   Copyright (C) 1991-1999 by Jonathan Naylor G4KLX
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#define CAT_LIST_WIDTH  180
#define CAT_LIST_HEIGHT 220  

#define SAT_LIST_WIDTH  180
#define SAT_LIST_HEIGHT 220

#define	MAP_WIDTH	780
#define	MAP_HEIGHT	400
#define	MAP_TEXT_HEIGHT	72

#define	LOC_HEIGHT	350
#define	LOC_WIDTH	430

#define	ELEM_HEIGHT	250
#define	ELEM_WIDTH	320

#define	TRACK_HEIGHT	350
#define	TRACK_WIDTH	550

#define	BORDER_WIDTH	10
#define	BORDER_ITEM	5

#define	LIST_HEIGHT	180
#define	LIST_WIDTH	180

#define	HELP_LIST_HEIGHT 200
#define	HELP_LIST_WIDTH	 350

#define	TEXT_HEIGHT	350
#define	TEXT_WIDTH	500

#define	TEXT_SAT	0
#define	TEXT_DATETIME	1
#define	TEXT_AZIMUTH	2
#define	TEXT_ELEVATION	3
#define	TEXT_MA		4
#define	TEXT_MODE	5
#define	TEXT_RANGE	6
#define	TEXT_ORBIT	7
#define	TEXT_SQUINT	8
#define	TEXT_FREQ1	9
#define	TEXT_FREQ2	10
#define	TEXT_ALOS1	11
#define	TEXT_ALOS2	12

#define	DATE_FORMAT_DDMMYYYY	0
#define	DATE_FORMAT_MMDDYYYY	1

#define	COLOUR_BACKGROUND	0
#define	COLOUR_CITIES		1
#define	COLOUR_FOOTPRINT	2
#define	COLOUR_LAND		3
#define	COLOUR_SATELLITE	4
#define	COLOUR_USER		5
#define MAX_COLOURS		6

#define MAX_CHOSEN		10

#ifndef TRUE
#define	TRUE		1
#endif

#ifndef FALSE
#define	FALSE		0
#endif

#ifndef PI
#define	PI		3.141592654
#endif

#define	R		6378.16

#define	F		(1.0/298.25)

struct Sat_Struct {
	char   Name[51];
	char   Category[21];
	int    Epoch_Year;
	double Epoch_Day;
	double Inclination;
	double Mean_Anomoly;
	double Mean_Motion;
	double Eccentricity;
	double Arg_Of_Perigee;
	double RAAN;
	long   Epoch_Orbit;
	double Drag;
	int    Aflag;
	double Alon;
	double Alat;
	int    Minus_Z;
	int    No_Modes;
	int    MA_Day[20];
	char   Mode[20][10];
	long   Catalogue_No;
	float  Frequency1;
	float  Frequency2;

	/* Temporary run-time data */
	double SSP_Longitude;
	double SSP_Latitude;
	double Half_Angle;
	double Elevation;
	double Range;
	double Elapsed_Time;

	int    Current;
	int    Display;
	int    Beep;
};

extern int Num_Chosen;
extern GSList *Sat_List;

struct User_Struct {
	char   Callsign[21];
	double Latitude;
	double Longitude;
	double Height;
	int    Time_Interval;
	int    List_Interval;
	int    Time_Offset;
	int    Map_No;
	GdkColor Colours[MAX_COLOURS];
	int    Date_Format;
};
extern struct User_Struct User_Data;

struct Loc_Struct {
	char   QTH[51];
	double Latitude;
	double Longitude;
	double Height;
};
extern GSList *Loc_List;

struct Map_Struct {
	float x1, y1;
	float x2, y2;
};

extern char *Files_Path;

extern GtkWidget *MapText;
extern GtkWidget *MapArea;

/************************************************************************/
/* In Mtrack.C								*/
/************************************************************************/

extern void YN_Box(char *, void (*)(void), void (*)(void));

extern void Error_Box(char *);

extern void Warning_Box(char *);

extern void Message_Box(char *);

extern void Info_Box(char *);

/************************************************************************/
/* In Colour.C								*/
/************************************************************************/

extern GdkColor Text_Bg_Colour;
extern GdkColor Text_Fg_Colour;

extern void ColourCb(GtkWidget *, gpointer);

extern void Allocate_Colours(void);

/************************************************************************/
/* In Data_Ed.C								*/
/************************************************************************/

extern void Add_Sat_Data(void);

extern void Update_Sat_Data(void);

extern void Delete_Sat_Data(void);

extern void Add_Loc_Data(void);

extern void Update_Loc_Data(void);

extern void Delete_Loc_Data(void);

extern void Update_User_Data(void);

extern void Update_Sat(struct Sat_Struct *);

/************************************************************************/
/* In Data_List.C							*/
/************************************************************************/

extern struct Sat_Struct *Find_Satellite_Name(char *);

extern struct Sat_Struct *Find_Satellite_Cat_No(int);

extern struct Sat_Struct *Find_Current(void);

extern struct Loc_Struct *Find_Location_Name(char *);

extern void Choose_Satellite(void (*)(struct Sat_Struct *));

extern void Choose_Location(void (*)(struct Loc_Struct *));

/************************************************************************/
/* In Get_Data.C							*/
/************************************************************************/

extern gint Sat_Comparison(gconstpointer, gconstpointer);

extern gint Loc_Comparison(gconstpointer, gconstpointer);

extern void Import_Sat_Data(void);

extern void Read_Sat_Data(void);

extern void Read_User_Data(void);

extern void Read_Loc_Data(void);

extern void Write_Sat_Data(void);

extern void Write_Loc_Data(void);

extern void Write_User_Data(void);

/************************************************************************/
/* In Help.C								*/
/************************************************************************/

extern void HelpCb(GtkWidget *, gpointer);

extern void AboutCb(GtkWidget *, gpointer);

/************************************************************************/
/* In Map.C								*/
/************************************************************************/

extern GdkGC *BackgroundGC;
extern GdkGC *CitiesGC;
extern GdkGC *FootprintGC;
extern GdkGC *LandGC;
extern GdkGC *SatelliteGC;
extern GdkGC *UserGC;

extern void MapCb(GtkWidget *, gpointer);
extern gint maparea_buttonpress_cb(GtkWidget *, GdkEventButton *,gpointer );

extern void Redraw_Satellites(void);

extern gint MapTextCb(GtkWidget *, GdkEventExpose *);

extern gint MapAreaCb(GtkWidget *, GdkEventExpose *);

extern void Clear_Text(void);

extern void Write_Text(int, char *);

extern void Refresh_Text(void);

extern void List_Sat(struct Sat_Struct *);

/************************************************************************/
/* In Track.C								*/
/************************************************************************/

extern void Track_Satellite(time_t);

extern void List_Satellite(struct Sat_Struct *, time_t, time_t, int, double);

extern double RAD(double);

extern double DEG(double);

extern void Show_Elements(struct Sat_Struct *);

extern void Show_Locations(struct Sat_Struct *);