Jump to content

Recommended Posts

>Bill, did you ever try calling a gps value from a .gau/dll>gauge?>I mean, any kind of>execute_calculator_code("(C:fs9gps:etc)",etc) ?>>I've read so many times this should work, but I couldn't>suceed in retrieving even the most basic>FlightPlanIsActiveFlightPlan...>>I must be doing something very wrong then. >>Would like to see a working example on this too!Um, yes... some of the Avidyne's data is retrieved that way. Of course, I cannot share the actual code, but I can certainly attest that the method does work!


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 am sorry to say that I still get 0. I noticed the boo - boo>with the string which should have been degrees, so changed>that. I copied my gps.dll and put it in the main FS9 folder to>see if that was the problem, but still got 0. I think there>must be a problem with my computer, I am off to get a hammer>:-)>>PCSTRINGZ lat_icao;>PCSTRINGZ lon_icao;>PCSTRINGZ airport_icao;Er, lat_icao and lon_icao should be float vars since they are in degrees... :)FLOAT64 lat_icao = 0 ;FLOAT64 lon_icao = 0 ;PCSTRINGZ airport_icao;


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

Ok, I have to ask... do you know how to program in C/C++???


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites

>>>>PCSTRINGZ lat_icao;>>PCSTRINGZ lon_icao;>>PCSTRINGZ airport_icao;>>Er, lat_icao and lon_icao should be float vars since they are>in degrees... :)>>FLOAT64 lat_icao = 0 ;>FLOAT64 lon_icao = 0 ;>PCSTRINGZ airport_icao;Bill, try to not confuse Russell more than he is by now :-)...take a look again and you'll see that his code is right...Tom

Share this post


Link to post
Share on other sites

You're right Ed, in this case he should make the code a bit different to work, because the return to NearestAirport is asyncronius.Tom

Share this post


Link to post
Share on other sites

>>Um, yes... some of the Avidyne's data is retrieved that way.>Of course, I cannot share the actual code, but I can certainly>attest that the method does work!Well, I have serious doubts that there are calls to execute_calculator_code and fs9gps classes in the way we are discussing here -always speaking of .gau/dll gauges, NOT common dlls-In fact, I've found that not even custom classes (C: ) created by myself work, which tends to make me think this function cannot instantiate classes just by parsing their names on the stack. Notice that the stack is cleaned up after each call, meaning it doesn't work by gauge basis but instead by function basis, which gives a logical reason for this behavior.Unless there is someone that can post or comment a way to overcome with this limitation, I would have to stand on my reasons...but will keep testing indeed!Tom

Share this post


Link to post
Share on other sites

>>>>>>PCSTRINGZ lat_icao;>>>PCSTRINGZ lon_icao;>>>PCSTRINGZ airport_icao;>Bill, try to not confuse Russell more than he is by now>:-)...take a look again and you'll see that his code is>right...Argh! Sorry 'bout that. Of course it is, since the prototype is clearly:BOOL (FSAPI *execute_calculator_code) (PCSTRINGZ code, FLOAT64* fvalue, SINT32* ivalue, PCSTRINGZ* svalue);I'll go put on my hair-shirt and hang by my thumbs for awhile as penance... :-lol It may well be that the simplest method would be to use the IGaugeCCallback as described in the TrafficInfo.doc file in the FS9 SDK...


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 may well be that the simplest method would be to use the>IGaugeCCallback as described in the TrafficInfo.doc file in>the FS9 SDK...Yeah, I guess that would the simplest way, building a derivated class from fs9gps and retrieving data with ConvertStringToProperty,ConvertPropertyToString or Query. The problem is I don't have a header for the base class :-( Maybe you know somebody who has a copy ?...:-cool Tom

Share this post


Link to post
Share on other sites

IGaugeCCAllback is in the gauges.h file.


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites

>>>>It may well be that the simplest method would be to use the>>IGaugeCCallback as described in the TrafficInfo.doc file in>>the FS9 SDK...>>Yeah, I guess that would the simplest way, building a>derivated class from fs9gps and retrieving data with>ConvertStringToProperty,ConvertPropertyToString or Query. The>problem is I don't have a header for the base class :-( Maybe>you know somebody who has a copy ?...:-cool It is in the FS9 SDK. Here is the .h file though, along with the .doc 'spaining it's usage.For FS9 usage, you also need to place the TrafficInfo.dll in the Modules folder.For FSX, ACES has supplied a new fs-traffic.dll in the FSX root folder which apparently has the same interface inside, but a new name... ;)


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

Yes, of course, but IGaugeCCallback is the abstract class, you can't do anything with it but contruct a derivated class and insert there the local functions that would retrieve gps properties (ie FlightPlanIsActiveFlightPlan, etc). To acomplish this you need a header of the gps class containing those functions as virtual.Tom

Share this post


Link to post
Share on other sites

>>It is in the FS9 SDK. Here is the .h file though, along with>the .doc 'spaining it's usage.>>For FS9 usage, you also need to place the TrafficInfo.dll in>the Modules folder.>>For FSX, ACES has supplied a new fs-traffic.dll in the FSX>root folder which apparently has the same interface inside,>but a new name... ;)>>Yes Bill I know, but those are for traffic info, and of course not the same used in the gps class. For these ones we would need the base class with virtual functions to retrieve gps specific properties. I know people close to ACE team must have a copy of this header...;) Tom

Share this post


Link to post
Share on other sites

>>Yes Bill I know, but those are for traffic info, and of course>not the same used in the gps class. For these ones we would>need the base class with virtual functions to retrieve gps>specific properties. I know people close to ACE team must have>a copy of this header...;) >>Tom>Nope. There is no fancy header required.You can utilize the base class and use the methods contained in that class to read/write what data you require. This works for the traffic as well as the GPS.


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites

>>>>>Yes Bill I know, but those are for traffic info, and of>course>>not the same used in the gps class. For these ones we would>>need the base class with virtual functions to retrieve gps>>specific properties. I know people close to ACE team must>have>>a copy of this header...;) >>>>Tom>>>>Nope. There is no fancy header required.>>You can utilize the base class and use the methods contained>in that class to read/write what data you require. This works>for the traffic as well as the GPS.Good. Can you give me then a near example, or at least a prototype on how to retrieve the value of "FlightPlanIsActiveFlightPlan" using an IGaugeCCallBack class method? I REALLY hope you can......Tom

Share this post


Link to post
Share on other sites
Guest VAPilot

>>>>>>>>Yes Bill I know, but those are for traffic info, and of>>course>>>not the same used in the gps class. For these ones we would>>>need the base class with virtual functions to retrieve gps>>>specific properties. I know people close to ACE team must>>have>>>a copy of this header...;) >>>>>>Tom>>>>>>>Nope. There is no fancy header required.>>>>You can utilize the base class and use the methods contained>>in that class to read/write what data you require. This>works>>for the traffic as well as the GPS.>>>Good. Can you give me then a near example, or at least a>prototype on how to retrieve the value of>"FlightPlanIsActiveFlightPlan" using an IGaugeCCallBack class>method? I REALLY hope you can......>>Tom>>I really hope they can to, as all I get with execute_calculator_code is 0. Left it running for a while and still displays 0, tried setting and getting more, still 0. I have looked through the traffic sdk and can see how the examples work, but I can not see how you can call the GPS variables from it.

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