Subversion Repositories HomeAutomation

Rev

Rev 2047 | Rev 2141 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 2047 Rev 2048
Line 1... Line 1...
1
function RRD_Tool() {Log("\033[31mCall to RRD_Tool() can be removed from autostart.js!\033[0m\n");}
1
function RRD_Tool() {Log("\033[31mCall to RRD_Tool() can be removed from autostart.js!\033[0m\n");}
2
 
2
 
-
 
3
/* Declaration of static variables */
3
RRD_Tool_Init();
4
RRD_Tool_myInterval = null;
4
function RRD_Tool_Init()
5
RRD_Tool_StoredData = null;
5
{
-
 
6
    /* We must always call the parent constructor, initialization
-
 
7
       of variables could be done here, but initialize is a better place */
-
 
8
    var self = this;
6
RRD_Tool_Timers = null;
9
   
-
 
10
    /* Constant config name */
7
/* Constant config name */
11
    RRD_Tool_Config = "RRD_Tool_config";
8
RRD_Tool_Config = "RRD_Tool_config";
-
 
9
 
-
 
10
function RRD_Tool_Init()
12
   
11
{
13
    //Log("\033[33mRRD Tool updater starting...\033[0m");
12
    //Log("\033[33mRRD Tool updater starting...\033[0m");
14
   
13
   
15
    var last_value_string = Storage_GetParameters(RRD_Tool_Config);
14
    var last_value_string = Storage_GetParameters(RRD_Tool_Config);
16
    RRD_Tool_StoredData = new Array();
15
    RRD_Tool_StoredData = new Array();
17
    RRD_Tool_Timers = new Array();
16
    RRD_Tool_Timers = new Array();
Line 22... Line 21...
22
        RRD_Tool_Timers[name] = Timer_SetTimer(function(timer) {RRD_Tool_timerUpdate(timer)}, RRD_Tool_StoredData[name]["rrd"]["Period_s"]*1000, true);
21
        RRD_Tool_Timers[name] = Timer_SetTimer(function(timer) {RRD_Tool_timerUpdate(timer)}, RRD_Tool_StoredData[name]["rrd"]["Period_s"]*1000, true);
23
    }
22
    }
24
    //Log("\033[33mRRD Tool updater created.\033[0m");
23
    //Log("\033[33mRRD Tool updater created.\033[0m");
25
}
24
}
26
 
25
 
27
/* Declaration of static variables */
-
 
28
RRD_Tool_myInterval = null;
-
 
29
RRD_Tool_StoredData = null;
-
 
30
RRD_Tool_Timers = null;
-
 
31
RRD_Tool_Config = null;
26
RRD_Tool_Init();
32
 
27
 
33
RRD_Tool_timerUpdate = function(timer)
28
RRD_Tool_timerUpdate = function(timer)
34
{
29
{
35
    var alias_string = Storage_GetParameters("LastValues");
30
    var alias_string = Storage_GetParameters("LastValues");
36
    for (var name in RRD_Tool_Timers)
31
    for (var name in RRD_Tool_Timers)