Welcome to Radarspotting. Please login or sign up.

April 16, 2024, 06:36:51 PM

Login with username, password and session length

New Members

New Members

You should get an activation email when you join.  If not, please use the Contact option.

Getting markers right.

Started by MK2wx, August 15, 2017, 04:25:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MK2wx

Hello folks,

I have been seeing a fair few gliders of late, and found I really enjoy watching those.

I got a few that are Shark models and they give a readout of GLID, I think that might be the model type, or maybe it isn't. Anyway, they show up looking like gliders from a marker point of view. Looking in marker folder there is indeed a file for GLID, and a selected version of it too.

Another sort I see often is a Discus, and where the shark said GLID it says DISC. So, you just know I made copies of both GLID files, named them DISC, and rebooted. It does not have the desired effect, it still looks like a small Cessna!

So, does anyone know what I should mess with correct next in an attempt to have gliders of any given type show up with a decent wingspan and lose the dumpy prop powered snout?  ;)
Cheers,
Ian

Joolde

#1
https://forum.virtualradarserver.co.uk/viewtopic.php?f=9&t=1394
This topic on the VRS forum explains how VRS handles the aircraft markers. It points to a file called aircraftPlotter.ts where the files are defined.

On my computer this file is found in the folder C:\Program Files (x86)\VirtualRadar\Web\script\vrs

In my current VRS version (2.4.0) the aircraft marker part starts on line 190 of this file. If you scroll down a bit, you can find the following lines of code, where the glider type marker is defined.
        new VRS.AircraftMarker({
            normalFileName: 'Type-GLID.png',
            selectedFileName: 'Type-GLID-Selected.png',
            size: { width: 60, height: 60},
            matches: function(aircraft) { return aircraft.modelIcao.val === 'GLID'; }
        }),

This means the software returns a glider marker for any aircraft that matches ICAO code GLID (the ICAO code for gliders in general). To show this marker for other glider types, I think you can change the last line to:
            matches: function(aircraft) { return aircraft.modelIcao.val === 'GLID' || aircraft.modelIcao.val === 'DISC' || aircraft.modelIcao.val === 'AS25'; }
and you can expand this for every other glider ICAO code you come across (VENT, NIMB, DUOD, AS32 etc..)

NOTE: I didn't try this myself, so it might not work! Be careful and make backups :)
You might also have to refresh your browser cache before this works. Perhaps you also need to remove aircraftPlotter.js.txt and aircraftPlotter.js from the folder.

MK2wx

Thank you so very much indeed!

I saw the thread over at the other place, but did not really understand it.

You have made it a lot clearer for me and I shall have a read and re-read and see if I can pull this off. It is exactly the sort of thing I do badly, so I will indeed back it up first! I shall compose myself and wait until I am feeling quite brave first!  ;)

You never know, maybe over the next 24 hours that will happen!  ;D

Thanks again for your help!
Cheers,
Ian

MK2wx

Update:

Well in backing it up to my main Linux box, it got simple: I made a modified files folder, and using a much nicer editor than nano (that's nice but not as comfortable as gedit) I set those changes in place. ALL of them.  ;)

So because the gliders have gone for today, we can only wait and see as the days and gliders roll by. Fingers crossed. 8)

I wish there was a way to show only gliders, because the list filters do not go far enough in their options, so a "gliders only" tick box would be really nice and especially welcome.  ;)

Thanks again, we must now await to see if it works. I'll not delete any files just yet, I only had one of those you mentioned anyway. Since it allowed the .ts file to work with it at present then why might that not continue?

I guess there might be something I  am missing here?  :-\
Cheers,
Ian

Joolde

The reason why you might delete the .js files is because VRS compiles the .ts files to JavaScript (which your browser can read).
In the meantime I did some more research: I think you don't have to mess with files in the Program Files folder but you can use the Custom Content plugin. This thread has more info: https://forum.virtualradarserver.co.uk/viewtopic.php?f=11&t=805
Although I just tried it with a test marker for A320 type aircraft, but I didn't get it to work yet...

MK2wx

Quote from: Joolde on August 15, 2017, 09:16:45 PM
The reason why you might delete the .js files is because VRS compiles the .ts files to JavaScript (which your browser can read).
In the meantime I did some more research: I think you don't have to mess with files in the Program Files folder but you can use the Custom Content plugin. This thread has more info: https://forum.virtualradarserver.co.uk/viewtopic.php?f=11&t=805
Although I just tried it with a test marker for A320 type aircraft, but I didn't get it to work yet...

I did start to wonder if that compiling thing was the reason. Thanks for confirming it. I also don't appear to have any text files at all in that folder.

OK, well I shall leave it as it is for tonight, and see what happens tomorrow. If it works I'll let you know, and if you get the other one to work then we can swap notes. If this one does not work I'll maybe delete the JS file and reboot, to see if that makes it all happen. :)
Cheers,
Ian

MK2wx

OK, I can now confirm that after deletion, the "js" file was not regenerated from the "ts" file. I rebooted and ran it from scratch, so that should have got it if anything would.

Also that adding the extra values in the ts did not result in any changes to the markers seen.

So it looks like this method probably does not work. (setting aside any browser cache possibilities of course).

Oh well, let's hope the other method can work.  ;)
Cheers,
Ian