@@ -14,7 +14,6 @@ use power_restrictions::PowerRestriction;
14
14
use serde:: Deserialize ;
15
15
use serde:: Serialize ;
16
16
use uom:: si:: acceleration:: meter_per_second_squared;
17
- use uom:: si:: length:: meter;
18
17
use uom:: si:: velocity:: meter_per_second;
19
18
20
19
use uom:: si:: f64:: { Acceleration , Length , Velocity } ;
@@ -48,7 +47,8 @@ pub struct RollingStockModel {
48
47
#[ model( json) ]
49
48
#[ schema( required) ]
50
49
pub metadata : Option < RollingStockMetadata > ,
51
- pub length : f64 ,
50
+ #[ model( uom_unit = "uom::si::length::meter" ) ]
51
+ pub length : Length ,
52
52
pub max_speed : f64 ,
53
53
pub startup_time : f64 ,
54
54
pub startup_acceleration : f64 ,
@@ -153,7 +153,7 @@ impl From<RollingStockModel> for RollingStock {
153
153
name : rolling_stock_model. name ,
154
154
effort_curves : rolling_stock_model. effort_curves ,
155
155
base_power_class : rolling_stock_model. base_power_class ,
156
- length : Length :: new :: < meter > ( rolling_stock_model. length ) ,
156
+ length : rolling_stock_model. length ,
157
157
max_speed : Velocity :: new :: < meter_per_second > ( rolling_stock_model. max_speed ) ,
158
158
startup_time : rolling_stock_model. startup_time ,
159
159
startup_acceleration : Acceleration :: new :: < meter_per_second_squared > (
@@ -185,7 +185,7 @@ impl From<RollingStock> for RollingStockModelChangeset {
185
185
. name ( rolling_stock. name )
186
186
. effort_curves ( rolling_stock. effort_curves )
187
187
. base_power_class ( rolling_stock. base_power_class )
188
- . length ( rolling_stock. length . get :: < meter > ( ) )
188
+ . length ( rolling_stock. length )
189
189
. max_speed ( rolling_stock. max_speed . get :: < meter_per_second > ( ) )
190
190
. startup_time ( rolling_stock. startup_time )
191
191
. startup_acceleration (
0 commit comments