Jump to content
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

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.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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)


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

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! :)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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);


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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... :)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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...