tof_control/
pa_control.rs1pub mod pa_bias;
2pub mod pa_init;
3pub mod pa_temp;
4
5use serde_json;
7use crate::helper::pa_type::{PAMoniData, PATemp, PAReadBias};
8
9impl PAMoniData {
10 pub fn new() -> Self {
11 Self {
12 pa_temp: PATemp::new(),
13 pa_bias: PAReadBias::new(),
14 }
15 }
16 pub fn print(&self) {
17 println!("PA Temperature:");
18 println!("{:?}", self.pa_temp);
19 println!("PA SiPM Bias Voltage:");
20 println!("{:?}", self.pa_bias);
21 }
22 pub fn print_json(&self) {
23 match serde_json::to_string(self) {
24 Ok(pa_moni_json) => {
25 println!("{}", pa_moni_json);
26 }
27 Err(e) => {
28 eprintln!("PAMoniData JSON Error: {}", e);
29 }
30 }
31 }
32}