Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UK Controller Plugin Tag function/Items #81

Closed
luke11brown opened this issue Oct 1, 2020 · 25 comments
Closed

UK Controller Plugin Tag function/Items #81

luke11brown opened this issue Oct 1, 2020 · 25 comments

Comments

@luke11brown
Copy link

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
Copy link

N95JPL commented Oct 1, 2020

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

@hpeter2
Copy link
Contributor

hpeter2 commented Oct 2, 2020

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
Copy link
Owner

pierr3 commented Oct 2, 2020

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:

bool SetFlightStripAnnotation ( int Index,

@TheoBearman
Copy link
Collaborator

TheoBearman commented Oct 2, 2020

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
Copy link

AndyTWF commented Oct 2, 2020

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
Copy link

AndyTWF commented Oct 2, 2020

@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
Copy link

AndyTWF commented Oct 2, 2020

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:

bool SetFlightStripAnnotation ( int Index,

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
Copy link

AndyTWF commented Oct 3, 2020

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

VATSIM-UK/uk-controller-plugin#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
Copy link
Contributor

hpeter2 commented Oct 3, 2020

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
Copy link

AndyTWF commented Oct 3, 2020

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

@hpeter2
Copy link
Contributor

hpeter2 commented Oct 3, 2020

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
Copy link
Owner

pierr3 commented Oct 3, 2020

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
Copy link
Contributor

hpeter2 commented Oct 3, 2020

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

@AndyTWF
Copy link

AndyTWF commented Oct 4, 2020

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
Copy link
Author

luke11brown commented Oct 5, 2020

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
Copy link
Contributor

hpeter2 commented Oct 5, 2020

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
Copy link
Author

luke11brown commented Oct 5, 2020

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

vSMR/vSMR/SMRRadar.cpp

Lines 1391 to 1392 in 3ffc02e

if (gate.size() == 0 || gate == "0" || !isAcCorrelated)
gate = "NoGATE";

@hpeter2
Copy link
Contributor

hpeter2 commented Oct 7, 2020

@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
Copy link
Owner

pierr3 commented Oct 7, 2020

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
Copy link
Owner

pierr3 commented Oct 28, 2020

NoGate is now returned also for the uk_stand tag item

@pierr3
Copy link
Owner

pierr3 commented Oct 29, 2020

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
Copy link
Author

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: VATSIM-UK/uk-controller-api#313

@AndyTWF
Copy link

AndyTWF commented Dec 1, 2020

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
Copy link
Author

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

I suppose this issue can now be closed!

@pierr3
Copy link
Owner

pierr3 commented Jan 2, 2021

Great, thanks everyone!

@pierr3 pierr3 closed this as completed Jan 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants