PCE Console display
Posted: Fri 04 Sep 2015 10:44 pm
Not sure where to post this but as the code I worked with was integrated into a Saratoga template, I'll post here.
Some time ago I was inspired by a Davis console display to create my own for my PCE-FWS 20.
I tried to adapt the code for the Davis console and, although I was able to generate something reasonable, I was stumped by fitting the wind direction arrow to an ellipse (on reflection, as the values are increments of 22.5 degrees, I could have just as easily used hard coded tables, rather than calculating variables) so I abandoned it.
Recently I revisited it and now it doesn't look too bad.
I have managed to separate the code so that it can be run standalone as well as in a Saratoga template.
In doing so, I hit another problem that nearly exhausted me in resolving it where the text in the standalone version was displaced from that when incorporated into the template. I eventually discovered that it was the css line-height: 1.5em on the main-body div in the standard Saratoga code that was causing the problem. I still haven't figured out why but removing it made little difference to any of my web pages and it resolved the problem.
Another problem is that the code I based it on was overly complex for what I needed and I am still in the process of getting rid of superfluous code/scripts. It uses two php scripts, one to handle retrieval of realtime.txt parameters and the other to consolidate them with a few extra parameters from an additional uploaded file. I should really consolidate the two. Also, there are several js scripts and I haven't identified which are now still necessary yet, lol!
A further problem is that although the overlaid text refreshes automatically (every 15 seconds), the additional things (wind arrow, barometer history) don't and I would like to fix that.
There are limitations, as it stands, e.g. it is only for Cumulus output (the Davis one catered for other software too), it is metric only, the barometer is relative, as opposed to absolute, and the pressure graph is fixed at 12 hours. Oh, the tendency image is based on the Zambretti forecast from Cumulus so it may not match that which is shown on the physical console.
I guess it could be adapted to similar consoles with a bit of Photoshop'ng on the base image.
Anyway... it still isn't in a reasonable state to publish but I would welcome comments.
You can see it standalone at...
http://www.jerbils.info/saratoga/pceconsole.php
and embedded into my weather home page at...
http://www.jerbils.info/saratoga/wxindex.php
also, in it's own webpage at...
http://www.jerbils.info/saratoga/wxdisplayPCE.php
although that isn't public yet.
Current version is at: http://www.jerbils.info/pceconsole%20(JD1-3).zip
Some time ago I was inspired by a Davis console display to create my own for my PCE-FWS 20.
I tried to adapt the code for the Davis console and, although I was able to generate something reasonable, I was stumped by fitting the wind direction arrow to an ellipse (on reflection, as the values are increments of 22.5 degrees, I could have just as easily used hard coded tables, rather than calculating variables) so I abandoned it.
Recently I revisited it and now it doesn't look too bad.
I have managed to separate the code so that it can be run standalone as well as in a Saratoga template.
In doing so, I hit another problem that nearly exhausted me in resolving it where the text in the standalone version was displaced from that when incorporated into the template. I eventually discovered that it was the css line-height: 1.5em on the main-body div in the standard Saratoga code that was causing the problem. I still haven't figured out why but removing it made little difference to any of my web pages and it resolved the problem.
Another problem is that the code I based it on was overly complex for what I needed and I am still in the process of getting rid of superfluous code/scripts. It uses two php scripts, one to handle retrieval of realtime.txt parameters and the other to consolidate them with a few extra parameters from an additional uploaded file. I should really consolidate the two. Also, there are several js scripts and I haven't identified which are now still necessary yet, lol!
A further problem is that although the overlaid text refreshes automatically (every 15 seconds), the additional things (wind arrow, barometer history) don't and I would like to fix that.
There are limitations, as it stands, e.g. it is only for Cumulus output (the Davis one catered for other software too), it is metric only, the barometer is relative, as opposed to absolute, and the pressure graph is fixed at 12 hours. Oh, the tendency image is based on the Zambretti forecast from Cumulus so it may not match that which is shown on the physical console.
I guess it could be adapted to similar consoles with a bit of Photoshop'ng on the base image.
Anyway... it still isn't in a reasonable state to publish but I would welcome comments.
You can see it standalone at...
http://www.jerbils.info/saratoga/pceconsole.php
and embedded into my weather home page at...
http://www.jerbils.info/saratoga/wxindex.php
also, in it's own webpage at...
http://www.jerbils.info/saratoga/wxdisplayPCE.php
although that isn't public yet.
Current version is at: http://www.jerbils.info/pceconsole%20(JD1-3).zip