CumulusUtils Runtime Library: Difference between revisions

m
no edit summary
mNo edit summary
 
== Functions ==
All functions are initialised including the timers and output will be displayed in the users website if a specific DIV with ana specific id is used e.g.
<pre><div id='#d3SunDisc'></div></pre>
will display the Sun disc and update it over the day.
 
The DIV id's will be shown under the specific caption, all functions below can be called by the user. If the specific DIV IDs does not exist in the website, that should not breakbe thea calling sequenceproblem.
 
==== Init function ====
$(function () {}
 
Call:
At load this function is executed and initialises the library by calling the following functions:
''$(function () {<arguments>} )''
 
At load time this function is executedcalled automatically and initialises the library by calling the following functions:
#''loadRealtimeTxt'' => initializes the loading of ''realtime.txt'' and distributes the values over the dashboard
#''RT_timer = setInterval(loadRealtimeTxt, 30 * 1000);'' => Initialize the timer interval timer for reading realtime.txt (see below)
#''DoGaugeSettings'' => initializes the settings for the gauges as defined within CUtils. Note that Cutils uses its own gauges library and css file.
#''worldClockZone'' => Initializes the clocks
#''LoadUtilsReport'' => It calls the initial report to load
 
==== loadRealtime.txt ====
 
Call:
No user call
 
This function is called automatically by the runtime system at the interval defined by the user in CMX (''Menu=>Internet Settings=>Interval Configuration=>Real time Interval Settings'').
 
The values are distributed to the DIVs with the (self-explaining) IDs:
''ajxCurTemp, ajxTempChange, ajxTempChangeIndicator, ajxTempMax, ajxTempMin, ajxCurPression, ajxBarChange, [...]'' etcetera... check the code.
 
The values get the configured change colour which is reset after 3 seconds.
 
=== DoGaugesSettings ===
 
Call:
This applies the gauges settings from ''cumulusutils.ini'' which requires the CUtils specific gauges.js
''DoGaugeSettings();''
 
This applies the gauges settings from ''cumulusutils.ini'' which requires the CUtils specific ''gauges.js''
Gauges which use the CMX gauges library are untouched.
 
=== worldClock ===
 
Call:
''worldClock(zone)''
 
Argument:
zone := The timezone difference from UTC
 
Returns:
string containing the time for the zone in the argument in format "hh:mm:ss"
 
 
The three clocks of CUtils are set by a summary function ''worldClockZone(zone)'' using the DIV IDs : ''CUClocktimeutc'', ''CUClocktimetz'' and ''CUClocktimeBrowser''
 
 
=== LoadUtilsReport ===
 
Call:
''LoadUtilsReport(string, bool);'' => Loads the intended report in the DIV with ID ''CUReportView''
 
Argument 1: The name of the report to load into DIV with ID: ''CUReportView''
Argument 2: Boolean (true/false) indicating the report will be refreshed after <interval> amount of minutes. Normally used for charts.
 
In principle any text can be loaded in the DIV with ID ''CUReportView'' but for proper formatting it requires HTML. It can contain any javascript if that is contained in <SCRIPT></SCRIPT tags.
 
=== CreateSun / CreateMoon ===
 
Call:
''CreateSun();''
''CreateMoon();''
 
These functions create the sun and the moon discs in the DIVs with the IDs ''d3SunDisc'' and ''d3MoonDisc'' respectively.