-
Notifications
You must be signed in to change notification settings - Fork 0
/
CIP.h
77 lines (55 loc) · 1.74 KB
/
CIP.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
/*
-------------------------------------------------------------------------
OBJECT NAME: CIP.h
FULL NAME: DMT CIP/PIP probes
COPYRIGHT: University Corporation for Atmospheric Research, 2018
-------------------------------------------------------------------------
*/
#ifndef _OAP_CIP_H_
#define _OAP_CIP_H_
#include "Probe.h"
namespace OAP
{
/* -------------------------------------------------------------------- */
/**
* Probe sub-class for DMT CIP and PIP probes.
*/
class CIP : public Probe
{
public:
/**
* Probe constructor for OAP files. For CIP/PIP, this means the data has
* been run through the pads2oap converter.
*/
CIP(UserConfig *cfg, const char xml_string[], int recSize);
/**
* Probe constructor for no file header. Would like to make this open
* a PADS file in the future.
*/
CIP(UserConfig *cfg, const char name[]);
struct recStats ProcessRecord(const P2d_rec * record, float version);
bool isSyncWord(const unsigned char *p);
/// DMT CIP/PIP probes are run length encoded. Decode here.
size_t uncompress(unsigned char *dest, const unsigned char src[], int nbytes);
/**
* Swap data to big endian after being uncompressed.
*/
static void SwapBytes(unsigned char *cp, size_t nSlices);
static const unsigned long long SyncWord;
protected:
void dmt_init();
long long TimeWord_Microseconds(const unsigned char *p) const;
/**
* These are for the decompress algorithm. Bytes to be carried over to next
* decompress call. These are already uncompressed.
*/
size_t _nResidualBytes;
unsigned char residualBytes[16];
/**
* Used for when sync word is last word of a buffer, and timing word will
* be first slice in the next buffer.
*/
bool _carryOver;
};
}
#endif