gaps-online-software 0.10
online software for the TOF system for the GAPS experiment
Loading...
Searching...
No Matches
monitoring.h
1#ifndef MONITORINGPACKETS_H_INCLUDED
2#define MONITORINGPACKETS_H_INCLUDED
3
4#include <array>
5
6#include "tof_typedefs.h"
7#include "serialization.h"
8
21 static const u16 HEAD = 0xAAAA;
23 static const u16 TAIL = 0x5555;
25 static const u8 SIZE = 25;
26
32 f32 ltb_temp ;
33 std::array<f32, 3> thresh ;
34
36
39 static LTBMoniData from_bytestream(const Vec<u8> &stream,
40 usize &pos);
41
43 std::string to_string() const;
44};
45
46std::ostream& operator<<(std::ostream& os, const LTBMoniData& moni);
47
53struct RBMoniData {
54 static const u16 HEAD = 0xAAAA;
55 static const u16 TAIL = 0x5555;
56 static const u8 SIZE = 151;
57
58 u8 board_id ;
60 u16 rate ;
61 f32 tmp_drs ;
62 f32 tmp_clk ;
63 f32 tmp_adc ;
65 f32 tmp_zynq ;
66 f32 tmp_lis3mdltr ;
67 f32 tmp_bm280 ;
69 f32 pressure ;
71 f32 humidity ;
72 f32 mag_x ;
73 f32 mag_y ;
74 f32 mag_z ;
76 f32 mag_tot ;
77 f32 drs_dvdd_voltage ;
78 f32 drs_dvdd_current ;
79 f32 drs_dvdd_power ;
80 f32 p3v3_voltage ;
81 f32 p3v3_current ;
82 f32 p3v3_power ;
83 f32 zynq_voltage ;
84 f32 zynq_current ;
85 f32 zynq_power ;
86 f32 p3v5_voltage ;
87 f32 p3v5_current ;
88 f32 p3v5_power ;
89 f32 adc_dvdd_voltage ;
90 f32 adc_dvdd_current ;
91 f32 adc_dvdd_power ;
92 f32 adc_avdd_voltage ;
93 f32 adc_avdd_current ;
94 f32 adc_avdd_power ;
95 f32 drs_avdd_voltage ;
96 f32 drs_avdd_current ;
97 f32 drs_avdd_power ;
98 f32 n1v5_voltage ;
99 f32 n1v5_current ;
100 f32 n1v5_power ;
101
102 RBMoniData();
103
104 static RBMoniData from_bytestream(const Vec<u8> &stream,
105 usize &pos);
106
108 std::string to_string() const;
109};
110
111std::ostream& operator<<(std::ostream& os, const RBMoniData& moni);
112
117 static const u16 HEAD = 0xAAAA;
118 static const u16 TAIL = 0x5555;
119 static const u8 SIZE = 89;
120
121 u8 board_id;
122 std::array<f32, 3> p3v6_preamp_vcp;
123 std::array<f32, 3> n1v6_preamp_vcp;
124 std::array<f32, 3> p3v4f_ltb_vcp;
125 std::array<f32, 3> p3v4d_ltb_vcp;
126 std::array<f32, 3> p3v6_ltb_vcp;
127 std::array<f32, 3> n1v6_ltb_vcp;
128 f32 pds_temp;
129 f32 pas_temp;
130 f32 nas_temp;
131 f32 shv_temp;
132
133 PBMoniData();
134
136 static PBMoniData from_bytestream(const Vec<u8> &stream,
137 usize &pos);
138
140 std::string to_string() const;
141};
142
143std::ostream& operator<<(std::ostream& os, const PBMoniData& moni);
144
149 static const u16 HEAD = 0xAAAA;
150 static const u16 TAIL = 0x5555;
151 static const u8 SIZE = 89;
152
153 u8 board_id;
154 std::array<f32, 16> temps;
155 std::array<f32, 16> biases;
156 PAMoniData();
157
159 static PAMoniData from_bytestream(const Vec<u8> &stream,
160 usize &pos);
161
163 std::string to_string() const;
164};
165
166std::ostream& operator<<(std::ostream& os, const PAMoniData& moni);
167
172struct MtbMoniData : FromTofPacket<MtbMoniData> {
173 static const u16 HEAD = 0xAAAA;
174 static const u16 TAIL = 0x5555;
175 static const u8 SIZE = 6;
176
177 f32 fpga_temp ;
178 f32 fpga_vccint ;
179 f32 fpga_vccaux ;
180 f32 fpga_vccbram ;
181 u16 rate ;
182 u16 lost_rate ;
183 u32 tiu_busy_len ;
184 u8 tiu_status ;
185 u8 prescale_pc ;
186 u16 daq_queue_len;
187
188 MtbMoniData();
189
190 std::string to_string() const;
191
192 bool get_tiu_emulation_mode() const;
193
194 bool get_tiu_use_aux_link() const;
195
196 bool get_tiu_bad() const;
197
198 bool get_tiu_busy_stuck() const;
199
200 bool get_tiu_ignore_busy() const;
201
203 f32 get_fpga_temp() const;
204
206 static MtbMoniData from_bytestream(const Vec<u8>& payload,
207 usize& pos);
208};
209
210std::ostream& operator<<(std::ostream& os, const MtbMoniData& moni);
211
217 static const u16 HEAD = 0xAAAA;
218 static const u16 TAIL = 0x5555;
219 static const u8 SIZE = 41;
220
221 u32 uptime ;
222 u8 disk_usage ;
223 std::array<u32, 4> cpu_freq ;
224 f32 cpu_temp ;
225 f32 cpu0_temp ;
226 f32 cpu1_temp ;
227 f32 mb_temp ;
228
229 CPUMoniData();
231 static CPUMoniData from_bytestream(const Vec<u8>& payload,
232 usize &pos);
233
234 std::string to_string() const;
235};
236
237std::ostream& operator<<(std::ostream& os, const CPUMoniData& moni);
238
239#endif
Definition monitoring.h:216
static CPUMoniData from_bytestream(const Vec< u8 > &payload, usize &pos)
extract moni data from payload
Allow to extend all classes with a from_tofpacket method.
Definition serialization.h:18
Definition monitoring.h:19
std::string to_string() const
String representatioin for printing.
f32 trenz_temp
FIXME - temperature.
Definition monitoring.h:30
static const u16 TAIL
struct end marker bytes
Definition monitoring.h:23
static const u16 HEAD
struct begin marker bytes
Definition monitoring.h:21
static const u8 SIZE
byte size with HEAD + TAIL
Definition monitoring.h:25
u8 board_id
FIXME - this might be the RB id.
Definition monitoring.h:28
static LTBMoniData from_bytestream(const Vec< u8 > &stream, usize &pos)
Definition monitoring.h:172
static MtbMoniData from_bytestream(const Vec< u8 > &payload, usize &pos)
extract moni data from payload
f32 get_fpga_temp() const
Convert ADC temp from adc values to Celsius.
Definition monitoring.h:148
static PAMoniData from_bytestream(const Vec< u8 > &stream, usize &pos)
Factory function - restore PAMoniData from byte-representation.
std::string to_string() const
String representation for pretty printing.
Definition monitoring.h:116
static PBMoniData from_bytestream(const Vec< u8 > &stream, usize &pos)
Factor function - restore PAMoniData from byte-representation.
std::string to_string() const
String representation for pretty printing.
Definition monitoring.h:53
f32 humidity
ambient humidity
Definition monitoring.h:71
f32 pressure
ambient pressure
Definition monitoring.h:69
u16 rate
Rate as recorded by the board itself.
Definition monitoring.h:60
f32 mag_tot
total strength of magnetic field
Definition monitoring.h:76
f32 tmp_zynq
fpga temperature
Definition monitoring.h:65
std::string to_string() const
String representatioin for printing.