@@ -105,7 +105,8 @@ public Tr_RouteFile(STFReader stf)
105105 new STFReader . TokenProcessor ( "ortsuserpreferenceremoveforesttreesfromroads" , ( ) => { RemoveForestTreesFromRoads = stf . ReadBoolBlock ( false ) ; } ) ,
106106 // values for superelevation
107107 new STFReader . TokenProcessor ( "ortstracksuperelevation" , ( ) => { SuperElevationHgtpRadiusM = new Interpolator ( stf ) ; } ) ,
108- new STFReader . TokenProcessor ( "ortssuperelevation" , ( ) => { SuperElevationHgtpRadiusM = null ; SuperElevation = new SuperElevationStandard ( stf ) ; } ) ,
108+ // New superelevation standard, will overwrite ORTSTrackSuperElevation
109+ new STFReader . TokenProcessor ( "ortssuperelevation" , ( ) => { SuperElevationHgtpRadiusM = null ; SuperElevation . Add ( new SuperElevationStandard ( stf ) ) ; } ) ,
109110 // images
110111 new STFReader . TokenProcessor ( "graphic" , ( ) => { Thumbnail = stf . ReadStringBlock ( null ) ; } ) ,
111112 new STFReader . TokenProcessor ( "loadingscreen" , ( ) => { LoadingScreen = stf . ReadStringBlock ( null ) ; } ) ,
@@ -130,7 +131,7 @@ public Tr_RouteFile(STFReader stf)
130131 if ( Description == null ) throw new STFException ( stf , "Missing Description" ) ;
131132 if ( RouteStart == null ) throw new STFException ( stf , "Missing RouteStart" ) ;
132133 if ( ForestClearDistance == 0 && RemoveForestTreesFromRoads ) Trace . TraceWarning ( "You must define also ORTSUserPreferenceForestClearDistance to avoid trees on roads" ) ;
133- if ( SuperElevation == null ) SuperElevation = new SuperElevationStandard ( ) ;
134+ if ( SuperElevation . Count <= 0 ) SuperElevation . Add ( new SuperElevationStandard ( ) ) ;
134135 }
135136
136137 public string RouteID ; // ie JAPAN1 - used for TRK file and route folder name
@@ -151,7 +152,7 @@ public Tr_RouteFile(STFReader stf)
151152 public string DefaultSignalSMS ;
152153 public float TempRestrictedSpeed = - 1f ;
153154 public Interpolator SuperElevationHgtpRadiusM ; // Superelevation of tracks as a function of radius, deprecated
154- public SuperElevationStandard SuperElevation ;
155+ public List < SuperElevationStandard > SuperElevation = new List < SuperElevationStandard > ( ) ;
155156
156157 // Values for calculating Tunnel Resistance - will override default values.
157158 public float SingleTunnelAreaM2 ;
@@ -227,14 +228,15 @@ public string ENVFileName(SeasonType seasonType, WeatherType weatherType)
227228
228229 public class SuperElevationStandard
229230 {
230- public float SuperElevationMaxFreightUnderbalanceM = 0.05f ; // Default 5 cm ~ 2 inches
231- public float SuperElevationMaxPaxUnderbalanceM = 0.075f ; // Default 7.5 cm ~ 3 inches
232- public float SuperElevationMinCantM = 0.0125f ; // Default 1.25 cm ~ 0.5 inches
233- public float SuperElevationMaxCantM ; // Specified by user settings by default
234- public float SuperElevationMinSpeedMpS = MpS . FromKpH ( 25.0f ) ; // Default 25 kmh ~ 15 mph
235- public float SuperElevationPrecisionM = 0.005f ; // Default 5 mm ~ 0.2 inches
236- public float SuperElevationRunoffSlope = 0.003f ; // Maximum rate of change of superelevation per track length, default 0.3%
237- public float SuperElevationRunoffSpeedMpS = 0.04f ; // Maximum rate of change of superelevation per second, default 4 cm / sec ~ 1.5 inches / sec
231+ public float MaxFreightUnderbalanceM = 0.05f ; // Default 5 cm ~ 2 inches
232+ public float MaxPaxUnderbalanceM = 0.075f ; // Default 7.5 cm ~ 3 inches
233+ public float MinCantM = 0.0125f ; // Default 1.25 cm ~ 0.5 inches
234+ public float MaxCantM = - 1.0f ; // Specified by user settings by default
235+ public float MinSpeedMpS = MpS . FromKpH ( 25.0f ) ; // Default 25 kmh ~ 15 mph
236+ public float MaxSpeedMpS = float . PositiveInfinity ; // Default unlimited
237+ public float PrecisionM = 0.005f ; // Default 5 mm ~ 0.2 inches
238+ public float RunoffSlope = 0.003f ; // Maximum rate of change of superelevation per track length, default 0.3%
239+ public float RunoffSpeedMpS = 0.04f ; // Maximum rate of change of superelevation per second, default 4 cm / sec ~ 1.5 inches / sec
238240
239241 public SuperElevationStandard ( )
240242 {
@@ -244,16 +246,16 @@ public SuperElevationStandard(STFReader stf)
244246 {
245247 stf . MustMatch ( "(" ) ;
246248 stf . ParseBlock ( new STFReader . TokenProcessor [ ] {
247- new STFReader . TokenProcessor ( "maxfreightunderbalance" , ( ) => { SuperElevationMaxFreightUnderbalanceM = stf . ReadFloatBlock ( STFReader . UNITS . Distance , null ) ; } ) ,
248- new STFReader . TokenProcessor ( "maxpassengerunderbalance" , ( ) => { SuperElevationMaxPaxUnderbalanceM = stf . ReadFloatBlock ( STFReader . UNITS . Distance , null ) ; } ) ,
249- new STFReader . TokenProcessor ( "minimumcant" , ( ) => { SuperElevationMinCantM = stf . ReadFloatBlock ( STFReader . UNITS . Distance , null ) ; } ) ,
250- new STFReader . TokenProcessor ( "maximumcant" , ( ) => { SuperElevationMaxCantM = stf . ReadFloatBlock ( STFReader . UNITS . Distance , null ) ; } ) ,
251- new STFReader . TokenProcessor ( "minimumspeed" , ( ) => { SuperElevationMinSpeedMpS = stf . ReadFloatBlock ( STFReader . UNITS . Speed , null ) ; } ) ,
252- new STFReader . TokenProcessor ( "precision" , ( ) => { SuperElevationPrecisionM = stf . ReadFloatBlock ( STFReader . UNITS . Distance , null ) ; } ) ,
253- new STFReader . TokenProcessor ( "maxrunoffslope" , ( ) => { SuperElevationRunoffSlope = stf . ReadFloatBlock ( STFReader . UNITS . None , null ) ; } ) ,
254- new STFReader . TokenProcessor ( "maxrunoffspeed" , ( ) => { SuperElevationRunoffSpeedMpS = stf . ReadFloatBlock ( STFReader . UNITS . Speed , null ) ; } ) ,
249+ new STFReader . TokenProcessor ( "maxfreightunderbalance" , ( ) => { MaxFreightUnderbalanceM = stf . ReadFloatBlock ( STFReader . UNITS . Distance , null ) ; } ) ,
250+ new STFReader . TokenProcessor ( "maxpassengerunderbalance" , ( ) => { MaxPaxUnderbalanceM = stf . ReadFloatBlock ( STFReader . UNITS . Distance , null ) ; } ) ,
251+ new STFReader . TokenProcessor ( "minimumcant" , ( ) => { MinCantM = stf . ReadFloatBlock ( STFReader . UNITS . Distance , null ) ; } ) ,
252+ new STFReader . TokenProcessor ( "maximumcant" , ( ) => { MaxCantM = stf . ReadFloatBlock ( STFReader . UNITS . Distance , null ) ; } ) ,
253+ new STFReader . TokenProcessor ( "minimumspeed" , ( ) => { MinSpeedMpS = stf . ReadFloatBlock ( STFReader . UNITS . Speed , null ) ; } ) ,
254+ new STFReader . TokenProcessor ( "maximumspeed" , ( ) => { MaxSpeedMpS = stf . ReadFloatBlock ( STFReader . UNITS . Speed , null ) ; } ) ,
255+ new STFReader . TokenProcessor ( "precision" , ( ) => { PrecisionM = stf . ReadFloatBlock ( STFReader . UNITS . Distance , null ) ; } ) ,
256+ new STFReader . TokenProcessor ( "maxrunoffslope" , ( ) => { RunoffSlope = stf . ReadFloatBlock ( STFReader . UNITS . None , null ) ; } ) ,
257+ new STFReader . TokenProcessor ( "maxrunoffspeed" , ( ) => { RunoffSpeedMpS = stf . ReadFloatBlock ( STFReader . UNITS . Speed , null ) ; } ) ,
255258 } ) ;
256- stf . SkipRestOfBlock ( ) ;
257259 }
258260 }
259261
0 commit comments