Page 1 of 1
Webtag question
Posted: Wed 30 Jun 2010 7:53 am
by gwheelo
When using <#wdirdata> and <#wspdata> Are the most recent readings at the start of the list or at the end?
George Wheelock
http://www.wheelocknet.net/cumulus/wind.html?gb
Re: Webtag question
Posted: Fri 02 Jul 2010 10:17 pm
by mcrossley
Looking at my tags, the latest reading is first in the list, oldest last.
Mark
Re: Webtag question
Posted: Sat 03 Jul 2010 6:32 pm
by steve
They're "circular". From the help and the wiki:
<#wdirdata> Comma separated list of recent wind bearing readings (up to 3600 entries). This is a circular buffer; to find the most recent value use nextwindindex
<#wspddata> Comma separated list of recent wind speed readings (up to 3600 entries). This is a circular buffer; to find the most recent value use nextwindindex
<#nextwindindex> The index of the entries in wdirdata and wspddata which Cumulus is going to use next - i.e. the latest entry used is one less than this; but don't forget to allow for the wrap around!
Re: Webtag question
Posted: Sat 03 Jul 2010 10:24 pm
by gwheelo
Thanks Steve and Mark - I did see the Wiki info - but your dealing with an airhead. I don't fully understand "circular" file. I am assuming as new entries are added an entry is bumped off the other end - right? And then - I am not entirely certain how you add an entry - at the front of the list or the end.
Now for another naive question - are the entries added as they are received by the station, an internal Cumulus time, or as the data is processed for ftp? Or in other words what do up to 3600 entries represent in time. Am I making any sense?
Nice to have you back Steve - I hope it wasn't to big a chore to go to the "office."
GW
Re: Webtag question
Posted: Sun 04 Jul 2010 11:18 am
by steve
gwheelo wrote:Thanks Steve and Mark - I did see the Wiki info - but your dealing with an airhead. I don't fully understand "circular" file. I am assuming as new entries are added an entry is bumped off the other end - right? And then - I am not entirely certain how you add an entry - at the front of the list or the end.
It's a standard programming technique - it's the same way that the data loggers in weather stations work (but I know your doesn't have one). A new entry is added at the current position as held in <#nextwindindex>, overwriting what was there previously. When it gets to the end, it wraps around and starts at the beginning. This avoids having to shuffle all of the data along every time you add a new entry.
Now, I
could have made it so Cumulus copies the data for the web tag in chronological order, but the tag originally existed just to drive the 'wind rose' thing on the gauges page, where the order doesn't matter.
Now for another naive question - are the entries added as they are received by the station, an internal Cumulus time, or as the data is processed for ftp? Or in other words what do up to 3600 entries represent in time. Am I making any sense?
Each new reading is added, so the time represented varies depending on the interval that the station data is read (i.e. it is different for each station type). I can't remember what the interval is for your station; in this case Cumulus doesn't poll for the data, it just 'listens' and gets it at the frequuency decided by the station.
Originally, it was going to be an hour, I think, hence the 3600 (once a second) but in the end I just made it as it is now.
Nice to have you back Steve - I hope it wasn't to big a chore to go to the "office."
It's just a long, boring journey - around two days each way.
Re: Webtag question
Posted: Sun 04 Jul 2010 9:39 pm
by gwheelo
Thanks, Steve, now I understand it well enough to think I know how to use it.
I guess going to the "office" is a bit more than just taking the Ferry.
GW
Re: Webtag question
Posted: Sun 04 Jul 2010 10:17 pm
by steve
gwheelo wrote:I guess going to the "office" is a bit more than just taking the Ferry.
Each way: One car, two ferries, two buses, and three trains. My employers won't let me fly, even thought the total cost isn't significantly different. If they would, it would just be: One car, one bus, one train, and three planes. Oh well...