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
use num::FromPrimitive;
pub const NUM_TRANS_IN_UNIT: usize = 249;
pub const NUM_TRANS_X: usize = 18;
pub const NUM_TRANS_Y: usize = 14;
pub const TRANS_SPACING_MM: f64 = 10.16;
pub const DEVICE_WIDTH: f64 = 192.0;
pub const DEVICE_HEIGHT: f64 = 151.4;
pub fn is_missing_transducer<T1, T2>(x: T1, y: T2) -> bool
where
T1: FromPrimitive + PartialEq<T1>,
T2: FromPrimitive + PartialEq<T2>,
{
y == FromPrimitive::from_u8(1).unwrap()
&& (x == FromPrimitive::from_u8(1).unwrap()
|| x == FromPrimitive::from_u8(2).unwrap()
|| x == FromPrimitive::from_u8(16).unwrap())
}