Elvas Tower: Parsing problem in .inc file - Elvas Tower

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Parsing problem in .inc file Rate Topic: -----

#1 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,025
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 16 January 2023 - 11:23 AM

Consider the .inc file here below (courtesy of Aldarion):
Comment ( *************** Brakes - Wagon Section - General ********************** )
	BrakeEquipmentType					( Distributor, Auxilary_reservoir, Handbrake )
	BrakeSystemType						( Air_twin_pipe )
	MaxBrakeForce						( 128.417kN )
	MaxHandbrakeForce 					( 34.245kN )

	TripleValveRatio						( 2.83 )
	MaxReleaseRate						( 0.44bar/s )   #( 0.39-0.51 )
	MaxApplicationRate					( 1.38bar/s )  #( 1.59-2.34 )
	MaxAuxilaryChargingRate					( 1.38bar/s )

	BrakeCylinderPressureForMaxBrakeBrakeForce 	( 3.8bar ) #( verificado em manual de conducao )
	BrakePipeVolume 						( 15l ) #( calculado em coalstonewcastle.com.au )


	EmergencyResCapacity					( 102l )
	EmergencyResChargingRate				( 1.37bar/s )
	EmergencyResVolumeMultiplier 				( 1.0 )
	EmergencyBrakeResMaxPressure				( 5bar )

      Comment ( == COBRA Brakeshoes == )
	ORTSBrakeShoeFriction (
		0.0 0.490
		8.0 0.436
		16.1 0.400
		24.1 0.371
		32.2 0.350
		40.2 0.336
		48.3 0.325
		56.3 0.318
		64.4 0.309
		72.2 0.304
		80.5 0.298
		88.5 0.295
		96.6 0.289
		104.6 0.288
		112.7 0.287
	)

The ORTSBrakeShoeFriction table contains 15 couples of values. ORTS should parse this and generate an interpolator table of - of course - 15 couples of values. But the generated table has 17 couples of values, and moreover the 2 additional X values are smaller than the preceding ones, which can generate later a crash.
Remmembering that I had already noticed problems with the termination of .inc files, I have added following line at the end of the .inc file
	Comment ( == End of COBRA Brakeshoes definition==)

and this way the parser works correctly. Probably also adding an empty line would have solved the problem.

#2 User is offline   Weter 

  • Member, Board of Directors
  • PipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 7,055
  • Joined: 01-June 20
  • Gender:Not Telling
  • Simulator:ORTS
  • Country:

Posted 16 January 2023 - 11:35 AM

so, empty strings must be at either very beginning and at very end?

#3 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 16 January 2023 - 11:45 AM

Hi Carlo,

Yeah - had the same issue with the same variable in a similar format years ago - it wouldn't read the file - UNLESS - you had an empty line after the variable

Thanks.

Regards,
Scott

#4 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,366
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 16 January 2023 - 01:05 PM

View PostWeter, on 16 January 2023 - 11:35 AM, said:

so, empty strings must be at either very beginning and at very end?



There must be a non-data line as the last line (which I always understood to be a blank line) but as Carlo indicated in the basenote a comment works too.

#5 User is offline   R H Steele 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 3,458
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

Posted 16 January 2023 - 01:14 PM

Just to add agreement...all my inc files ( and inc templates ) begin and end with non-data "blank" lines.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users