Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Read the time of day XML variable from a C gauge

Featured Replies

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

  • Author
  • Moderator

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

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 
 

 

  • Author
  • Moderator

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
  • 2 years later...
  • Author
  • Moderator

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

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

  • Author
  • Moderator

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

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.