Bugs in 2.0.0

Is Virtual Radar Server not behaving itself? If so then please report it here.
sonicgoose
Posts: 25
Joined: Tue Jan 08, 2013 12:03 am
Location: Ontario, Canada
Contact:

Re: Bugs in 2.0.0

Post by sonicgoose » Thu Jan 09, 2014 5:06 pm

Having issues displaying aircraft pictures. I downloaded a large handful of jpegs and placed them in c:\Aircraft_Images, which I then selected in VRS 2 as the Pictures folder. No pictures showed up, despite the image names matching the registrations of the aircraft being plotted. I refreshed a few times, rebooted a few times, and lo and behold the pictures showed up...for a while, then they disappeared again and I can't get them to display at all anymore.

I've tried using Safari, Chrome, IE11 and Firefox whatever-version-it's-up-to-now all with no success. VRS is running on a Windows 7 32-bit machine. It displays operator flags and silhouettes ok, so I even tried moving my Aircraft_Images folder into c:\kinetic\basestation since I knew VRS could access images there; no luck.
Web: http://www.sonicgoose.com
Twitter: @blindedbtflash

Gyzmok
Posts: 7
Joined: Mon Apr 15, 2013 12:14 pm

Re: Bugs in 2.0.0

Post by Gyzmok » Thu Jan 09, 2014 5:44 pm

I have put the pictures in : C:\SBS-resources\Files\Pictures
naming example : OO-SSV.jpg
Have no problems (use Google Chrome to view)
http://78.23.150.177:8205/VirtualRadar/desktop.html

By the way : congrats on your site sonicgoose !

sonicgoose
Posts: 25
Joined: Tue Jan 08, 2013 12:03 am
Location: Ontario, Canada
Contact:

Re: Bugs in 2.0.0

Post by sonicgoose » Thu Jan 09, 2014 10:12 pm

Thanks, gyzmok. Nice range you've got there!

I've tried this again and managed to get one picture to appear despite several aircraft in the list having pictures available. As you can see in the attached screenshot, C-FTWJ has a picture available but it is not displaying in the list, nor does it display in the aircraft details window when the plane is selected in the list. I should also mention that in addition to the various browsers I've tried, I've also tried this on the same workstation as VRS (which is where the screenshot is from) as well as on my local network at home and across the Internet. Also, the one picture that did show up has the same "_128" suffix that C-FTWJ has.

Gyzmok, where do you get your pictures from?

Rob
Attachments
Screen Shot 2014-01-09 at 5.04.45 PM.png
Screen Shot 2014-01-09 at 5.04.45 PM.png (215.67 KiB) Viewed 4244 times
Web: http://www.sonicgoose.com
Twitter: @blindedbtflash

agw
Posts: 2248
Joined: Fri Feb 17, 2012 3:20 am

Re: Bugs in 2.0.0

Post by agw » Thu Jan 09, 2014 10:41 pm

The filename has to be the same as the ICAO or the registration, having a name that starts with a registration or ICAO isn't enough. So rather than C-FTWJ_128.jpg it has to be C-FTWJ.jpg.

There are mass renamers that can remove the trailing portion of a filename if you have tons of them that need changing. Alternatively you could download and install LINQPad (http://www.linqpad.net/), run it, change the language dropdown where it says "C# Expression" to "C# Statements" and paste in the following script:

Code: Select all

var folder = @"C:\path\to\your\pictures\here";

foreach(var fullPath in Directory.GetFiles(folder, "*.jpg")) {
    var fileName = Path.GetFileNameWithoutExtension(fullPath);
    var underscoreIndex = fileName.LastIndexOf("_128");
    if(underscoreIndex > -1) {
        fileName = fileName.Substring(0, underscoreIndex);
    
        var newFileName = Path.Combine(
            Path.GetDirectoryName(fullPath),
            String.Format("{0}{1}", fileName, Path.GetExtension(fullPath))
        );
        
        Console.WriteLine ("Renaming {0} to {1}", fullPath, Path.GetFileName(newFileName));
        File.Move(fullPath, newFileName);
    }
}
Change the folder on the first line to match the real location of your pictures (e.g. var folder = @"C:\aircraft_images";) and then press the play button or press F5. It'll strip everything from the last instance of "_128" from every JPG file in the folder. VRS should pick up the pictures within a few seconds of them being renamed.

agw
Posts: 2248
Joined: Fri Feb 17, 2012 3:20 am

Re: Bugs in 2.0.0

Post by agw » Thu Jan 09, 2014 10:43 pm

My guess is that the one that managed to display has an alternate version in the same folder without the trailing _128. You'll find out if you run the script, it'll stop with an exception on the File.Move line saying that there's already a file with the new name. You might want to change the script to make it check that the file doesn't already exist before it does the rename :) Change this line:

