Elvas Tower: ORTSRigidWheelBase two numbers expected - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

ORTSRigidWheelBase two numbers expected

#1 User is offline   disc 

  • Foreman Of Engines
  • Group: Open Rails Developer
  • Posts: 817
  • Joined: 07-October 12
  • Gender:Male
  • Simulator:OpenRails
  • Country:

Posted 19 February 2017 - 01:37 PM

someone noticed that writing ORTSRigidWheelBase ( 2.5 ) in .eng throws "Warning: When expecting a number, we found a ) marker." to log at start.
Looking at the sourcecode i saw a very unusual way to read the value:
case "wagon(ortsrigidwheelbase":
                    stf.MustMatch("(");
                    RigidWheelBaseM = stf.ReadFloat(STFReader.UNITS.Distance, null);
                    RigidWheelBaseM += stf.ReadFloat(STFReader.UNITS.Distance, 0);
                    stf.SkipRestOfBlock();
                    break;


So it expects two numbers. So as i expected ORTSRigidWheelBase ( 2m 500mm ) works, but this is not how every other parameters work, so this value is an exception. I think this is wrong, an should work like other parameters.
Or is there a reason for this?

#2 User is offline   steamer_ctn 

  • Open Rails Developer
  • Group: Contributing Member
  • Posts: 762
  • Joined: 24-June 11
  • Gender:Male
  • Country:

Posted 19 February 2017 - 05:57 PM

View Postdisc, on 19 February 2017 - 01:37 PM, said:

Or is there a reason for this?

The primary reason was to allow for imperial measurements such as "4ft 3in".

#3 User is offline   disc 

  • Foreman Of Engines
  • Group: Open Rails Developer
  • Posts: 817
  • Joined: 07-October 12
  • Gender:Male
  • Simulator:OpenRails
  • Country:

Posted 20 February 2017 - 02:22 AM

View Poststeamer_ctn, on 19 February 2017 - 05:57 PM, said:

The primary reason was to allow for imperial measurements such as "4ft 3in".


Why? That's an inconsistency, as all other parameters work with single number. BTW Google search can convert ft in to anything, no need for such ancient outdated measurements. Also the manual shows a not working example, as "(3.37m)" isn't works, (3m 0.37m) is.

#4 User is offline   copperpen 

  • Vice President
  • Group: Elite Member
  • Posts: 2,630
  • Joined: 08-August 05
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 20 February 2017 - 03:18 AM

Why not make a change to the code so that it accepts single metric entries like 3.37m or 14.25ft and/or old imperial style like "4ft 7.5in". Makes more sense that way.

#5 User is offline   Genma Saotome 

  • Owner and Admin
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: Owner
  • Posts: 11,994
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 20 February 2017 - 12:00 PM

You could also consider a new unit of measure -- FtIn -- appended to any number that has any non-numberic, not decimal place delimiter. So "4 4.5ftin" would be the same value as 48.5in. IMO it's awkward but it would let the parameter value record only one value like everything else.

An alternative is simply allowing a few new parameter names intended for this situation -- RigidWheelBaseFTIN ( firstvalue secondvalue ). The loader will do the conversion to metric anyway, what difference does it make if there are two possible inputs to one internal parameter?

WRT the comment about this matter being on behalf of ancient outdated schemes I'll note that it isn't an ancient outdated scheme if it is the only one you know and if it is so trivial a matter to use google to convert from one scheme to another how do you feel about a proposal that all metric values should be recorded as feet, inches, gallons, etc.? Suddenly not so trivial, is it?

#6 User is online   Csantucci 

  • Executive Vice President
  • Group: Elite Member
  • Posts: 3,697
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 20 February 2017 - 01:05 PM

I am not eager to add to OR features not present in MSTS to support imperial units.

#7 User is offline   James Ross 

  • Open Rails Developer
  • Group: Elite Member
  • Posts: 4,814
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 20 February 2017 - 01:32 PM

View Postdisc, on 19 February 2017 - 01:37 PM, said:

So it expects two numbers. So as i expected ORTSRigidWheelBase ( 2m 500mm ) works, but this is not how every other parameters work, so this value is an exception. I think this is wrong, an should work like other parameters.
Or is there a reason for this?

This is an anomaly we should not use elsewhere/more generally but made a lot of sense for imperial units in this particular case. However, it should not generate a warning for a single distance value - which I've fixed in X3802.

#8 User is offline   disc 

  • Foreman Of Engines
  • Group: Open Rails Developer
  • Posts: 817
  • Joined: 07-October 12
  • Gender:Male
  • Simulator:OpenRails
  • Country:

Posted 20 February 2017 - 02:37 PM

View PostGenma Saotome, on 20 February 2017 - 12:00 PM, said:

all metric values should be recorded as feet, inches, gallons, etc.? Suddenly not so trivial, is it?

Not at all, as metric is the standard(and the majority), imperial is the past, especially such things like this ft in, which is weird even among the other imperial measurements.

#9 User is offline   steamer_ctn 

  • Open Rails Developer
  • Group: Contributing Member
  • Posts: 762
  • Joined: 24-June 11
  • Gender:Male
  • Country:

Posted 20 February 2017 - 08:06 PM

View Postdisc, on 20 February 2017 - 02:37 PM, said:

Not at all, as metric is the standard(and the majority), imperial is the past, especially such things like this ft in, which is weird even among the other imperial measurements.

Whilst I can understand the desire to standardise on a modern standard, such as the metric system, I believe that it is also important to allow for the input of imperial measurements. This is because most steam locomotive design and specifications documents are in imperial measurements. The need to convert them all to metric is tedious, potentially could lead to conversion errors, and also doesn't allow easy checking of ENG files against the original imperial specification. So whilst imperial is the "past", it needs to be catered for.

I agree the generation of an error message is (was) a pain, so thanks for the patch James.

ORTSTrackGauge also suffers from the same issue, so it also needs to have a similar patch applied.

Thanks

#10 User is offline   Jovet 

  • Open Rails Developer
  • Group: Elite Member
  • Posts: 2,008
  • Joined: 14-January 08
  • Gender:Male
  • Location:Omaha, Nebraska.
  • Simulator:MSTS/Open Rails
  • Country:

Posted 20 February 2017 - 11:56 PM

View Postdisc, on 20 February 2017 - 02:37 PM, said:

...especially such things like this ft in, which is weird even among the other imperial measurements.

Not really. I am 6 feet 1 inch tall. 6.083333 feet just doesn't have the same ring to it. Those who are familiar with the imperial system know what an inch is. But they probably wouldn't know that 0.08333 feet is an inch.
"73 inches" is weird to me when describing a man's height, but not for other things.
But I also don't mind being 185cm tall.

Similarly, time is not metric in design. But I am sure you grasp what "2 minutes and 23 seconds" means a lot better than you would "2.38333 minutes".

  • 2 Pages +
  • 1
  • 2
  • 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