Jump to content

Sign in to follow this  
E

Programmatically determine if sim is paused

Recommended Posts

Guest mlgoff

As part of my ongoing project to create an HT9100 interface for FS I have a new requirement. Id the sim is paused we need to modify the fuel flow data being transmitted tot he HT9100. I've found key events that allow me to programmatically toggle the pause state of the sim but I can't find a token or named variable that allows me to programmatically determine if the sim is paused. Anyone know what piece of data will tell me if the sim is paused?Thank you.

Share this post


Link to post
Share on other sites

Your best bet will be to track a variable likeCLOCK_TOTAL_SECONDS or ELAPSED_SECONDS.If the value has not changed since the last reading, then the sim is most likely paused... I say 'most likely' because I believe placing the sim in slew mode will also stop these variables from incrementing.Doug

Share this post


Link to post
Share on other sites

Hi,You could use a L:Var (if there are no objections)%((L:pause,bool) !)%{if}-----%{else}PAUSE%{end}(L:pause,bool) ! if{ 1 (>L:pause,bool) (>K:PAUSE_ON) } els{ 0 (>L:pause,bool) (>K:PAUSE_OFF) } Hope it helps,Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest bartels

ELAPSED_SECONDS is good for fuel consumption calcs, because both in slew or pause this var stops to increase and also no fuel is used, so everything is fine.Arne Bartels

Share this post


Link to post
Share on other sites
Guest mlgoff

Thanks guys ELAPSED_SECONDS works perfectly.

Share this post


Link to post
Share on other sites

Is this variable also available in XML ??It tried every variant I can think of, like:A:ELAPSED SECONDS,secondsP:ELAPSED SECONDS,secondsE:ELAPSED SECONDS,secondsA:ELAPSED_SECONDS,secondsP:ELAPSED_SECONDS,secondsE:ELAPSED_SECONDS,secondsbut nothing works.Rob

Share this post


Link to post
Share on other sites

>http://forums.avsim.net/dcboard.php?az=sho...14662&mode=full>>>Regards,>Roman>Yes, that piece of code is no news to me :-).But my question was about the "ELAPSED SECONDS" variable, as mentioned by Arne.Because (P:Absolute time,seconds) IS stopped during Pause, but NOT stopped during Slew.And I'm looking for a variable (in XML) that indicates that the sim is not running normally, being either in Menu mode, in Pause or in Slew. Or simply said: determine if the sim is in Slew mode, because detection of all other "suspend" modes are clear to me.Regards, Rob

Share this post


Link to post
Share on other sites

From SDK - May be P: or E: type booleanIS SLEW ACTIVEIS SLEW ALLOWEDRegards,Roman

Share this post


Link to post
Share on other sites

Hi Roman,Thanks for the tip. I overlooked that one in the FS2004 SDK.(A:IS SLEW ACTIVE,bool) works fine, so combined with ABSOLUTE TIME it solves my problem of how-to suspend fuel calculations when FS is not running normally.Still curious after the ELAPSED_SECONDS in XML though :-)Regards, Rob

Share this post


Link to post
Share on other sites

Rob,While there is no Elapsed Time variable you could make your own.(G:Var1) 0 == if{ (P:ABSOLUTE TIME, seconds) (>L:TIMERSTART, enum) 1 (>G:Var1) }(P:ABSOLUTE TIME, seconds) (L:TIMERSTART, enum) - (>L:ELAPSEDTIME, enum) Regards,Roman

Share this post


Link to post
Share on other sites

This is how I do it... (P:Absolute time, seconds) (G:Var1) == if{ 1 (>L:paused,bool) } els{ (>L:paused,bool) } (P:Absolute time, seconds) (>G:Var1)...then I just check for (L:Paused,bool) being true as necessary.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...