Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Displaying Timestamp in realtime.txt, and centering the digital displays

Discussion of Mark Crossley's HTML5/Javascript gauges

Moderator: mcrossley

Post Reply
DJHarris
Posts: 6
Joined: Sat 27 Jun 2015 1:46 pm
Weather Station: WS3083
Operating System: Windows 8.1
Location: Exeter

Displaying Timestamp in realtime.txt, and centering the digital displays

Post by DJHarris »

Hello -

I had a look on this forum but couldn't find the answer to my questions easily, if Ive missed them please point me to the previous answers!

I've been making my own custom page with the SteelSeries gauges (which are excellent) - my questions are as described in the title:

1) How can I display the timestamp in realtimegauges.txt on my page? Currently I do not ask Cumulus to process gauges-ssT.htm (because I have no more lines left in the Files section!), and suspect that I could do it in there? But ideally, I'd like to take the timestamp (which is shown in the pop-up when you hover over the LED) and write it to the page when the gauges refresh (every 60 seconds).

2) Is there a way to configure the digital displays to write the digits to the centre of their windows? I had a good look through the gauges.js file but could not see this option easily available.

Many thanks in advance,
Dan :)
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Displaying Timestamp in realtime.txt, and centering the digital displays

Post by water01 »

The files section can handle 100 files so I doubt you have reached the limit, just the limit of the display. To add more, edit cumulus.ini (Cumulus must be closed) and scroll down to Files. Copy the last group (it will have 09 in the names) paste it underneath 09 and alter all the lines to 10 and set the appropriate setting (1 on 0 off etc.). You can keep doing this up to 99 :D .
David
Image
DJHarris
Posts: 6
Joined: Sat 27 Jun 2015 1:46 pm
Weather Station: WS3083
Operating System: Windows 8.1
Location: Exeter

Re: Displaying Timestamp in realtime.txt, and centering the digital displays

Post by DJHarris »

water01 wrote:The files section can handle 100 files so I doubt you have reached the limit, just the limit of the display. To add more, edit cumulus.ini (Cumulus must be closed) and scroll down to Files. Copy the last group (it will have 09 in the names) paste it underneath 09 and alter all the lines to 10 and set the appropriate setting (1 on 0 off etc.). You can keep doing this up to 99 :D .
Ah superb thanks David!
User avatar
mcrossley
Posts: 12692
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Displaying Timestamp in realtime.txt, and centering the digital displays

Post by mcrossley »

DJHarris wrote: 1) How can I display the timestamp in realtimegauges.txt on my page? Currently I do not ask Cumulus to process gauges-ssT.htm (because I have no more lines left in the Files section!), and suspect that I could do it in there? But ideally, I'd like to take the timestamp (which is shown in the pop-up when you hover over the LED) and write it to the page when the gauges refresh (every 60 seconds).
As David said, you can add extra files to Cumulus, but the smarter way of doing it would be to update a field on your page from the javascript every time it fetches a new version of realtimeGauges.txt.

Alternatively you could add it to the 'forecast' scroller text as I have done on my page. You just need to edit the realtimeGaugesT.txt file and put whatever tags you want in the 'forecast' field. eg

Code: Select all

"forecast":"<#date format=HH:mm> <#forecastenc>",
DJHarris wrote: 2) Is there a way to configure the digital displays to write the digits to the centre of their windows? I had a good look through the gauges.js file but could not see this option easily available.
No easy way, you would have to alter the underlying SteelSeries library - it is hard coded to right justify.
DJHarris
Posts: 6
Joined: Sat 27 Jun 2015 1:46 pm
Weather Station: WS3083
Operating System: Windows 8.1
Location: Exeter

Re: Displaying Timestamp in realtime.txt, and centering the digital displays

Post by DJHarris »

Hi Mark,

Thanks for your reply. I'll have a dig around in the js files and see what I can find... I've managed to move the numbers around but it's doesn't seem to be as easy as just setting it to "centred", the js calculates the distance from the right hand edge of the lcd display and thus to centre it will depend on how long the numbers are!

Anyway,, with regards to the timestamp, I'd like to take a field from the script and post it to the html page, as far as I can make out in the gauges.js file the time is stored in a data.date variable? But I don't really know how to write that to the screen. The way the code writes the gauges and the data to the screen seems a little bit magical to me. I tried a document.write type thing but no success. Are you able to point me in the right direction?

Thanks a lot for your help,
Dan
User avatar
mcrossley
Posts: 12692
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Displaying Timestamp in realtime.txt, and centering the digital displays

Post by mcrossley »

The key word is AJAX - using script to update page elements.

As you have JQuery loaded already it is dead easy. Define and element on your page that you want to update - say a DIV - and give it a unique id...

Code: Select all

<div id="myTime"></div>
Then in the script change the contents of your element after the data object has been updated...

Code: Select all

// time is held in data.date
$('#myTime').html(data.date);
DJHarris
Posts: 6
Joined: Sat 27 Jun 2015 1:46 pm
Weather Station: WS3083
Operating System: Windows 8.1
Location: Exeter

Re: Displaying Timestamp in realtime.txt, and centering the digital displays

Post by DJHarris »

Cool that actually worked, thanks Mark! Never used AJAX before in my life, I feel like I'm out of my depth here...

With regards to the centering, it wasn't too hard to do in the end, there are 3 or 4 textAlign="right" statements in the file steelseries_tween.min.js which have to be changed to textAlign="center", then you have to change ff+tr-tr*.05 to ff+tr-tr*.5 and lf+ur-ur*.05 to lf+ur-ur*.5 .

Although I just noticed that it's messed up the positioning of the forecast text - back to the drawing board! Very low priority stuff anyhow.

Thanks so much for your help Mark, PS I love your weather page. I was just trying to make a little display page with the gauges that could stand-alone and serve as an "always on" type display on an old tablet or something - you can see it here http://doubledeckerbus.asuscomm.com/Cum ... ges-ss.htm

Dan
User avatar
mcrossley
Posts: 12692
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Displaying Timestamp in realtime.txt, and centering the digital displays

Post by mcrossley »

Yep, a simple gauges page would be one good choice for a single page display.

Don't edit the steelseries_tween.min.js file, edit the uncompressed source files in the 'src' folder - it's much easier to see which lines you need to change. Then either recompress and combine the source files again, or change your page to load the two source files directly, if it is to be a 'static' display the page load time doesn't really matter.
Post Reply