diff --git a/src/bin/render_lines_gui.rs b/src/bin/render_lines_gui.rs index 69fbe3c..9e3373e 100644 --- a/src/bin/render_lines_gui.rs +++ b/src/bin/render_lines_gui.rs @@ -176,7 +176,10 @@ fn get_dac_configs() -> DacConfigMap{ let mut dac_configs: DacConfigMap = HashMap::new(); dac_configs.insert( DacId::Helios { id: 926298163 }, - DacConfig{homography: python_cv_h_into_mat3(TMP_PYTHON_LASER_H)} + DacConfig{ + name: "Helios#1".into(), + homography: python_cv_h_into_mat3(TMP_PYTHON_LASER_H) + } ); dac_configs } @@ -243,7 +246,6 @@ fn model(app: &App) -> Model { if detected.insert(dac.id()) { // DacId::EtherDream { mac_address: () } - dbg!(&detected); println!("{:#?}", dac); if dac_tx.send(dac).is_err() { break; @@ -301,7 +303,7 @@ fn laser_frame_producer(model: &mut LaserModel, frame: &mut laser::Frame){ let space = &model.current_lines.space; let pointno = points.len(); - dbg!(model.config.homography); + dbg!(&model.config.name); let mut new_points = Vec::new(); for point in points.into_iter() { @@ -362,7 +364,11 @@ fn update(_app: &App, model: &mut Model, update: Update) { println!("Detected DAC {:?}!", dac.id()); let config = match model.per_laser_config.contains_key(&dac.id()) { true => &model.per_laser_config[&dac.id()], - false => &DacConfig::default(), + false => { + println!("Found unknown DAC, try to register it in get_dac_configs()"); + dbg!(&dac.id()); + &DacConfig::default() + }, }; let stream = model .laser_api diff --git a/src/trap/laser.rs b/src/trap/laser.rs index 7404473..6d019cc 100644 --- a/src/trap/laser.rs +++ b/src/trap/laser.rs @@ -72,6 +72,7 @@ pub struct LaserTimer { pub struct DacConfig{ // #[serde(with = "DacIdSerializable")] // id: DacId, + pub name: String, pub homography: Mat3 } @@ -80,6 +81,6 @@ const LASER_H: Mat3 = python_cv_h_into_mat3(TMP_PYTHON_LASER_H); impl Default for DacConfig{ fn default() -> DacConfig{ - DacConfig { homography: Mat3::IDENTITY } + DacConfig { name: "Unknown".into(), homography: Mat3::IDENTITY } } } \ No newline at end of file