Skip to main content

gondola_core/
tracker.rs

1// This file is part of gaps-online-software and published 
2// under the GPLv3 license
3
4
5pub mod strips;
6pub use strips::*;
7
8pub mod online_calibration;
9pub use online_calibration::*;
10
11use crate::prelude::*;
12
13#[derive(Debug, Hash, Eq, PartialEq, Clone, Copy, FromRepr, AsRefStr, EnumIter)]
14#[cfg_attr(feature = "pybindings", pyclass(eq, eq_int))]
15#[repr(u8)]
16pub enum TrackerHitSource {
17  Unknown = 0,
18  TelemetryEvent = 10,
19  TrackerPacket  = 20,
20}
21
22// in case we have pybindings for this type, 
23// expand it so that it can be used as keys
24// in dictionaries
25#[cfg(feature = "pybindings")]
26#[pymethods]
27impl TrackerHitSource {
28
29  #[getter]
30  fn __hash__(&self) -> usize {
31    (*self as u8) as usize
32  } 
33}
34
35expand_and_test_enum!(TrackerHitSource, test_trackerhitsource_repr);
36