updated positional traits to public, so its not upset about dead code.
This commit is contained in:
@@ -11,7 +11,25 @@ pub struct MotorDriverShaftSpeed {
|
||||
}
|
||||
|
||||
impl MotorDriverShaftSpeed {
|
||||
pub fn speed_as_rpm(&self) -> f32 {
|
||||
match self.shaft_speed {
|
||||
Some(mut speed) => {
|
||||
match self.unit {
|
||||
Unit::Radians => {speed /= core::f32::consts::PI * 2.0;}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
match self.time_scale {
|
||||
TimeScale::PerSecond => {speed *= 60.0;}
|
||||
_ => {}
|
||||
}
|
||||
speed
|
||||
}
|
||||
None => {
|
||||
0.0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for MotorDriverShaftSpeed {
|
||||
|
||||
Reference in New Issue
Block a user