Colonia Posted July 16, 2011 Report Share Posted July 16, 2011 Hello, I'm looking for a possibility to show the altitude beside feet also in meters in the Acarsmap. Also the speed should be indicated in knots as well as kilometers per hour (km/h). I've done some attempts, but nothing is working. I need two other variables, e.g. <%=flight.meters%> and <%=flight.kilometers%>. I tried to multiply the height by PHP with 0.30479 and the speed with 1.851984, but the result is always 0. Can someone help, please? Quote Link to comment Share on other sites More sharing options...
Jeff Posted July 17, 2011 Report Share Posted July 17, 2011 I could be wrong, but I don't think it would be that easy to configure it that way since the way it is pulling that info out is depending on your settings inside your config file. Taken from: /public_html/core/app.config.php # Units settings # These are global, also used for FSPAX Config::Set('WeightUnit', '1'); # 0=Kg 1=lbs Config::Set('DistanceUnit', '2'); # 0=KM 1= Miles 2=NMiles Config::Set('SpeedUnit', '1'); # 0=Km/H 1=Kts Config::Set('AltUnit', '1'); # 0=Meter 1=Feet Config::Set('LiquidUnit', '3'); # 0=liter 1=gal 2=kg 3=lbs Config::Set('WelcomeMessage', 'phpVMS/FSPAX ACARS'); # Welcome Message Config::Set('LIQUID_UNIT_NAMES', array('liter','gal','kg', 'lbs')); You might have to dig a little deeper in Google to find some kind of way to configure it to have it show correctly for you. Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted July 17, 2011 Report Share Posted July 17, 2011 you would need to process the data in the ACARS module. Then load it into the json array. Then use the same variable inside of the template. Inside of the loop would need to add something like $c['alt_metre'] = $flight->altitude * .3048; In the template you can then use <%=flight.alt_metre%> Then do the same with what ever else you wish. Quote Link to comment Share on other sites More sharing options...
Colonia Posted July 18, 2011 Author Report Share Posted July 18, 2011 I could be wrong, but I don't think it would be that easy to configure it that way since the way it is pulling that info out is depending on your settings inside your config file. @Jeff: This was the first what I've tried, but it doesn't work. Inside of the loop would need to add something like $c['alt_metre'] = $flight->altitude * .3048; In the template you can then use <%=flight.alt_metre%> Thank you very much, @lorathon It works absolutely fine, with a small modification to round the output. I've added the following lines in the ACARS.php: $alt_meters = round(($flight->alt * 0.30479), 0); $c['alt_meters'] = $alt_meters; $gs_kilometers = round(($flight->gs * 1.851984), 0); $c['gs_kilometers'] = $gs_kilometers; Then I've added this in the acarsmap.tpl: <%=flight.alt_meters%> <%=flight.gs_kilometers%> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.