Page 1 of 2

Virtual Davis VP2 console integration

Posted: Thu 11 Nov 2021 9:57 am
by AndyKF650
Following some research on other CUtils websites I wanted to add a virtual DavisVP2 console as an enhancement for my own local CUtils site. Initially I thought that it should be possible to do but I did not factor in the various trials and comparisons of scripts to find the final product, however I do have plenty of time. As ever Hans has been supportive of my efforts and gave some very useful coding and style tips.

The starting point for getting a virtual Davis console onto a CUtils site is the scripts folder on silveracorn.nz at https://silveracorn.nz/weather/wxscripts.php

There is a detailed how to set up the console within the download folder. I initially set up the virtual console as part of the CMX default website and then wasted time getting the CMX branding around the console, this proved to me that the virtual console worked and showed live data. I then linked this virtual console to CUtils through links in the CUsermenu, whilst this worked it was a bit clunky.

Following some advice from Hans I used an “iframe” to integrate the console into CUtils as follows:-
1. Create a davcon.txt file containing ” <iframe src="davconvp2CU.php" width="100%" frameborder="0" style="border:0;height:75vh;"></iframe> “.
2. The davcon.txt file was then added to the CUsermenu.txt using “ <span class='nav-link' onclick="LoadUtilsReport('davcon.txt');">Davis Console</span> ”

The result was a fully integrated virtual console on my CUtils site which looked much better, this was further enhanced by:-
1. Amending davconvp2CU.php to remove the attribution notes at the end of the page.
2. Amending davconvp2CU-inc.php to remove the content block which included the site name and coordinates.
3. Both the above amends got the virtual console cleanly integrated.

I have attached a screen shot of the current integrated virtual console and the two davcon php files for information.

Re: Virtual Davis VP2 console integration

Posted: Thu 11 Nov 2021 12:53 pm
by beteljuice
Hi Andy ...

Small niggle ..
Looking at the screenshot you don't seem to have styled the background and / or the <IFrame> ?

Well done on the integration :clap:

Re: Virtual Davis VP2 console integration

Posted: Thu 11 Nov 2021 4:03 pm
by AndyKF650
Hi @ Beteljuice

I am not quite sure about your niggle on the iframe but I have cleaned up the VP2 boarder in both the plain and lit versions as per the screen shots

Re: Virtual Davis VP2 console integration

Posted: Thu 11 Nov 2021 4:38 pm
by HansR
Thanks Andy, I really like it.
May do it some time myself :D

And btw, the colour choice of you looks really good with the Davis Console :!:

Re: Virtual Davis VP2 console integration

Posted: Thu 11 Nov 2021 6:28 pm
by PaulMy
Well done :clap: :clap:

Enjoy,
Paul

Re: Virtual Davis VP2 console integration

Posted: Thu 11 Nov 2021 10:34 pm
by beteljuice
... but I have cleaned up the VP2 boarder
Yup, that's what I was seeing, but you've you've lost your nice rounded edges. did you just crop the graphic ?

On the original screenshot it seems to be showing the grid pattern of what should be a transparent (image) background ?

Something wring with the image I think ?

Re: Virtual Davis VP2 console integration

Posted: Fri 12 Nov 2021 12:10 pm
by AndyKF650
@beteljuice

Yes you were correct I did crop the pic to cut out the white background. I have just reworked the png files to make them fit on my background to give a more pleasant interface.

Copies of the files and the current screen shot are attached.

Re: Virtual Davis VP2 console integration

Posted: Fri 12 Nov 2021 12:22 pm
by beteljuice
:clap: nuff said ...

Re: Virtual Davis VP2 console integration

Posted: Fri 12 Nov 2021 2:20 pm
by HansR
second that :clap:

Re: Virtual Davis VP2 console integration

Posted: Fri 12 Nov 2021 4:01 pm
by mcrossley
Looks good, but to make it more general purpose and work with any web page background, make the images backgrounds transparent, and the shadows a semi-transparent black.

Re: Virtual Davis VP2 console integration

Posted: Fri 12 Nov 2021 4:12 pm
by AndyKF650
Doh and I thought I was doing so well. :groan:

Re: Virtual Davis VP2 console integration

Posted: Fri 12 Nov 2021 9:27 pm
by beteljuice
That would have been the next 'gentle suggestion' (or a PM) - but Mark does like popping bubbles :lol:

That's the problem when you code for others - you become bitter and twisted :twisted:

:? :ugeek: :lol: :lol: :lol:

Re: Virtual Davis VP2 console integration

Posted: Sat 13 Nov 2021 12:01 pm
by AndyKF650
So having accepted the challenge to produce more generic versions of the Davis VP2 virtual consoles, I came up with the attached versions which hopefully will pass muster.

Of course the Davis Vue versions will need to be done at some point.

Re: Virtual Davis VP2 console integration

Posted: Sat 13 Nov 2021 12:02 pm
by mcrossley
:lol: :clap:

Re: Virtual Davis VP2 console integration

Posted: Sat 13 Nov 2021 7:27 pm
by BCJKiwi
Having difficulty understanding why there is this discussion on the images.

These are the current images as used in the MXUIwebsites.
vp2_console_lit.png
vp2_console.png