Subversion Repositories HomeAutomation

Rev

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

Rev 1651 Rev 1740
Line 70... Line 70...
70
    this->io_service_.post(boost::bind(&Timer::SlotOnTimeoutHandler, this, timer_id, repeat));
70
    this->io_service_.post(boost::bind(&Timer::SlotOnTimeoutHandler, this, timer_id, repeat));
71
}
71
}
72
 
72
 
73
void Timer::SlotOnTimeoutHandler(timer::TimerId timer_id, bool repeat)
73
void Timer::SlotOnTimeoutHandler(timer::TimerId timer_id, bool repeat)
74
{
74
{
-
 
75
    v8::Locker lock;
75
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
76
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
76
 
77
 
77
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
78
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
78
   
79
   
79
    if (!repeat)
80
    if (!repeat)
Line 93... Line 94...
93
    this->Call( timer_id, "Timer_OnTimeout",arguments);
94
    this->Call( timer_id, "Timer_OnTimeout",arguments);
94
}
95
}
95
 
96
 
96
Value Timer::Export_SetAlarm(const v8::Arguments& args)
97
Value Timer::Export_SetAlarm(const v8::Arguments& args)
97
{
98
{
-
 
99
    v8::Locker lock;
98
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
100
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
99
   
101
   
100
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
102
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
101
   
103
   
102
    if (args.Length() < 1)
104
    if (args.Length() < 1)
Line 114... Line 116...
114
    return v8::Integer::New(timer_id);
116
    return v8::Integer::New(timer_id);
115
}
117
}
116
 
118
 
117
Value Timer::Export_SetTimer(const v8::Arguments& args)
119
Value Timer::Export_SetTimer(const v8::Arguments& args)
118
{
120
{
-
 
121
    v8::Locker lock;
119
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
122
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
120
   
123
   
121
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
124
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
122
   
125
   
123
    if (args.Length() < 2)
126
    if (args.Length() < 2)
Line 133... Line 136...
133
    return v8::Integer::New(timer_id);
136
    return v8::Integer::New(timer_id);
134
}
137
}
135
 
138
 
136
Value Timer::Export_Cancel(const v8::Arguments& args)
139
Value Timer::Export_Cancel(const v8::Arguments& args)
137
{
140
{
-
 
141
    v8::Locker lock;
138
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
142
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
139
   
143
   
140
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
144
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
141
   
145
   
142
    if (args.Length() < 1)
146
    if (args.Length() < 1)
Line 156... Line 160...
156
    return v8::Undefined();
160
    return v8::Undefined();
157
}
161
}
158
 
162
 
159
Value Timer::Export_Sleep(const v8::Arguments& args)
163
Value Timer::Export_Sleep(const v8::Arguments& args)
160
{
164
{
-
 
165
    v8::Locker lock;
161
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
166
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
162
   
167
   
163
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
168
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
164
   
169
   
165
    if (args.Length() < 1)
170
    if (args.Length() < 1)