Code: Select all

File.Move(fullPath, newFileName);
to this:

Code: Select all

if(!File.Exists(newFileName)) File.Move(fullPath, newFileName);

sonicgoose
Posts: 25
Joined: Tue Jan 08, 2013 12:03 am
Location: Ontario, Canada
Contact:

Re: Bugs in 2.0.0

Post by sonicgoose » Thu Jan 09, 2014 10:57 pm

agw wrote:The filename has to be the same as the ICAO or the registration, having a name that starts with a registration or ICAO isn't enough. So rather than C-FTWJ_128.jpg it has to be C-FTWJ.jpg.

There are mass renamers that can remove the trailing portion of a filename if you have tons of them that need changing. Alternatively you could download and install LINQPad (http://www.linqpad.net/), run it, change the language dropdown where it says "C# Expression" to "C# Statements" and paste in the following script:

...

Change the folder on the first line to match the real location of your pictures (e.g. var folder = @"C:\aircraft_images";) and then press the play button or press F5. It'll strip everything from the last instance of "_128" from every JPG file in the folder. VRS should pick up the pictures within a few seconds of them being renamed.
How on Earth do you know so much?! I'll give that a whirl. Thanks.
Web: http://www.sonicgoose.com
Twitter: @blindedbtflash

sonicgoose
Posts: 25
Joined: Tue Jan 08, 2013 12:03 am
Location: Ontario, Canada
Contact:

Re: Bugs in 2.0.0

Post by sonicgoose » Thu Jan 09, 2014 11:30 pm

sonicgoose wrote:
agw wrote:The filename has to be the same as the ICAO or the registration, having a name that starts with a registration or ICAO isn't enough. So rather than C-FTWJ_128.jpg it has to be C-FTWJ.jpg.

There are mass renamers that can remove the trailing portion of a filename if you have tons of them that need changing. Alternatively you could download and install LINQPad (http://www.linqpad.net/), run it, change the language dropdown where it says "C# Expression" to "C# Statements" and paste in the following script:

...

Change the folder on the first line to match the real location of your pictures (e.g. var folder = @"C:\aircraft_images";) and then press the play button or press F5. It'll strip everything from the last instance of "_128" from every JPG file in the folder. VRS should pick up the pictures within a few seconds of them being renamed.
How on Earth do you know so much?! I'll give that a whirl. Thanks.
It worked! I think I need to find a new source for images, though, because running this all the time is going to be tricky. Thanks very much (as always) for your help.
Web: http://www.sonicgoose.com
Twitter: @blindedbtflash

agw
Posts: 2248
Joined: Fri Feb 17, 2012 3:20 am

Re: Bugs in 2.0.0

Post by agw » Fri Jan 10, 2014 1:22 am

sonicgoose wrote:It worked! I think I need to find a new source for images, though, because running this all the time is going to be tricky.
You can run LINQPad scripts from the command-line (c:\program files\LINQPad4\LPRun "<Full path to your script here>") so you could set up a Windows scheduled task to run it automatically every so often. However I think you mentioned previously about already having a bunch of images as GIFs but being unable to use them - I've since implemented support for GIF aircraft pictures (http://tracker.virtualradarserver.co.uk ... ab=History). If you're happy with GIFs, and if their filenames are in the correct format, then you just need to wait until the next release.

Gyzmok
Posts: 7
Joined: Mon Apr 15, 2013 12:14 pm

Re: Bugs in 2.0.0

Post by Gyzmok » Mon Jan 13, 2014 6:13 pm

@sonicgoose
Got most of my pictures from a zipped file : The link at the bottom of this thread :
http://forum.virtualradarserver.co.uk/v ... p?f=1&t=93

mezoo
Posts: 23
Joined: Sat Jan 04, 2014 6:32 pm

Wont open basestation.sqb - Disk I/O error

Post by mezoo » Tue Jan 14, 2014 7:43 pm

Not quite sure if this is not a local problem.

Every now and again when I start Virtual Radar I get a disk I/O error for basestation.sqb. VRS gives along error message and stops.
After I open and close basestation.sqb with SQLite Manager everything works perfectly.

Next time I will copy the error message here.

Has anybody else have this problem ?

mezoo

Locked