Jump to content

How to find out the Sim's status


Recommended Posts

I would like to determine the different states of the flightsim.

1) FS running or not - I do this while trying to access the FS via FSUIPC. If there is an error, o.k. Is there a better way ?

2) FS in the dialiog box where missions or saved flights can be chosen.

I would like to find out whenever I am in this box. the "ready-to-fly" flag seems not to be suited - it stays in the "ready-to-fly" state and seems to be "not ready" only when loading scenery

Is there a better (or best) way ?

Greetings

Link to comment
Share on other sites

I would like to determine the different states of the flightsim.

1) FS running or not - I do this while trying to access the FS via FSUIPC. If there is an error, o.k. Is there a better way ?

If FS isn't running (or on a WideFS client WideClient isn't running), then the Window classes "FS98MAIN" and "UIPCMAIN" won't be found by the IPC code in your program, so you will get an error returned from the FSUIPC_Process call.

If FS closes after you are connected, the SendMessageTimeOut call will time out instead, giving a different error. However, such timeouts can also occur when FS isn't responding too -- it needs the message processed withing the specified time.

2) FS in the dialiog box where missions or saved flights can be chosen.

I would like to find out whenever I am in this box. the "ready-to-fly" flag seems not to be suited - it stays in the "ready-to-fly" state and seems to be "not ready" only when loading scenery

There are two flags -- "ready to fly" is 3364 but "in a dialog" is 3365. They are next to each other for good reason -- you can treat them together as one 16-bit flag which is only zero when FS is ready.

I'm afraid I don't know of any way to distinguish the specific menu or dialogue the program is in at the time.

Regards

Pete

Link to comment
Share on other sites

Maybe the combination off 3364/65 will give the right result.

Actually I would like to stop updating my panel hardware with nonsense-values as it does know.

Where are you getting "nonsense values" from? All that should happen is that you get frozen values whilst FS is not updating, or zero before the sim is ready in the first place. I have three separate hardware panel setups and never see any "nonsense values".

Pete

Link to comment
Share on other sites

zero values is in that case nonsense. Because all my instruments go mad within dialog boxes !

You always need to cater for zero values. Zero mostly simply means "not yet set". Test for zero and reset the instruments to "off" defaults. In fact you should be testing the battery switch, vacuum, etc and just staying "off" till the aircraft "comes alive".

I will try it and send you

Send what? I don't think I need anything, thank you.

Regards

Pete

Link to comment
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
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.