-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMarkerUnpacker.cpp
56 lines (41 loc) · 1.13 KB
/
CMarkerUnpacker.cpp
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
/*
--ddc sep12 This is an unpacker for the 'marker' module... which is of
course, not a module but an instruction to write a word into the data.
The word is 'unpacked' and returned.
*/
#include <config.h>
#include "CMarkerUnpacker.h"
#include <Event.h>
#include <stdint.h>
using namespace std;
// Constants:
/////////////////////////////////////////////////////////////////////
// Canonicals..
/*!
Construction is a no-op.
*/
CMARKERUnpacker::CMARKERUnpacker() {}
/*!
Destruction is a no-op.
*/
CMARKERUnpacker::~CMARKERUnpacker() {}
//////////////////////////////////////////////////////////////////////
// Virtual function overrides
/*!
Perform the unpack. This is trivial, there is only the one word for
the marker
*/
unsigned int
CMARKERUnpacker::operator()(CEvent& rEvent,
vector<unsigned short>& event,
unsigned int offset,
CParamMapCommand::AdcMapping* pMap)
{
//The marker should just be one 32bit word.xxxx.. hmm. 16bit word?
unsigned short header= event[offset++];
int id = pMap->map[0];
if (id != -1) {
rEvent[id] = header;
}
return offset;
}