tof_control/
ltb_control.rs

1pub mod ltb_init;
2pub mod ltb_temp;
3pub mod ltb_threshold;
4
5// LTBMoniData Implementation
6use serde_json;
7use crate::helper::ltb_type::{LTBMoniData, LTBTemp, LTBThreshold};
8
9impl LTBMoniData {
10    pub fn new() -> Self {
11        Self {
12            ltb_temp: LTBTemp::new(),
13            ltb_thresh: LTBThreshold::new(),
14        }
15    }
16    pub fn print(&self) {
17        println!("LTB Temperature:");
18        println!("{:?}", self.ltb_temp);
19        println!("LTB Threshold:");
20        println!("{:?}", self.ltb_thresh);
21    }
22    pub fn print_json(&self) {
23        match serde_json::to_string(self) {
24            Ok(ltb_moni_json) => {
25                println!("{}", ltb_moni_json);
26            }
27            Err(e) => {
28                eprintln!("LTBMoniData JSON Error: {}", e);
29            }
30        }
31    }
32}