pierr3 / vSMR

EuroScope Plugin to simulate the NOVA 9000 A-SMGCS system on VATSIM
GNU General Public License v3.0
67 stars 27 forks source link

UK Controller Plugin Tag function/Items #81

Closed luke11brown closed 3 years ago

luke11brown commented 3 years ago

Hi Pierre, with UKCP now assigning stands, I'd like to request we can call those tag functions/items within vSMR.

Tag item/function id's available here.

https://github.com/VATSIM-UK/uk-controller-plugin/blob/master/docs/TAG_ITEMS.md https://github.com/VATSIM-UK/uk-controller-plugin/blob/master/docs/TAG_FUNCTIONS.md

Thanks, Luke

N95JPL commented 3 years ago

Now this would be good - Removes the need for using the Speed AS Gate option!

hpeter2 commented 3 years ago

There is no way I know of getting other plugin's data / items.

It would be possible to let users define what functions are called on Tag Item click, but I don't know if it would be useful, if that Item value isn't shown in the Tag

pierr3 commented 3 years ago

Indeed not possible in the current state of things. @AndyTWF would you be able to store the stand assignment in one of the flight strip free text box? (https://www.euroscope.hu/wp/flight-strip/). If I am not wrong, TopSky uses boxes 5 to 9, so I suggest using box 4. See the relevant function here: https://github.com/pierr3/vSMR/blob/61f873f7c355b4256d857abb8354f63a27e39064/lib/include/EuroScopePlugIn.h#L1648

TheoBearman commented 3 years ago

Can we not just hit the VATUK Controller API? As per the release notes, "stand data will be managed centrally on the UKCP API."

AndyTWF commented 3 years ago

Hi @hpeter2 @pierr3 ,

This is something that is possible through Windows messaging via hidden windows - which is what I used for communicating with the AFV standalone client for the AFV EuroScope bridge (https://github.com/AndyTWF/afv-euroscope-bridge).

If each plugin were to provide hidden windows, we can pass messages to each other: UKCP could tell vSMR when the tag item changes, vSMR could tell UKCP when its clicked to trigger the popup menus.

Happy to work with you on this, if you want to take the suggestion forward!

AndyTWF commented 3 years ago

@TheoBearman Unfortunately hitting the API wouldn't solve a lot of issues, UKCP connects to a websocket and listens for events in order to update stand assignments in the plugin: vSMR wouldn't be able to connect to this.

AndyTWF commented 3 years ago

Indeed not possible in the current state of things. @AndyTWF would you be able to store the stand assignment in one of the flight strip free text box? (https://www.euroscope.hu/wp/flight-strip/). If I am not wrong, TopSky uses boxes 5 to 9, so I suggest using box 4. See the relevant function here:

https://github.com/pierr3/vSMR/blob/61f873f7c355b4256d857abb8354f63a27e39064/lib/include/EuroScopePlugIn.h#L1648

Yes this would also be very possible if the box is not used by TopSky! Do you know if the annotations are shared between controllers or are they just local?

AndyTWF commented 3 years ago

I have updated UKCP so that it will annotate Box 4 with a stand allocation whenever they have been set.

https://github.com/VATSIM-UK/uk-controller-plugin/pull/174

Is vSMR able to update the annotations via its custom TAG items? If this is possible, then I can go a step further to monitor the annotations changing in order to update stand assignments.

hpeter2 commented 3 years ago

Does '9007 - Open Stand Assignment Selection Menu' create a overlaying menu that's usable as a Tag Item click function? We can easily call that function on-click of the Tag Item, which means we only need to read the value managed by your Plugin.

AndyTWF commented 3 years ago

Yes it toggles a ES popup menu, similar to 9008 which toggles one of the edit boxes :)

hpeter2 commented 3 years ago

Added and tested as read-only Tag-Item.

I only added a way to call the uk-controller-plugin Function on my vSMR version, because I don't see an easy way to implement that hardcoded.

Greets

pierr3 commented 3 years ago

Thanks @hpeter2 ! Merged the pull request, for the tag action we have no choice but to hardcode, but happy to do that as I supported hard coded implementation for vStrips previously anyway.

hpeter2 commented 3 years ago

@AndyTWF Just to complete the issue documentation, this vSMR feature will only work with a new uk-controller-plugin containing your merge request. https://github.com/VATSIM-UK/uk-controller-plugin/pull/174

AndyTWF commented 3 years ago

Fabulous, thank you both! I have just merged the latest version of UKCP (https://github.com/VATSIM-UK/uk-controller-plugin/releases/tag/2.5.1) :)

luke11brown commented 3 years ago

Working great! However, I'd like to request a small amendment.

If there is no stand set, can we display "NoGATE" similar to the other iterations?

Thanks for the quick work guys

hpeter2 commented 3 years ago

Working great! However, I'd like to request a small amendment.

If there is no stand set, can we display "NoGATE" similar to the other iterations?

Thanks for the quick work guys

Is this agreely wanted? I selected the value that the Tag Item of UKCP uses, when none is selected (which is empty string). I'd usually vote against inconsistent things. Why would the vSMR Item differ from the UKCP one?

luke11brown commented 3 years ago

That is the current behaviour with assigned speed and scratchpad so this should be the same? I believe the current behaviour is based on the simulation of the real system? So we should keep it the same where possible?

Current Behaviour: Using scratchpad string as gate - no entry returns "NoGATE" Using assigned speed as gate - no entry returns "NoGATE" Using "uk_stand" as gate - no entry returns no value

ref https://github.com/pierr3/vSMR/blob/3ffc02e5fd108ac431b04353f963de5c70976157/vSMR/SMRRadar.cpp#L1391-L1392

hpeter2 commented 3 years ago

@luke11brown I understand what you're saying, but this Item isn't managed by ourselves. Why shouldn't it be identical to the Plugin that manages the value?

pierr3 commented 3 years ago

That is slightly incorrect, the plugin also does the same for the gate data from scratchpad or a-speed. We should check whether there is any data in the flight strip box, if there isn't, we display the system default of NoGate, behaviour should be consistent across tag items which present similar information and we should also prevent UKCP from having to do unnecessary operations should as setting NoGate when no gate as been assigned, especially since the Flightstrip is part of EuroScope's logic and pushed to other controllers on handoff.

pierr3 commented 3 years ago

NoGate is now returned also for the uk_stand tag item

pierr3 commented 3 years ago

Just checking something, is the flight strip annotation pushed to other controllers? I know it is pushed to other controllers on handoff, but what about without handoffs? In practice, is the gate displayed in vSMR visible to all controllers at the moment?

luke11brown commented 3 years ago

Not sure, maybe @AndyTWF can confirm. However, I believe this will shortly be a non issue as the API will auto assign stands centrally, pushing to all controllers, where a manual change will also be noted/communicated outwith EuroScope. So, in theory, vSMR just has to read and Andy has doe all the hard work!

For reference: https://github.com/VATSIM-UK/uk-controller-api/pull/313

AndyTWF commented 3 years ago

Hi both,

Apologies I missed the notification for the last message.

Right now as long as both controllers are using UKCP, they will see each others stand assignments in vSMR. Although UKCP doesn't auto assign yet (it'll be done soon!), all allocations by controllers are central and broadcast to all controllers using the plugin :)

luke11brown commented 3 years ago

With the API now assigning squawks, this works as intended.

I suppose this issue can now be closed!

pierr3 commented 3 years ago

Great, thanks everyone!