Page 1 of 1

Creating alerts

Posted: Mon Apr 27, 2015 9:28 am
by manojpjoseph
Sir

I would like to get alerts when aircrafts reaches a certain distance from a pre defined location. Please tell how can I do this.
When the basestation database gets updated? Every change in position or level is recorded or the record is written after the movement is over?
Please advice.

Regards
Manoj

Re: Creating alerts

Posted: Mon Apr 27, 2015 9:18 pm
by agw
It depends on whether you know any programming languages, and which ones :) There is an item on the to-do list to add alerts to VRS but it's not high on the list of priorities.

The database record only holds the first and last position of the aircraft. I *think* the first position is written when the aircraft first transmits a location, the final position is not written until the aircraft has been out of range for about 25 minutes and the flight is flushed to disk. So that's not going to be suitable.

If you know one of the .NET languages then you can write a plugin that periodically looks through all of the aircraft lists that VRS is maintaining - one for each receiver and merged feed - and perform whatever action you want to perform when an aircraft first satisfies the alert condition. VRS has code that you can use to calculate the distance that each aircraft is from a given location.

If you know JavaScript then you can add a web page to the site that periodically fetches an aircraft list (or all of the aircraft lists) from the server and does the same thing. You can tell the server to calculate distances from any position when you fetch the aircraft list. However you would need to have the page open so that your JavaScript could keep running, either that or maybe you could write it using node.js and have that running in the background somewhere. The documentation on how to fetch an aircraft list, and how to interpret what the server sends to you, is here: http://www.virtualradarserver.co.uk/doc ... tList.aspx

Re: Creating alerts

Posted: Wed Apr 29, 2015 7:49 pm
by manojpjoseph
Dear Sir

Thank you so much for the reply.
I can write programs in vb.net. Like you said I will try to use the data from Aircraft.json. Can u tell me where this file is located. And also can you suggest a topic in the forum which discuss programming using the data from aircraft.json?

Thanks
Manoj

Re: Creating alerts

Posted: Thu Apr 30, 2015 12:29 am
by agw
You can just send a request to VRS at http://<IP address of machine running VRS>/VirtualRadar/AircraftList.json. You need to send a couple of query string parameters with the request to tell the server where you want to calculate distances from, the documentation tells you what to send.

This topic's fine for asking questions about AircraftList.json, no worries :)

Re: Creating alerts

Posted: Wed Jan 27, 2016 4:32 pm
by TurboCommander
I wonder if there's any progress on this or more likely, if I missed noticing it on an update? Are alerts available yet? I'm VERY interested in this.

Re: Creating alerts

Posted: Wed Jan 27, 2016 4:45 pm
by dsfh2992
No progress that I am aware of, but the suggestion above about using the JSON feed is a good one.

I'm sure the developer has lots of other stuff to work on. I am considering figuring out a way to add this to adsbexchange.com...

Re: Creating alerts

Posted: Thu Jan 28, 2016 12:21 am
by agw
No, no progress on it - I'm writing the web admin plugin at the moment. There was someone who wrote something to do alerts based on the feed from VRS though, he has a thread here:

http://forum.virtualradarserver.co.uk/v ... ?f=9&t=865