Jump to content

Plugin development: Change text in data tag


Recommended Posts

Hello everyone,

 

I'm working on the abandoned EHAM Gateplanner plugin for the EHAM controllers. The API is going fine and some things need to be done (async webserver requests) in the plugin as well.

 

At the moment I'm trying to get the custom data tag to work.

Here is the current code in the Dev branch: https://github.com/tyrope/EHAM-gateplanner-EuroScope/tree/Dev

Main file is GatePlannerPlugIn.cpp.

 

The data tag is [Mod - Happy Thoughts]igned (lines 24 and 129). However, it seems the OnGetTagItem-method isn't working properly. The 'ping' message for debug purposes is never showing up, so the string is probably never changed as well.

 

Does anybody know what's wrong with the code?

spacer.png

ACCNL5 (Assistant Training Director) - Dutch VACC

Link to post
Share on other sites

I tried some more things and found that the problem probably is with this part:

if(!FlightPlan.IsValid()) {

return;

}

 

If I have a test String above it:

strcpy_s(sItemString, 4, "AA");

 

It works. But after that, it doesn't. So the flightplan check doesn't work. Anyone has an idea why not?

spacer.png

ACCNL5 (Assistant Training Director) - Dutch VACC

Link to post
Share on other sites

I guess it returns the false value for every plane, also the ones with a flight plan. The test-string (BB) works if I add it the line before the if-statement, but if it's the first thing in the if-statement, it won't work. So it never sends a 'correct' flightplan it seems.

 

A silly question maybe, but does it matter that I'm logged in as observer and not as a real controller? I think it wouldn't matter, but who knows... Maybe the IsValid only works for controllers?

spacer.png

ACCNL5 (Assistant Training Director) - Dutch VACC

Link to post
Share on other sites

Do you have any clue as of why the statement won't work?

 

765b82ef51c14fa8a1efb5f272499a24.png

 

If I put the strcpy_s just before the if-statement, it works fine. It doesn't inside the if-statement like on the image above.

spacer.png

ACCNL5 (Assistant Training Director) - Dutch VACC

Link to post
Share on other sites
  • 1 month later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...