Skip to content

Commit

Permalink
Add Engine drag torque to config
Browse files Browse the repository at this point in the history
  • Loading branch information
rnd-ash committed May 1, 2023
1 parent dbd069f commit 41dbc70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion config_app/src/ui/configuration/cfg_structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ pub struct TcmCoreConfig {
// Only for HFM CAN mode
pub throttle_max_open_angle: u8,
// Value here is 1000x value ECU uses (Like diff ratio)
pub c_eng: u16
pub c_eng: u16,
// Value here is 10x value ECU uses
pub engine_drag_torque: u16
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, PrimitiveEnum_u8)]
Expand Down
9 changes: 9 additions & 0 deletions config_app/src/ui/configuration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@ impl crate::window::InterfacePage for ConfigPage {
ui.end_row();
}

let mut buffer =
format!("{:.1}", scn.engine_drag_torque as f32 / 10.0);
ui.label("Engine drag torque");
ui.text_edit_singleline(&mut buffer);
if let Ok(drg) = buffer.parse::<f32>() {
scn.engine_drag_torque = (drg * 10.0) as u16;
}
ui.end_row();

ui.label("EGS CAN Layer: ");
let mut can = scn.egs_can_type;
egui::ComboBox::from_id_source("can_layer")
Expand Down

0 comments on commit 41dbc70

Please sign in to comment.