How does con editor handle unknown parameters?
#1
Posted 15 July 2018 - 01:00 PM
I'm doing some work for to-be-proposed parameters and have noticed that the con editor appears to stop reading the remaining data of a .wag file when it encounters one of these.
Could you check? I think all you have to do is insert a bogus parameter name in the middle of any .wag file -- BogusName( 123 ) would serve well enough -- and see whether I'm correct.
This could be a larger problem if anyone misspells a real parameter name. Trapping with error message would be much better than abruptly stopping.
Lemme know.
Thanks.
#2
Posted 15 July 2018 - 01:22 PM
Genma Saotome, on 15 July 2018 - 01:00 PM, said:
I'm doing some work for to-be-proposed parameters and have noticed that the con editor appears to stop reading the remaining data of a .wag file when it encounters one of these.
Could you check? I think all you have to do is insert a bogus parameter name in the middle of any .wag file -- BogusName( 123 ) would serve well enough -- and see whether I'm correct.
This could be a larger problem if anyone misspells a real parameter name. Trapping with error message would be much better than abruptly stopping.
Lemme know.
Thanks.
#3
Posted 15 July 2018 - 01:41 PM
But... you never really know what's going on w/o asking.
I have my suspicions OR is having the same problem but I've not yet invested the time to do any controlled testing.
#4
Posted 15 July 2018 - 05:49 PM
You are correct because I just solved an issue where the entire wagon would not show up on the list because "CommentToken" was used. I do not know if you have ever seen this, but about 3 lines worth was enough to stop the editor from reading to the end.
#5
Posted 15 July 2018 - 11:58 PM
Quote
In 99.99% cases this is caused by one bracket too much inside .INC file.
Quote
TSRE will ignore all undefined parameters if they are defined correctly.
Quote
This is different case. CommentToken crashed TSRE not because TSRE doesn't handle "CommentToken" Tag, but because CommentToken in your file is defined without ( ) and TSRE doesn't allow this kind of tag.
#6
Posted 16 July 2018 - 01:38 PM
Goku, on 15 July 2018 - 11:58 PM, said:
Not in this case. Here is the .wag:
SIMISA@@@@@@@@@@JINX0D0t______
Wagon ( XM_MILW_702584_Hides
Include ( "..\\Common.Inc\\Models\\Tim_Muir\\USRA_SS_Boxcar\\XM_USRA_SS_Empty_Car.inc" )
FreightAnim ( Old_ss_parts.s 1 1 1 )
Include ( "..\\Common.Inc\\Models\\Tim_Muir\\USRA_SS_Boxcar\\XM_USRA_SS_Hides_Ld.inc" )
Include ( "..\\Common.Inc\\Fleet\\Std_Type_E_Coupler_Generic_Draft_Gear.inc" )
Include ( "..\\Common.Inc\\Fleet\\Single_Pipe_AB_Brakes.inc" )
Sound ( "genfreightwag2.sms" )
Name ( "XM 40' MILW <USRA SS> 702584 Hides" )
)
The first .inc file:
Comment ( XM_USRA_SS_Empty_Car.inc )
comment ( "Parts 1A and 1B are correct for all .wags of this model" )
comment ( "Part 1A - Parameters based on the model itself." )
Size ( 3.1m 4.6m 13.45m )
WheelRadius ( 33in/2)
NumWheels ( 8 )
InertiaTensor ( Box ( 3.1m 4.6m 13.15m ) )
MaxBrakeForce (3.6497kn )
MaxHandbrakeForce (2.7372kn )
DerailRailHeight ( 4cm )
ORTSTrackGauge ( 4ft 8.5in )
ORTSRigidWheelBase (5ft 6in )
ORTSBearingType ( Friction )
ORTSUnbalancedSuperelevation ( 6in )
comment ( "Part 1B - Unsupported parameters based on the model itself." )
MaxHeight ( 13.5833 ft )
BrakeShoeFriction ( 0.2)
TargetPctMtyWeight ( 0.7)
DavisFormula ( "Davis 1926" )
CAPY ( 100000 )
LD_LMT ( 122400 )
LT_WT ( 46200 )
The second .inc file:
Comment ( XM_USRA_SS_Burlap_Bags_LD.inc )
comment ( "Part 2A and 2B are parameters based on presence or absence of a load. " )
comment ( "Parameters for an empty car belong in a Fixed_Specs.inc" file." )
comment ( "Parameters for a loaded car belong in a {Lading Name}_Loads.inc file." )
comment "Part 2A - parameters based on presence or absence of a load.
CentreOfGravity (1.9m)
DerailRailForce ( 109.0903t )
DerailBufferForce ( 380.1582kn )
ORTSDavis_A ( 178.5297 lbf )
ORTSDavis_B ( 2.1645 lbf/mph )
ORTSDavis_C ( 0.0685 lbf/mph^2 )
comment ( "Part 2B - Unsupported parameters based on presence or absence of a load." )
LadingWeight ( 24.45 s-t )
The third .inc file
comment ( "Type E coupler w/ generic draft gear" )
comment ( "For cars equipped with uncushioned slack pro-couplers ie: Hopper cars, gondolas, tankcars" )
comment ( "older flatcars and boxcars." )
Type ( Automatic )
Spring (
Stiffness ( 0 5e6N/m )
Damping ( 2e6N/m/s 2e6N/m/s )
Break ( 1023.09097kN 1023.09097kN )
r0 ( 7.68cm 15.24cm )
)
Velocity ( 0.2m/s )
)
Coupling (
Type ( Automatic )
Spring (
Stiffness ( 0 5e6N/m )
Damping ( 2e6N/m/s 2e6N/m/s )
Break ( 1023.09097kN 1023.09097kN )
r0 ( 7.68cm 15.24cm )
)
Velocity ( -0.2m/s )
)
Buffers (
Spring (
Stiffness ( 5e6N/m 8e6N/m )
Damping ( 1e6N/m/s 1e6N/m/s )
r0 ( 0m 1e9 )
)
Centre ( 0.5 )
Radius ( 1 )
Angle ( 0.5deg )
)
and the fourth:
Comment ( "Single_Pipe_AB_Brakes.inc" )
BrakeSystemType ( "Air_single_pipe" )
NumberOfHandbrakeLeverSteps( 100 )
TripleValveRatio( 2.5 )
MaxReleaseRate( 20 )
MaxApplicationRate( 0.9 )
MaxAuxilaryChargingRate( 1.684 )
EmergencyResCapacity( 2.604 )
EmergencyResChargingRate( 1.684 )
EmergencyBrakeResMaxPressure( 90 )
BrakeCylinderPressureForMaxBrakeBrakeForce( 70 )
The con editor display shows garbage for Mass(), nothing at all for brakes and couplers, and the "Wagon (" string for name. I had my editor count the ( and ) characters in each file before doing the copy paste here and there were matches all around. SOMETHING is going wrong in the first or second .inc file and I can't find it. It might be one of those very simple things that paradoxically are hard to see... or something new, I dunno.
What I do know is the information the con editor is displaying is wrong and I'd like to know how to correct it.
#7
Posted 16 July 2018 - 01:57 PM
Quote
Ok. This is also the case of no brackets after Tag Name.
Quote
Mass ( 48.0998 s-t )
The line is wrong everywhere! You can't put junk into the file and expect that software will think about everything.
Replace
comment "Part 2A - parameters based on presence or absence of a load.
With:
comment ( "Part 2A - parameters based on presence or absence of a load." )
#8
Posted 16 July 2018 - 02:05 PM
#9
Posted 16 July 2018 - 02:16 PM
#10
Posted 16 July 2018 - 02:31 PM
comment "Part 2A - parameters based on presence or absence of a load.
to:
comment ("Part 2A - parameters based on presence or absence of a load.")
#11
Posted 16 July 2018 - 02:31 PM
What happens when your CE finds unsupported parameters? As in:
Quote
LadingName ( "Burlap bags" )
LadingWeight ( 24.45 s-t )
And Dave I am confused. The WAG filename and the Name line indicates that the load on this WAG is Hides, but the LadingName line says "Burlap bags".
#12
Posted 16 July 2018 - 04:48 PM
The files are all standard so they're actually quite interchangeable. What isn't an Include() statement in the .wag are those few lines that will vary from one .wag instance of the class of cars for another. Sound is often one of those things that do vary. Shape and FA vary, as does name and Wagon. The rest? All standard. For this specific car I can create a dozen other .wags for it and simply change the load line.
Essentially the Empty_car.inc holds all parameters that describe the car. The load file covers the dozen or so parms that vary by weight, over-writing the empty car parms that were read before. Coupler and brakes are standard for all US cars of the era.
@Goku, thanks for the answer... I suspected it was something too simple.
Changing the one .inc file will "update" the several dozen .wags that make use of it. One edit... dozens of wags corrected. Neat, huh?
p.s. The UoM "s-t" is an approved unit meaning short tons, a.k.a. U.S. tons. It will be converted to metric tons inside the OR program. FWIW I am using a spreadsheet to generate the .wag file, the empty_car.inc file, and all of the lading files. It takes a few minutes to enter the necessary values for the empty car; lading is done entirely pull selecting from pull down lists. The copy paste portion takes a few seconds. Using the spreadsheet I can create the .inc file for the empty car .wag and half a dozen different ladings in a minute or two. Editing the .wag file for a single car takes seconds -- loads only needing the one line to be changed... two if you want different sounds.
#13
Posted 17 July 2018 - 12:25 AM
cr-stagg, on 16 July 2018 - 02:31 PM, said:
Nothing. TSRE just looks for some needed parameters. The rest is ignored. There is no ENG/WAG editor in TSRE, so it can work this way.
For example, for ACT files all values are parsed to data structure and it's possible to edit everything and save changes. In this case TSRE prints warning if unsupported parameter is found. For ENG/WAG file unsupported parameter warning is bad idea, because 90% or more ENG parameters are now unsupported by TSRE.
#14
Posted 17 July 2018 - 09:16 AM
The .wag file:
SIMISA@@@@@@@@@@JINX0D0t______
Wagon ( XM_SLSF_127149_MT
FreightAnim ( usra_ss_50xm_parts.s 1 1 1 )
Include ( "..\\Common.Inc\\Models\\Tim_Muir\\USRA_DS_Boxcar\\XM_USRA_DS_Empty_Car.inc" )
Include ( "..\\Common.Inc\\Fleet\\Std_Type_D_Coupler_Generic_Draft_Gear.inc" )
Include ( "..\\Common.Inc\\Fleet\\Single_Pipe_AB_Brakes.inc" )
Sound ( "genfreightwag2.sms" )
Name ( "XM 40' SLSF <USRA SS> 127149 Mty" )
)
The empty car file:
Comment ( "XM_USRA_DS_Empty_Car.inc" )
comment ( "Parts 1A and 1B are correct for all .wags of this model" )
comment ( "Part 1A - Parameters based on the model itself." )
Size ( 3.1m 4.6m 13.275m )
WheelRadius ( 33in/2 )
NumWheels( 8 )
InertiaTensor ( Box ( 3.1m 4.6m 12.975m ) )
MaxBrakeForce (3.0611kn )
MaxHandbrakeForce (2.2958kn )
DerailRailHeight ( 4cm )
ORTSTrackGauge ( 4ft 8.5in )
ORTSRigidWheelBase (5ft 6in )
ORTSBearingType ( Friction )
ORTSUnbalancedSuperelevation ( 6in )
ORTSBearingType ( Friction )
comment ( "Part 1B - Unsupported parameters based on the model itself." )
MaxHeight ( 13 ft 3 in )
BrakeShoeFriction ( 0.2)
TargetPctMtyWeight ( 0.7)
Davis Formula ( "Davis 1926" )
Number of axles ( 4 )
CAPY (80,000 lb )
LD LMT (80,000 lb )
LT WT (43,730 lb )
comment ( "Part 2A and 2B are parameters based on presence or absence of a load. " )
comment ( "Parameters for an empty car belong in the Empty_Car.inc file." )
comment ( "Parameters for a loaded car belong in a {Lading Name}_Loads.inc file." )
comment ( "Part 2A - parameters based on presence or absence of a load." )
CentreOfGravity (0.85m)
DerailRailForce ( 49.5898t )
DerailBufferForce ( 327.7kn )
ORTSDavis_A ( 144.4245 lbf )
ORTSDavis_B ( 0.9839 lbf/mph )
ORTSDavis_C ( 0.0613 lbf/mph^2 )
comment ( "Part 2B - Unsupported parameters based on presence or absence of a load." )
LadingWeight ( 0 s-t )
No need to go further, the con editor does not show a value for Mass(), which is in the above file.
I've counted and checked paired quotes, paired {} inside of quotes, and counted (), checked for a ) at the end of every line, checked for a ( somewhere in every line... I'm not seeing the problem. A review by a second pair of eyes would be appreciated.
#15
Posted 17 July 2018 - 09:35 AM
LT WT (43,730 lb )
TSRE doesn't allow for Tags like this (spaces, double tags etc.).
Change it to LD_LMT or something.