Jump to content

You're browsing the 2004-2023 VATSIM Forums archive. All content is preserved in a read-only fashion.
For the latest forum posts, please visit https://forum.vatsim.net.

Need to find something? Use the Google search below.

Plugin development: Change text in data tag


Thimo Koolen
 Share

Recommended Posts

Thimo Koolen
Posted
Posted

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

ACCNL4 (Training Director) - Dutch VACC

Link to comment
Share on other sites

Thimo Koolen
Posted
Posted

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

ACCNL4 (Training Director) - Dutch VACC

Link to comment
Share on other sites

Thimo Koolen
Posted
Posted

Does anyone have an idea as of why it doesn't work?

spacer.png

ACCNL4 (Training Director) - Dutch VACC

Link to comment
Share on other sites

Gergely Csernak
Posted
Posted

The code for IsValid looks like this:

 

   inline  bool    IsValid ( void ) const
   {
       return m_FpPosition != NULL ;
   } ;

 

So it can return false only if you did not get a FP from the system.

Gergely.

EuroScope developer

Link to comment
Share on other sites

Thimo Koolen
Posted
Posted

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

ACCNL4 (Training Director) - Dutch VACC

Link to comment
Share on other sites

Gergely Csernak
Posted
Posted

It should work for observer as well. IsValid checks if the internal structure is correct and not if the FP itself is valid.

Gergely.

EuroScope developer

Link to comment
Share on other sites

Thimo Koolen
Posted
Posted

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

ACCNL4 (Training Director) - Dutch VACC

Link to comment
Share on other sites

Gergely Csernak
Posted
Posted

Do not expect FlightPlan and RadarTarget be valid at the same time. If they are not correlated then OnGetTagItem may p[Mod - Happy Thoughts] only one of them.

Gergely.

EuroScope developer

Link to comment
Share on other sites

Thimo Koolen
Posted
Posted

So far I'm only testing the Ground S Mode radar tags. What would I need to change for that?

spacer.png

ACCNL4 (Training Director) - Dutch VACC

Link to comment
Share on other sites

Thimo Koolen
Posted
Posted

Thanks for the hint Gergely, the RadarTarget variable works! Now I have to get an async network thread. Now Euroscope freezes all the time.

spacer.png

ACCNL4 (Training Director) - Dutch VACC

Link to comment
Share on other sites

  • 1 month later...
Gray Taylor 1041931
Posted
Posted

So I'm a little too exhausted to read through this entire thread, BUT, if it's worth anything, I was able to fashion our custom Data TAGs simply by modifying the EuroScope Font (TTF) file.

CAF838_CF_124_A_4720_9_FCC_AF62_EFF8_ED4_E.png
Link to comment
Share on other sites

 Share