Raildriver always shows mph on its LED display

Bug #1662100 reported by Michael J. Roth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Open Rails
Fix Released
Medium
Carlo Santucci

Bug Description

Raildriver always shows mph on its LED display instead of kph despite the following settings:
a) "SpeedKPH" in sigcfg.dat
b) "MilepostUnitsKilometers" in the trk file

These Settings will only work for the HUD, but does not lead to the expected effect on raildrivers LED.

The hint of Markus_GE in the ET forum also does not help (see http://www.elvastower.com/forums/index.php?/topic/26447-raildriver-display-speed-in-kph/page__p__177589__hl__ ).

I unfortunately have no access to ET, I can neither answer nor write a Message to Markus_GE or BillC

Tags: raildriver
Revision history for this message
Bill Currey (wjcurrey) wrote :

In line 236 of UserInputRailDriver.cs the boolean value is hard coded to false.
float speed = 10 * MpS.FromMpS(playerLoco.SpeedMpS, false);
This results in the the function Meters per Second always being converted to Miles per Hour.

It has been a long time since I have looked at OR code. When I have a chance I would need to research to determine where to ascertain when the value should be true or false.

Perhaps a developer more familiar in this area could make the change.

BillC

Revision history for this message
Michael J. Roth (hotti1) wrote :

Thank you Bill.

Yesterday i downloaded the source from OR.
After reading the code to understand the context i've already found this line.
I have corrected the boolean value to
float speed = 10 * MpS.FromMpS(playerLoco.SpeedMpS, playerLoco.IsMetric);

After compiling OpenRails on my computer and testing it, the Problem is solved.
Now it works depending from the routes setting (MilepostUnitsKilometers / MilepostUnitsMiles) and the user options.

The improved file UserInputRailDriver.cs i have attached. Maybe you can use them as a fix.

Thanky you and regards,
Mike

Revision history for this message
Carlo Santucci (carlosanit1) wrote :

Uploaded in x.3784.

Changed in or:
status: New → Fix Committed
Revision history for this message
Michael J. Roth (hotti1) wrote : Frage/Bitte [Was: Re: [Bug 1662100] Re: Raildriver always shows mph on its LED display]

Hallo Carlo,

ich habe mitbekommen, dass du Deutsch sprichst, deswegen in Deutsch (ich
könnte es auch in Englisch formulieren falls es dir lieber wäre).

Zunächst vielen Dank für die schnelle Bereitstellung des Fix - und
entschuldige meine Störung, du hast sicher sehr viel zu tun.

Allerdings weiß ich gerade nicht, an wen ich mich wenden soll.

OK, ich würde zunächst gerne OR ins portugiesische übersetzen (mithilfe
meiner portugiesischen Freunde. Mein portugiesisch ist zwar nicht so
gut, dafür haben meine Freunde keine Ahnung von Computern :) )
Soweit ich mich erinnere, wollte im Jahr 2014 dies schon jemand machen,
da scheint nur nichts draus geworden zu sein. Jedenfalls ist bisher in
OR diese Sprache nicht auswählbar.
Nun, ich habe schon einmal angefangen mit POEdit ... es gab zwar beim
Testen einige Probleme, da der POEdit mit sprachspezifischen
Unterscheidungen arbeitet (z.b. pt_PT ... im Deutschen gibt es jetzt ja
auch de_DE oder de_CH usw) und OR eine ältere GNU-Text Version
verwendet, die nur "pt" kennt. Habe ich aber erstmal hinbekommen.

Ich weiß jetzt nicht, wohin ich die po-Dateien schicken soll wenns
langsam fertig wird. Vielleicht kannst du helfen.

Außerdem würde ich gerne am ElvasTower-Forum teilnehmen. Man kann sich
jedoch dort nicht neu registrieren. Hast du möglicherweise eine Idee dazu?

Viele Grüße,
Mike

Am 07.02.2017 um 20:47 schrieb Carlo Santucci:
> Uploaded in x.3784.
>
> ** Changed in: or
> Status: New => Fix Committed
>

--
Michael J. Roth
Karlstr. 115
64285 Darmstadt
Tel. 06151/998697
Mobil 0175/6391974
http://www.md-soft.de

James Ross (twpol)
Changed in or:
milestone: none → 1.3
importance: Undecided → Medium
James Ross (twpol)
Changed in or:
assignee: nobody → Carlo Santucci (carlosanit1)
James Ross (twpol)
Changed in or:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.