1use pyo3::prelude::*;
4
5#[pyclass]
7#[derive(Clone)]
8pub struct BugRating {
9 #[pyo3(get)]
11 pub b: u8,
12 #[pyo3(get)]
14 pub u: u8,
15 #[pyo3(get)]
17 pub g: u8,
18}
19
20#[pymethods]
21impl BugRating {
22 fn __repr__(&self) -> String {
23 format!("B{} U{} G{}", self.b, self.u, self.g)
24 }
25
26 fn __str__(&self) -> String {
27 format!("B{} U{} G{}", self.b, self.u, self.g)
28 }
29}
30
31#[pyclass]
33#[derive(Clone)]
34pub struct ZoneLumens {
35 #[pyo3(get)]
37 pub bl: f64,
38 #[pyo3(get)]
40 pub bm: f64,
41 #[pyo3(get)]
43 pub bh: f64,
44 #[pyo3(get)]
46 pub bvh: f64,
47 #[pyo3(get)]
49 pub fl: f64,
50 #[pyo3(get)]
52 pub fm: f64,
53 #[pyo3(get)]
55 pub fh: f64,
56 #[pyo3(get)]
58 pub fvh: f64,
59 #[pyo3(get)]
61 pub ul: f64,
62 #[pyo3(get)]
64 pub uh: f64,
65}
66
67#[pymethods]
68impl ZoneLumens {
69 fn __repr__(&self) -> String {
70 format!(
71 "ZoneLumens(BL={:.1}, BM={:.1}, BH={:.1}, BVH={:.1}, FL={:.1}, FM={:.1}, FH={:.1}, FVH={:.1}, UL={:.1}, UH={:.1})",
72 self.bl, self.bm, self.bh, self.bvh, self.fl, self.fm, self.fh, self.fvh, self.ul, self.uh
73 )
74 }
75}