Jump to content

Recommended Posts

I concede that sometimes I'm so stupid I overlook the completely obvious, but can some tell me how to retrieve RUNWAY_SURFACE? I'd like to provide some form of feedback when on the ground.-Dai

Share this post


Link to post
Share on other sites

Hi,Does this helps?(A:SURFACE TYPE,enum)0 Concrete 1 Grass 2 Water 3 Grass_bumpy 4 Asphalt 5 Short_grass 6 Long_grass 7 Hard_turf 8 Snow 9 Ice 10 Urban 11 Forest 12 Dirt 13 Coral 14 Gravel 15 Oil_treated 16 Steel_mats 17 Bituminus 18 Brick 19 Macadam 20 Planks 21 Sand 22 Shale 23 Tarmac 24 Wright_flyer_track )and(A:SURFACE CONDITION,enum)0 DRY 1 WET 2 ICY 3 SNOW4 ?Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hi JanI was looking for how to get the information via a C variable (like MODULE_VAR) but you've given me enough information there that I think I can get it via execute_calculator_code. I'll give it a try.-Dai

Share this post


Link to post
Share on other sites

Failed. :(. I triedexecute_calculator_code("(A:SURFACE_TYPE,Enum)",&val,NULL,NULL);andexecute_calculator_code("(E:SURFACE_TYPE,Enum)",&val,NULL,NULL);but got only zero from both of them. Where did I go wrong?-Dai

Share this post


Link to post
Share on other sites

Hi,From the fsgps:%((@c:WaypointAirportRunwaySurface))%{case}%{:1}Concrete%{:2}Asphalt%{:101}Grass%{:102}Turf%{:103}Dirt%{:104}Coral%{:105}Gravel%{:106}Oil%{:107}Steel%{:108}Bituminus%{:109}Brick%{:110}Macadam%{:111}Planks%{:112}Sand%{:113}Shale%{:114}Tarmac%{:115}Snow%{:116}Ice%{:201}Water%{end}As you can see, no enum 0-24!That is the only one i use.No idea about C++.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

>Failed. :(. I tried>>execute_calculator_code("(A:SURFACE_TYPE,Enum)",&val,NULL,NULL);>>and>>execute_calculator_code("(E:SURFACE_TYPE,Enum)",&val,NULL,NULL);>>but got only zero from both of them. Where did I go wrong?Syntax, Dai...This works fine:execute_calculator_code("(E:TIME OF DAY,Enum)",NULL,&time_of_dayi,NULL);Hence, you would need to use this:execute_calculator_code("(E:SURFACE_TYPE,Enum)",NULL,&val,NULL);Remember the prototype is:*execute_calculator_code) (PCSTRINGZ code, FLOAT64* fvalue, SINT32* ivalue, PCSTRINGZ* svalue);-or in English-*execute_calculator_code) ("XMLvar,units", float, integer, string);In your failed experiment, you asked for an integer in the "units" of the XMLvar, but put a pointer (&val) in the "float" field for the return! ;)


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

Wow! That was quick Bill! You posted while I was still searching the forum and yes, I'd just discovered the TimeOfDay post. Even worse, I've been using the ToD info to control my cockpit lighting... (is there a smiley for Horribly Embarrassed?). I think I'd skirted all round the answer as I'd also tried this:execute_calculator_code("(A:SURFACE_TYPE,Enum)",NULL,&val,NULL);Ok well... next time I'll remember to look further before I post. Many, many thanks for the confirmation.-Dai

Share this post


Link to post
Share on other sites

No.... I still can't get it to work. iToD works, iRwyType doesn't.//**************************************************************************//Get the time of day (1=day, 3=anything else!)//**************************************************************************SINT32 iToD=0;GetTimeOfDay (SINT32 TimeOfDay){ SINT32 time_of_day; execute_calculator_code("(E:TIME OF DAY,Enum)",NULL,&time_of_day,NULL); iToD=time_of_day; return iToD;}//**************************************************************************//Get the runway surface type//**************************************************************************SINT32 iRwyType=0;GetRunwayState(SINT32 rwystate){ SINT32 state; execute_calculator_code("(E:SURFACE_TYPE, Enum)",NULL,&state,NULL); iRwyType=state; return iRwyType;}iToD=GetTimeOfDay(iToD) works okay (as far as it goes! :)) but iRwyType=GetRunwayState(iRwyType) always returns zero, wherever I place my aircraft. Am I missing something else here?-Dai

Share this post


Link to post
Share on other sites

Beats me, Dai! I've never actually tried the variable myself, but did notice the syntax error immediately, having been "victim" of that myself a time or two.EDITED (10 minutes later):Solved! There are two issues preventing this from working, and both are horribly embarrasing to me as well: :-grr 1) The name of the variable is SURFACE TYPE, not SURFACE_TYPE...2) The variable is an "A" type, not "E" type... I spent about 30 seconds testing this in a simple XML gauge:%((A:SURFACE TYPE, Enum))%!d!%It works perfectly... :-jumpy Therefore, this should work as well now:execute_calculator_code("(A:SURFACE TYPE, Enum)",NULL,&state,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

:) - I'm at work ATM but I'll try it when I get home. You know what makes it even worse for both of us? Look at Jan's first reply: he says(A:SURFACE TYPE,Enum........ oooops *:-*.-Dai

Share this post


Link to post
Share on other sites
Guest FelixFFDS

Dai - YOU are excused for your oversight. For Fr. Bill, it's back to the woodshed time.. :)

Share this post


Link to post
Share on other sites

>:) - I'm at work ATM but I'll try it when I get home. You>know what makes it even worse for both of us? Look at Jan's>first reply: he says>>(A:SURFACE TYPE,Enum>>........ oooops *:-*.Yeah, I noticed that too...FS does seem to have bit of sport with us, if you move off the taxiway or runway onto the grass, it reports you are in the "Forest..." *:-*


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

It also reports ground type and ground condition when you're flying; I guess there must be a wee man running along under your aircraft and reporting by radio....-Dai

Share this post


Link to post
Share on other sites

That is why i also add:(A:SIM ON GROUND,bool) if{ ("ground surface and condition") } els{ ("Airborne") }Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hi JanI do check for aircraft on ground :). I was adding more 'silliness' to Bill's last reply.-Dai

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