Sign in to follow this  
n4gix

Read the time of day XML variable from a C gauge

Recommended Posts

As the TIME OF DAY variable is not available in the Arne Bartel's enumeration (see http://forums.avsim.net/dcboard.php?az=sho...id=17177&page=), I was trying to read the value using the following code:FLOAT64 fvalue;execute_calculator_code("(A:TIME OF DAY, Enum)", &fvalue, NULL, NULL);But it does not work.Do you know how I can read this value?Thanks.Eric

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Eric, despite numerous attempts, I've been unable to get a valid return from that variable in either C or XML gauges, but for some reason known only the "MS gods" it works PERFECTLY in a MDL XML... :-hmmm day_time(E:TIME OF DAY, enum) 1I use this code to make the pilot's sunglasses appear/disappear...I wish someone could explain why the token works here but not in a gauge!But, in any event, the code you posted wouldn't work because TIME OF DAY is enumerated, so requires an E: type tag:execute_calculator_code("(E:TIME OF DAY, enum)", etc.

Share this post


Link to post
Share on other sites

Since some magic must be happening when a model gets the very exact code that a xml gauge would get, have you tried sending that model type code to the gauges via a L: var ?(E:TIME OF DAY, enum) (>L:TimeOfDay,enum) Regards,Roman(KGRB)

Share this post


Link to post
Share on other sites

No Roman, I actually never thought about that. I'll have to give it a try one day when I find some time! :)

Share this post


Link to post
Share on other sites

Just for the sake of "setting things right..."Here is the proper syntax for E:TIME OF DAY. The XML variable is an enumerated integer, so one needs to declare an SINT32 local variable:SINT32 iTimeOfDay;execute_calculator_code("(E:TIME OF DAY,Enum)",NULL,&iTimeOfDay,NULL);

Share this post


Link to post
Share on other sites

Just to let you know:Even in FS-X the FS9 syntax (P:TIME OF DAY,enum) still works.But (E:TIME...) - E: instead of P: like written in the SDK does as well.But even when you select dawn or dusk as the actual time,it might last one more hour until you get the appropriateresult. The daytime settings seem to be a bit more complex...Herbert

Share this post


Link to post
Share on other sites

For reasons which defy all logical analysis, FS actually uses a seperate "clock" for scenery than it does for the panel system......However, in all fairness the SDK's description of the variable IS "General" time of day... :)

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