Page 1 of 1

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

Posted: Tue 28 Nov 2017 1:55 pm
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 :)

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

Posted: Tue 28 Nov 2017 2:31 pm
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 .

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

Posted: Tue 28 Nov 2017 2:58 pm
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!

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

Posted: Tue 28 Nov 2017 3:00 pm
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.

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

Posted: Tue 28 Nov 2017 9:02 pm
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

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

Posted: Tue 28 Nov 2017 9:14 pm
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);

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

Posted: Tue 28 Nov 2017 9:33 pm
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

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

Posted: Tue 28 Nov 2017 10:14 pm
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.