tof_dataclasses/lib.rs
1//! Tof dataclasses
2//!
3//! This crate provides tof related dataclasses for
4//!
5//! * events
6//!
7//! * network i/o wrappers ("packets") for classes
8//!
9//! * function related constants
10//!
11//! * calibration
12//!
13//! * commands/responses
14//!
15//! * TODO: alerts
16//!
17//! # features:
18//!
19//! * random - allow random number generated data classes for
20//! testing
21//!
22//! * database - access a data base for advanced paddle
23//! mapping, readoutboard and ltb information etc.
24//!
25//! * caraspace - register TofPacket through the caraspace library
26//! This allows to write TofPackets to frames, which
27//! will ultimatly allow them to write them to
28//! caraspace files
29//!
30//!
31pub mod events;
32pub mod packets;
33pub mod errors;
34pub mod serialization;
35pub mod constants;
36pub mod calibrations;
37pub mod threading;
38pub mod commands;
39pub mod monitoring;
40pub mod io;
41pub mod analysis;
42pub mod ipbus;
43pub mod series;
44pub mod heartbeats;
45pub mod version;
46pub mod status;
47pub mod alerts;
48#[cfg(feature="database")]
49pub mod database;
50#[cfg(feature="caraspace-serial")]
51pub mod caraspace;
52
53pub use version::ProtocolVersion;
54
55#[macro_use] extern crate log;
56
57use std::collections::HashMap;
58
59/// A type for the master trigger mappings
60/// Dsi -> J -> (RBID,RBCH)
61pub type DsiLtbRBMapping = HashMap<u8,HashMap<u8,HashMap<u8,(u8,u8)>>>;
62
63pub type RbChPidMapping = HashMap<u8,HashMap<u8,u8>>;
64
65/// A type for the mappings of RB channels - paddle edn ids
66/// Paddle end ids are the paddle id + 1000 for A and
67/// + 2000 for B
68/// <div class="warning">In this map RB Channels start from 1! This is consistent with the database</div>
69pub type RBChannelPaddleEndIDMap = HashMap<u8,u16>;
70
71/// Create structures filled with random
72/// number to be used for testing and
73/// benchmarking
74#[cfg(feature = "random")]
75pub trait FromRandom {
76 fn from_random() -> Self;
77}
78