5,838
edits
No edit summary |
|||
{{AddOnBanner|name=Annual Data Summary|type=HTML & Javascript|author=David Jamieson|contact=[[User:Daj|DAJ]]
'''An updated article, that supercedes this one is called [[Daily_Summary]]'''
'Annual Data Summary' is a small tool to read the [[dayfile.txt]] produced by Cumulus and summarise this in a table, arranged like a calendar, showing a full years worth of a selected field such as maximum daily temperature.
Change as needed, save and test
= Usage =
<span style="color: red">so to add a new one, copy that line and paste it in again but in this new line replace 'mintemp' with whatever you have added as the first element in your new array row, replace '[1]' with square brackets round the number of your new array row (the first row is number zero) and finally replace '4' with the [[Dayfile.txt#List_of_fields_in_the_file|field number]] where the parameter you have added is found in dayfile.txt.</span>
== Styling
The table styling is completely configurable using the included datasummary.css [[Stylesheet]]. By default it is using similar colours to the standard Cumulus website. Below are a few of the key entries to consider when adjusting settings (typically colouring)... Also see [http://sandaysoft.com/forum/viewtopic.php?f=14&t=5319 support forum thread about colouring with php]
*In version 1.1 of this tool, jQuery version 1.5 is called, this permitted use of '.attr' object to add/remove the highlight; from jQuery version 1.6 that was deprecated and the '.prop' object is now specified for the same purpose.
*Version 1.0 and 1.1 default to showing a table for viewer's local current calendar year. Remember the dayfile.txt (even if updated each day) only contains records up to the day ending at the last rollover time using the timezone local to the weather station. Timezone differences when combined with rollover time variations can lead to a period of 2 days discrepancy. At New Year a blank table will be displayed during this period by default. For example, 30 or 31 (depending on whether rollover has occured) in December of the last year could be the latest available for a site in USA whilst the original version of the code is showing a blank table of the next year during early morning on 2 January in Austrailia. Even when station and viewer are in same timezone, there will be a blank table until the first rollover on 2 January.
*The final field on each row is not read correctly, because the row break has been specified wrongly for a Microsoft Windows environment, it should quote '''fdata.split("\r\n");''' i.e. ''defines that carriage return then line feed (newline) used to split daily observations in dayfile''. Because the script presented here only processes a small number of fields from earlier in the row, this error does not affect the output for the published code.
= Version Control =
1.1 PHP version included with JavaScript version in new download package
|
edits