McStas Readout Master 0.8.0
Loading...
Searching...
No Matches
enums.h
1#pragma once
2#include <cstdint>
3#include <string>
4
5#ifdef WIN32
6// Export symbols if compile flags "READOUT_SHARED" and "READOUT_EXPORT" are set on Windows.
7 #ifdef READOUT_SHARED
8 #ifdef READOUT_EXPORT
9 #define RL_API __declspec(dllexport)
10 #else
11 #define RL_API __declspec(dllimport)
12 #endif
13 #else
14 // Disable definition if linking statically.
15 #define RL_API
16 #endif
17#else
18// Disable definition for non-Win32 systems.
19#define RL_API
20#endif
21
23enum class Verbosity {
24 silent,
25 errors,
26 warnings,
27 info,
28 details
29};
30
39enum DetectorType {
40 Reserved = 0x00,
41 LOKI = 0x30,
42 TBL3H3 = 0x32,
43 BIFROST = 0x34,
44 MIRACLES = 0x38,
45 CSPEC = 0x3c,
46 TREX = 0x40,
47 NMX = 0x44,
48 FREIA = 0x48,
49 TBLVMM = 0x49,
50 ESTIA=0x4c,
51 BEER=0x50,
52 DREAM = 0x60,
53 MAGIC = 0x64,
54 HEIMDAL = 0x68,
55 // Common Beam Monitors. The EFU's cbm module takes every beam-monitor format in
56 // packets of one type, CBM_PACKET_TYPE, and tells them apart by each readout's own
57 // type byte. These values are the library's identities for the three formats, so a
58 // collector group records which one it holds; they never go on the wire.
59 CBM0 = 0xf0,
60 CBM1 = 0xf1,
61 CBM2 = 0xf2,
62 CBMI = 0xfa,
63};
64
67constexpr int CBM_PACKET_TYPE = 0x10;
68
75enum class ReadoutType {
76 CAEN,
77 VMM3,
78 CDT,
79 BM0,
80 BM2,
81 BMI,
82};
83
85RL_API DetectorType detectorType_from_int(int);
87RL_API ReadoutType readoutType_from_detectorType(DetectorType type);
90RL_API uint8_t packetType_from_detectorType(DetectorType type);
94RL_API uint8_t cbmType_from_readoutType(ReadoutType type);
96RL_API ReadoutType readoutType_from_int(int int_type);
97
99RL_API DetectorType detectorType_from_name(const std::string & name);
101RL_API ReadoutType readoutType_from_name(const std::string & name);
103RL_API std::string detectorType_name(DetectorType);
105RL_API std::string readoutType_name(ReadoutType);