I'm creating Sri Lanka Railway Class M9 locomotive for train simulator. It is french built Alstom locomotive and all gauges & indicators are shown digitally on a screen. I scussesfully created digital speedometer from guiding EMD SD75M & Class 67 locomotive. By using same method I created air pressure indicators and they also succeeded. In the real loco shows that pressures in "BAR" s. "BAR" valuse are very samall and showing with Points (units.points) (3.4 , 5.1, etc.) .
Can anyone tell me how the Point values create from that ode?
And if there are Thousend values (like RPM) how code looks?
Code:
function Initialise ()
gUnits = 0
gTens = 0
gHundreds = 0
function Update ( time )
gEqres = (math.floor(Call("*:GetControlValue", "EqReservoirPressureBAR", 0)))
gEqres = tostring(gEqres)
if string.len(gEqres) == 1 then
gEqres = ("00" .. gEqres)
elseif string.len(gEqres) == 2 then
gEqres = ("0" .. gEqres)
end
_, _, gHundreds, gTens, gUnits = string.find(gEqres, "(%d)(%d)(%d)")
Call("*:SetControlValue", "EqresUnits", 0, tonumber(gUnits))
Call("*:SetControlValue", "EqresTens", 0, tonumber(gTens))