Skip to content

Commit

Permalink
front: generated types have unit annotations in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristramg committed Dec 25, 2024
1 parent 49846cd commit 519f6a5
Showing 1 changed file with 63 additions and 12 deletions.
75 changes: 63 additions & 12 deletions front/src/common/api/generatedEditoastApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,8 @@ export type PostTimetableByIdStdcmApiArg = {
loading_gauge_type?: LoadingGaugeType | null;
/** Can be a percentage `X%`, a time in minutes per 100 kilometer `Xmin/100km` */
margin?: string | null;
/** Maximum speed of the consist in km/h */
/** Maximum speed of the consist in km/h
Velocity in km·h⁻¹ */
max_speed?: number | null;
/** By how long we can shift the departure time in milliseconds
Deprecated, first step data should be used instead */
Expand All @@ -1725,9 +1726,11 @@ export type PostTimetableByIdStdcmApiArg = {
Enforces that the path used by the train should be free and
available at least that many milliseconds before its passage. */
time_gap_before?: number;
/** Total length of the consist in meters */
/** Total length of the consist in meters
Length in m */
total_length?: number | null;
/** Total mass of the consist in kg */
/** Total mass of the consist
Mass in kg */
total_mass?: number | null;
towed_rolling_stock_id?: number | null;
work_schedule_group_id?: number | null;
Expand Down Expand Up @@ -2799,27 +2802,36 @@ export type RollingStockMetadata = {
unit: string;
};
export type RollingResistance = {
/** Solid friction in N */
/** Solid friction
Force in N */
A: number;
/** Viscosity friction in N/(m/s) */
/** Viscosity friction in N/(m/s) – N = kg⋅m⋅s⁻²
in kg·s⁻¹ */
B: number;
/** Aerodynamic drag in N/(m/s)² */
/** Aerodynamic drag in N/(m/s)² – N = kg⋅m⋅s⁻²
in kg·m⁻¹ */
C: number;
type: string;
};
export type RollingStockSupportedSignalingSystems = string[];
export type LightRollingStock = {
base_power_class?: string | null;
/** Acceleration in m·s⁻² */
comfort_acceleration: number;
/** Acceleration in m·s⁻² */
const_gamma: number;
effort_curves: LightEffortCurves;
energy_sources: EnergySource[];
id: number;
/** Acceleration in m·s⁻² */
inertia_coefficient: number;
/** Length in m */
length: number;
loading_gauge: LoadingGaugeType;
locked: boolean;
/** Mass in kg */
mass: number;
/** Velocity in m·s⁻¹ */
max_speed: number;
metadata?: RollingStockMetadata | null;
name: string;
Expand All @@ -2828,7 +2840,9 @@ export type LightRollingStock = {
};
railjson_version: string;
rolling_resistance: RollingResistance;
/** Acceleration in m·s⁻² */
startup_acceleration: number;
/** Duration in s */
startup_time: number;
supported_signaling_systems: RollingStockSupportedSignalingSystems;
};
Expand Down Expand Up @@ -3020,55 +3034,75 @@ export type EffortCurves = {
};
export type RollingStock = {
base_power_class: string | null;
/** Acceleration in m·s⁻² */
comfort_acceleration: number;
/** Acceleration in m·s⁻² */
const_gamma: number;
effort_curves: EffortCurves;
/** Duration in s */
electrical_power_startup_time: number | null;
energy_sources: EnergySource[];
id: number;
/** Acceleration in m·s⁻² */
inertia_coefficient: number;
/** Length in m */
length: number;
loading_gauge: LoadingGaugeType;
locked: boolean;
/** Mass in kg */
mass: number;
/** Velocity in m·s⁻¹ */
max_speed: number;
metadata: RollingStockMetadata | null;
name: string;
power_restrictions: {
[key: string]: string;
};
railjson_version: string;
/** Duration in s */
raise_pantograph_time: number | null;
rolling_resistance: RollingResistance;
/** Acceleration in m·s⁻² */
startup_acceleration: number;
/** Duration in s */
startup_time: number;
supported_signaling_systems: string[];
version: number;
};
export type RollingStockForm = {
base_power_class: string | null;
/** Acceleration in m·s⁻² */
comfort_acceleration: number;
/** Acceleration in m·s⁻² */
const_gamma: number;
effort_curves: EffortCurves;
/** The time the train takes before actually using electrical power (in seconds). Is null if the train is not electric. */
/** The time the train takes before actually using electrical power (in seconds). Is null if the train is not electric.
Duration in s */
electrical_power_startup_time?: number | null;
energy_sources?: EnergySource[];
/** Acceleration in m·s⁻² */
inertia_coefficient: number;
/** Length in m */
length: number;
loading_gauge: LoadingGaugeType;
locked?: boolean | null;
/** Mass in kg */
mass: number;
/** Velocity in m·s⁻¹ */
max_speed: number;
metadata?: RollingStockMetadata | null;
name: string;
/** Mapping of power restriction code to power class */
power_restrictions: {
[key: string]: string;
};
/** The time it takes to raise this train's pantograph in seconds. Is null if the train is not electric. */
/** The time it takes to raise this train's pantograph in seconds. Is null if the train is not electric.
Duration in s */
raise_pantograph_time?: number | null;
rolling_resistance: RollingResistance;
/** Acceleration in m·s⁻² */
startup_acceleration: number;
/** Duration in s */
startup_time: number;
supported_signaling_systems: RollingStockSupportedSignalingSystems;
};
Expand Down Expand Up @@ -3476,40 +3510,57 @@ export type TrainScheduleResult = TrainScheduleBase & {
timetable_id: number;
};
export type RollingResistancePerWeight = {
/** Solid friction in N/kg */
/** Solid friction in N/kg — N = kg⋅m⋅s⁻²
Acceleration in m·s⁻² */
A: number;
/** Viscosity friction in (N/kg)/(m/s) */
/** Viscosity friction in (N/kg)/(m/s) – N = kg⋅m⋅s⁻²
in s⁻¹ */
B: number;
/** Aerodynamic drag in (N/kg)/(m/s)² */
/** Aerodynamic drag per kg in (N/kg)/(m/s)² – N = kg⋅m⋅s⁻²
Aerodynamic drag per kg in m⁻¹ */
C: number;
type: string;
};
export type TowedRollingStock = {
/** Acceleration in m·s⁻² */
comfort_acceleration: number;
/** Acceleration in m·s⁻² */
const_gamma: number;
id: number;
/** Acceleration in m·s⁻² */
inertia_coefficient: number;
label: string;
/** Length in m */
length: number;
locked: boolean;
/** Mass in kg */
mass: number;
max_speed?: number | null;
/** Velocity in m·s⁻¹ */
max_speed: number | null;
name: string;
railjson_version: string;
rolling_resistance: RollingResistancePerWeight;
/** Acceleration in m·s⁻² */
startup_acceleration: number;
};
export type TowedRollingStockForm = {
/** Acceleration in m·s⁻² */
comfort_acceleration: number;
/** Acceleration in m·s⁻² */
const_gamma: number;
/** Acceleration in m·s⁻² */
inertia_coefficient: number;
label: string;
/** Length in m */
length: number;
locked: boolean;
/** Mass in kg */
mass: number;
/** Velocity in m·s⁻¹ */
max_speed?: number | null;
name: string;
rolling_resistance: RollingResistancePerWeight;
/** Acceleration in m·s⁻² */
startup_acceleration: number;
};
export type TowedRollingStockLockedForm = {
Expand Down

0 comments on commit 519f6a5

Please sign in to comment.