June 24, 200718 yr Commercial Member 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
June 24, 200718 yr 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..." Jan "Beatus ille qui procul negotiis..."
June 24, 200718 yr Author Commercial Member 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
June 24, 200718 yr Author Commercial Member 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
June 24, 200718 yr 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..." Jan "Beatus ille qui procul negotiis..."
June 24, 200718 yr Moderator >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
June 24, 200718 yr Author Commercial Member 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
June 24, 200718 yr Author Commercial Member 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
June 25, 200718 yr Moderator 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
June 25, 200718 yr Author Commercial Member :) - 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
June 26, 200718 yr Dai - YOU are excused for your oversight. For Fr. Bill, it's back to the woodshed time.. :)
June 26, 200718 yr Moderator >:) - 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
June 26, 200718 yr Author Commercial Member 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
June 26, 200718 yr That is why i also add:(A:SIM ON GROUND,bool) if{ ("ground surface and condition") } els{ ("Airborne") }Jan"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
June 26, 200718 yr Author Commercial Member Hi JanI do check for aircraft on ground :). I was adding more 'silliness' to Bill's last reply.-Dai
Create an account or sign in to comment