Subversion Repositories HomeAutomation

Rev

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

Rev 973 Rev 974
Line 54... Line 54...
54
{
54
{
55
    this.myCallback = callback;
55
    this.myCallback = callback;
56
}
56
}
57
 
57
 
58
Interval.prototype.start = function()
58
Interval.prototype.start = function()
-
 
59
{
-
 
60
    if (!this.myIsRunning)
59
{
61
    {
60
    this.myIsRunning = true;
62
        this.myIsRunning = true;
61
    this.myId = startIntervalThread(this.myTimeout)
63
        this.myId = startIntervalThread(this.myTimeout)
62
    Interval.myIntervals[this.myId] = this;
64
        Interval.myIntervals[this.myId] = this;
-
 
65
    }
63
}
66
}
64
 
67
 
65
Interval.prototype.stop = function()
68
Interval.prototype.stop = function()
-
 
69
{
-
 
70
    if (this.myIsRunning)
66
{
71
    {
67
    this.myIsRunning = false;
72
        this.myIsRunning = false;
68
   
73
       
69
    if (!stopIntervalThread(this.myId))
74
        if (!stopIntervalThread(this.myId))
70
    {
75
        {
71
        log("Interval:" + this.myId + "> Interval thread could not be stopped.\n");
76
            log("Interval:" + this.myId + "> Interval thread could not be stopped.\n");
72
    }
77
        }
73
   
78
       
74
    delete Interval.myIntervals[this.myId];
79
        delete Interval.myIntervals[this.myId];
75
    this.myId = null;
80
        this.myId = null;
-
 
81
    }
76
}
82
}