Repository navigation
Expand file tree
/
Copy pathglobals.h
More file actions
95 lines (85 loc) · 1.76 KB
/
Copy pathglobals.h
File metadata and controls
95 lines (85 loc) · 1.76 KB
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
#ifndef GLOBALS_H
#define GLOBALS_H
#include "cconfig.h"
#include "radiomanager.h"
#define NUM_PIXELS 2048
// CONFIGURATION
CConfig cfg;
// SPECTROMETER
double *Spectrum;
int ExposureTime;
int NumExposures;
int Pixels;
double Saturation;
string Model;
string SerialNumber;
int MaxIntensity;
int MinExposureTime = 10;
double LEDSaturation = -1;
int DarkInProgress = 0;
// GPS
double Latitude;
double Longitude;
double Altitude;
double Time = 0;
unsigned long Date;
double Speed;
double Course;
char WarnCode;
int Quality;
int Year;
int Month;
int Day;
int Hour;
int Minute;
int Satellites;
double Second;
double LEDTime = 0;
// THREADING
pthread_t gpsthread;
pthread_t gpsledthread;
pthread_t gpslockledthread;
pthread_t specledthread;
pthread_t shutdownswitchthread;
pthread_t zipthread;
pthread_mutex_t gpslock;
int threaderr;
pthread_t specthread;
pthread_mutex_t speclock;
// OUTPUT
string OutputDir;
unsigned long CurrentFileNumber = 0;
string OutputPrefix = "spec";
string OutputSuffix = ".std";
unsigned long LastDarkFileNumber = -1;
int ReadyToZip = 0;
unsigned long ZipStartFileNumber = 0;
// RADIO
RadioManager radio;
// holds all radioData;
// changing this will mess up how the ground station parses data
struct RadioData{
// gps data
float lat;
float lon;
float alt;
float speed;
float course;
// none of these numbers will be bigger than 255
unsigned char num_sats;
unsigned char quality;
unsigned char year;
unsigned char month;
unsigned char day;
unsigned char hour;
unsigned char minute;
unsigned char darkMode;
unsigned char second;
char warnCode;
// spectrometer data
unsigned long fileNum;
short exposureTime;
unsigned char numExposures;
float spec[NUM_PIXELS];
};
#endif // GLOBALS_H