Jump to content

Recommended Posts

Hi,In need of a little help with the next code.Want to show time as 00:00 (H:M) as EstimTimeEnroute.I have the from the B747.Calculated Time=Distance/Speed as follows:%((L: Dist,number) rddg 60 * (A:Airspeed select indicated or true,knots) / 60 * )%!02d%That code gives the number of minutes to go(?).%((L: Dist,number) rddg 60 * (A:Airspeed select indicated or true,knots) / )%!0.2f%gives H.1/100H.So is there a way to show it 00:00 (H:M)?Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest Eugen

Hi Jan,look in the file archive for clock2.zip.BrgdsEugen

Share this post


Link to post
Share on other sites

Eugen,The clock code is not the problem, but my calculation "DISTANCE/SPEED=TIME".This code gives me the amount of minutes to arrive at a waypoint.So the reading now is (eg): ETE(MIN): 135I would like: ETE 02:15, if at all possible.Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest Eugen

Hi,Ok here is just a thought...135 /60 store it use int to to get rid of decimals now you have the hours load initial value - int value * 60 =minutes or something like this ?brgdsE

Share this post


Link to post
Share on other sites
Guest bartels

...something in minutes) d 60 / int )%!02d!:%( 1 % int )%!02d!or...something in hours) d int )%!02d!:%( 60 % int )%!02d!Arne Bartels

Share this post


Link to post
Share on other sites

Hallo,Up until now no succes with the codes, so i'll use for the time being:%((L:Dist,number) rddg 60 * (A:Airspeed select indicated or true,knots) / 60 * )ETE 00:%!2d!With waypoints less than 1 hour to go no problem, otherwise not very realistic, see pic.Other ideas?Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

This is an old post, but I was having a similar issue and I finally solved it, so maybe it will be useful to sombody else. I am just beginning with the vaguely documanted XML/RPN schema, but thanks to those like Arne and Jan, I am finally making some headway. There seems to be no Modula functions that I can find, making this more difficult than need be, so here is the code followed by what I did to arrive at it. I'm sure it can be more efficient, and I hope somebody will modify it to improve it.This code will take a value in seconds, and give you a TTG (Time to go), aka ETE (Estemated Time Enroute) in the format HH:MM:SS%((A:Nav2 dme, nmiles) (A:Ground Velocity,knots) / 3600 * s1)%( l1 3600 / int s3)%( l3 3600 * s9 l1 l9 - s2)%(l2 60 / int s4)%(l3 3600 * s9 l4 60 * s8 l1 l9 - l8 - s5)%(l3)%!02d!%:%(l4)%!02d!%:%(l5)%!02d!Hope this helps somebody...--Jon

Share this post


Link to post
Share on other sites

Forgot to mention this, but it may be obvious anyway: This can be used to format ANY time in seconds to an Hours:Minutes:Seconds format. This is what the code is doing:1) Divide Total Seconds (s1) by 3600 to get hours (int)Hours(s3) = Total Seconds / 36002) Subtract the hours portion to get Remaining Seconds(s2)Remaining Seconds(s2) = Total Seconds - (Hours * 3600)3) Divide Remaining Seconds by 60 to get minutes (int) Minutes(s4) = Remaining Seconds /604) Subtract Hours and Minutes to get Seconds. Seconds(s5) = Total Seconds - (Hours * 3600) - (Minutes * 60)Format the hours, minutes, and seconds to hh:mm:ss--Jon

Share this post


Link to post
Share on other sites

Hi,Nice work.At the moment i use only (Flightplan in GPS) ETA in Zulu time as in the real thing:%((A:GPS IS ACTIVE WAY POINT, bool))%{if}%((A:GPS WP ETA, hours) flr 100 %)%!02d!:%((A:GPS WP ETA, minutes) flr 60 %)%!02d!%z%{end}Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

>%((A:GPS IS ACTIVE WAY POINT, bool))%{if}%((A:GPS WP>ETA, hours) flr 100 %)%!02d!:%((A:GPS WP ETA, minutes) flr 60>%)%!02d!%z%{end}>Jan,I tried this and that to get the WP ETA shown on my ND as Zulu Time. Without any success. Then I searched the forum and came across this thread.I had also extracted above code from the default GPS and modified it the same way you did (in addition I have erased the ":" and added seconds to dispaly the ETA the it is in Boeing aircraft). But unfortunately the only thing it gives me is the ETA in local time (same as in the dafault GPS) but with a "z" at the end of the string. So how have you managed, that this code gives you the ETA displayed as Zulu Time?Wolfgang

Share this post


Link to post
Share on other sites

Wolfgang,I didn't bother so much.But may be it is possible to add GPS ETE to ZULU TIME??Something like (not tested):(P:Zulu time, hours) 24 % flr (A:GPS WP ETE,hours) flr 100 % + (P:Zulu time, minutes) 60 % flr (A:GPS WP ETE,minutes) 60 % flr + %(@hours)%!02d!:%(@minutes)%!02d!z%etc.Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites

Thanks Jan,I'll give it a try tonight!Wolfgang

Share this post


Link to post
Share on other sites

Hi,Tried:(P:Zulu time,hours) (A:GPS WP ETE,hours) + flr 24 % (P:Zulu time,minutes) (A:GPS WP ETE,minutes) + flr 60 % %(@hours)%!02d!:%(@minutes)%!02d! z%Looks promising,Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites

Thanks a lot, Jan!Your idea of using ETE did the trick. I only alterd the ETA code extractetd from the default GPS as follows and get the ETA displayed in Zulu Time now (for seconds I use a dummy at the moment, as I found out that my precious used code did not work correctly).%((A:GPS IS ACTIVE WAY POINT, bool))%{if}%((P:Zulu time, hours) (A:GPS WP ETE, hours) + flr 24 %)%!02d!%((P:Zulu time, minutes) (A:GPS WP ETE, minutes) + flr 60 %)%!02d!%.0z%{end}Wolfgang

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...