Skip to content

Commit

Permalink
Implement Display for EngineControllerMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdewid committed Feb 15, 2024
1 parent 3d32249 commit bd4d076
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/spn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,16 @@ impl EngineControllerMessage {
}

impl core::fmt::Display for EngineControllerMessage {
// TODO: Implement Display
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "EngineControllerMessage")
write!(
f,
"Torque mode: {:?}; Driver Demand: {}%; Actual Engine: {}%; RPM: {}; Starter mode: {:?}",
self.engine_torque_mode,
self.driver_demand.unwrap_or(0),
self.actual_engine.unwrap_or(0),
self.rpm.unwrap_or(0),
self.starter_mode
)
}
}

Expand Down

0 comments on commit bd4d076

Please sign in to comment.