tof_control/
ltb_control.rs

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
pub mod ltb_init;
pub mod ltb_temp;
pub mod ltb_threshold;

// LTBMoniData Implementation
use serde_json;
use crate::helper::ltb_type::{LTBMoniData, LTBTemp, LTBThreshold};

impl LTBMoniData {
    pub fn new() -> Self {
        Self {
            ltb_temp: LTBTemp::new(),
            ltb_thresh: LTBThreshold::new(),
        }
    }
    pub fn print(&self) {
        println!("LTB Temperature:");
        println!("{:?}", self.ltb_temp);
        println!("LTB Threshold:");
        println!("{:?}", self.ltb_thresh);
    }
    pub fn print_json(&self) {
        match serde_json::to_string(self) {
            Ok(ltb_moni_json) => {
                println!("{}", ltb_moni_json);
            }
            Err(e) => {
                eprintln!("LTBMoniData JSON Error: {}", e);
            }
        }
    }
}