@@ -8,10 +8,14 @@ use editoast_schemas::rolling_stock::ConditionalEffortCurve;
8
8
use editoast_schemas:: rolling_stock:: EffortCurve ;
9
9
use editoast_schemas:: rolling_stock:: EffortCurveConditions ;
10
10
use editoast_schemas:: rolling_stock:: EffortCurves ;
11
+ use editoast_schemas:: rolling_stock:: EnergySource ;
12
+ use editoast_schemas:: rolling_stock:: EnergyStorage ;
11
13
use editoast_schemas:: rolling_stock:: Gamma ;
12
14
use editoast_schemas:: rolling_stock:: ModeEffortCurves ;
15
+ use editoast_schemas:: rolling_stock:: RefillLaw ;
13
16
use editoast_schemas:: rolling_stock:: RollingResistance ;
14
17
use editoast_schemas:: rolling_stock:: RollingStockComfortType ;
18
+ use editoast_schemas:: rolling_stock:: SpeedDependantPower ;
15
19
use serde:: Deserialize ;
16
20
use serde:: Serialize ;
17
21
use utoipa:: ToSchema ;
@@ -108,66 +112,3 @@ pub struct RollingStockMetadata {
108
112
number : String ,
109
113
reference : String ,
110
114
}
111
-
112
- // Energy sources schema
113
-
114
- /// physical law defining how the storage can be refilled
115
- #[ derive( Clone , Debug , PartialEq , Deserialize , Serialize , ToSchema ) ]
116
- #[ serde( deny_unknown_fields) ]
117
- pub struct RefillLaw {
118
- #[ schema( minimum = 0 ) ]
119
- tau : f64 ,
120
- #[ schema( minimum = 0 , maximum = 1 ) ]
121
- soc_ref : f64 ,
122
- }
123
-
124
- /// energy storage of an energy source (of a rolling stock, can be a electrical battery or a hydrogen/fuel powerPack)
125
- #[ derive( Clone , Debug , PartialEq , Deserialize , Serialize , ToSchema ) ]
126
- #[ serde( deny_unknown_fields) ]
127
- pub struct EnergyStorage {
128
- capacity : f64 ,
129
- #[ schema( minimum = 0 , maximum = 1 ) ]
130
- soc : f64 ,
131
- #[ schema( minimum = 0 , maximum = 1 ) ]
132
- soc_min : f64 ,
133
- #[ schema( minimum = 0 , maximum = 1 ) ]
134
- soc_max : f64 ,
135
- #[ schema( required) ]
136
- refill_law : Option < RefillLaw > ,
137
- }
138
-
139
- /// power-speed curve (in an energy source)
140
- #[ derive( Clone , Debug , PartialEq , Deserialize , Serialize , ToSchema ) ]
141
- #[ serde( deny_unknown_fields) ]
142
- pub struct SpeedDependantPower {
143
- speeds : Vec < f64 > ,
144
- powers : Vec < f64 > ,
145
- }
146
-
147
- /// energy source of a rolling stock
148
- #[ derive( Clone , Debug , PartialEq , Deserialize , Serialize , ToSchema ) ]
149
- #[ serde( tag = "energy_source_type" , deny_unknown_fields) ]
150
- pub enum EnergySource {
151
- /// energy source for a rolling stock representing a electrification
152
- Electrification {
153
- max_input_power : SpeedDependantPower ,
154
- max_output_power : SpeedDependantPower ,
155
- #[ schema( minimum = 0 , maximum = 1 ) ]
156
- efficiency : f64 ,
157
- } ,
158
- PowerPack {
159
- max_input_power : SpeedDependantPower ,
160
- max_output_power : SpeedDependantPower ,
161
- energy_storage : EnergyStorage ,
162
- #[ schema( minimum = 0 , maximum = 1 ) ]
163
- efficiency : f64 ,
164
- } ,
165
- /// energy source for a rolling stock representing a battery
166
- Battery {
167
- max_input_power : SpeedDependantPower ,
168
- max_output_power : SpeedDependantPower ,
169
- energy_storage : EnergyStorage ,
170
- #[ schema( minimum = 0 , maximum = 1 ) ]
171
- efficiency : f64 ,
172
- } ,
173
- }
0 commit comments