-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOAP.h
131 lines (109 loc) · 3.05 KB
/
OAP.h
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
/*
-------------------------------------------------------------------------
OBJECT NAME: OAP.h
FULL NAME: Optical Array Probe (OAP) and PMS2d.
DESCRIPTION:
COPYRIGHT: University Corporation for Atmospheric Research, 2019
-------------------------------------------------------------------------
*/
#ifndef _OAP_OAP_H_
#define _OAP_OAP_H_
#include <cstdint>
#include <cstring>
/* ADS image record types */
#define ADS_WORD 0x4144
#define HDR_WORD 0x5448
#define SDI_WORD 0x8681
#define AVAPS_WORD 0x4156
/* ID values for the id field in each record header.
*/
// Traditional 32 diode PMS2D probes.
#define PMS2DC1 0x4331
#define PMS2DC2 0x4332
#define PMS2DP1 0x5031
#define PMS2DP2 0x5032
// 64 diode Fast 2DC, 25um.
#define PMS2DC4 0x4334
#define PMS2DC5 0x4335
// 64 diode Fast 2DC, 10um.
#define PMS2DC6 0x4336
// 64 diode Fast 2DP, 200um.
#define PMS2DP4 0x5034
// 64 diode DMT CIP, 25um.
#define PMS2DC8 0x4338
// 64 diode DMT PIP, 100um.
#define PMS2DP8 0x5038
// Greyscale which we never flew.
#define PMS2DG1 0x4731
#define PMS2DG2 0x4732
// SPEC HVPS
#define HVPS1 0x4831
#define HVPS2 0x4832
// SPEC 3V-CPI
#define SPEC2D3H 0x3348
#define SPEC2D3V 0x3356
// SPEC 2DS
#define SPEC2DSH 0x5348
#define SPEC2DSV 0x5356
namespace OAP
{
enum ProbeType { UNKNOWN_T, PMS2D_T, HVPS_T, GREYSCALE_T, FAST2D_T, TWODS_T, F2DS_T, CIP_T };
const size_t OAP_BUFF_SIZE = 4096;
const size_t nSlices_32bit = 1024;
const size_t nSlices_64bit = 512;
const size_t nSlices_128bit = 256;
// Header Structure from OAP File Format. For SourceOAP.
struct P2d_hdr {
int16_t id; /* 'P1','C1','P2','C2', H1, H2 */
int16_t hour;
int16_t minute;
int16_t second;
int16_t year;
int16_t month;
int16_t day;
int16_t tas; /* true air speed */
int16_t msec; /* msec of this record */
int16_t overld; /* overload time, msec */
};
// Record Structure from OAP File Format. For SourceOAP.
struct P2d_rec {
int16_t id; /* 'P1','C1','P2','C2', H1, H2 */
int16_t hour;
int16_t minute;
int16_t second;
int16_t year;
int16_t month;
int16_t day;
int16_t tas; /* true air speed */
int16_t msec; /* msec of this record */
int16_t overld; /* overload time, msec */
unsigned char data[OAP_BUFF_SIZE]; /* image buffer */
};
// Header Structure SPEC Fast2DS File Format. For SourceF2DS.
struct TwoDS_hdr {
int16_t year;
int16_t month;
int16_t dayOfWeek;
int16_t day;
int16_t hour;
int16_t minute;
int16_t second;
int16_t msec; /* millisecond of this record */
};
// Record Structure SPEC Fast2DS File Format. For SourceF2DS.
struct TwoDS_rec {
int16_t year;
int16_t month;
int16_t dayOfWeek;
int16_t day;
int16_t hour;
int16_t minute;
int16_t second;
int16_t msec; /* millisecond of this record */
unsigned char data[OAP_BUFF_SIZE]; /* image buffer */
int16_t chkSum; /* checksum */
};
void swapPMS2D(OAP::P2d_rec *);
ProbeType probeType(const unsigned char *);
}
#endif