openrails / test-launchpad-bugs

TEST repository for Launchpad bug migration exploration
0 stars 0 forks source link

[BUG 1662100] Raildriver always shows mph on its LED display #474

Closed twpol closed 5 years ago

twpol commented 7 years ago

Imported from https://bugs.launchpad.net/bugs/1662100

Property Value
Reported by Michael J. Roth (hotti1)
Date reported Mon, 06 Feb 2017 08:54:28 GMT
Tags raildriver

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

twpol commented 7 years ago

Imported from https://bugs.launchpad.net/or/+bug/1662100/comments/1

Property Value
Posted by Bill Currey (wjcurrey)
Date posted Tue, 07 Feb 2017 06:47:31 GMT

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

twpol commented 7 years ago

Imported from https://bugs.launchpad.net/or/+bug/1662100/comments/2

Property Value
Posted by Michael J. Roth (hotti1)
Date posted Tue, 07 Feb 2017 07:20:02 GMT

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

twpol commented 7 years ago

Imported from https://bugs.launchpad.net/or/+bug/1662100/comments/3

Property Value
Posted by Carlo Santucci (carlosanit1)
Date posted Tue, 07 Feb 2017 19:47:20 GMT

Uploaded in x.3784.

twpol commented 7 years ago

Imported from https://bugs.launchpad.net/or/+bug/1662100/comments/4

Property Value
Posted by Michael J. Roth (hotti1)
Date posted Sat, 11 Feb 2017 10:28:04 GMT

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