Subversion Repositories HomeAutomation

Rev

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

Rev 1665 Rev 1740
Line 66... Line 66...
66
    this->io_service_.post(boost::bind(&Node::SlotOnNodeChangeHandler, this, node_id, available));
66
    this->io_service_.post(boost::bind(&Node::SlotOnNodeChangeHandler, this, node_id, available));
67
}
67
}
68
 
68
 
69
void Node::SlotOnNodeChangeHandler(control::Node::Id node_id, bool available)
69
void Node::SlotOnNodeChangeHandler(control::Node::Id node_id, bool available)
70
{
70
{
-
 
71
    v8::Locker lock;
71
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
72
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
72
   
73
   
73
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
74
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
74
   
75
   
75
    ArgumentListPointer arguments = ArgumentListPointer(new ArgumentList);
76
    ArgumentListPointer arguments = ArgumentListPointer(new ArgumentList);
Line 79... Line 80...
79
    this->Call(0, "Node_OnChange", arguments);
80
    this->Call(0, "Node_OnChange", arguments);
80
}
81
}
81
 
82
 
82
Value Node::Export_ResetNode(const v8::Arguments& args)
83
Value Node::Export_ResetNode(const v8::Arguments& args)
83
{
84
{
-
 
85
    v8::Locker lock;
84
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
86
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
85
   
87
   
86
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
88
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
87
   
89
   
88
    if (args.Length() < 1)
90
    if (args.Length() < 1)
Line 96... Line 98...
96
    return v8::Boolean::New(control::Manager::Instance()->ResetNode(*node_id));
98
    return v8::Boolean::New(control::Manager::Instance()->ResetNode(*node_id));
97
}
99
}
98
 
100
 
99
Value Node::Export_GetAvailableNodes(const v8::Arguments& args)
101
Value Node::Export_GetAvailableNodes(const v8::Arguments& args)
100
{
102
{
-
 
103
    v8::Locker lock;
101
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
104
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
102
   
105
   
103
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
106
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
104
   
107
   
105
    common::StringList available_nodes = control::Manager::Instance()->GetAvailableNodes();
108
    common::StringList available_nodes = control::Manager::Instance()->GetAvailableNodes();
Line 114... Line 117...
114
    return result;
117
    return result;
115
}
118
}
116
 
119
 
117
Value Node::Export_ProgramNode(const v8::Arguments& args)
120
Value Node::Export_ProgramNode(const v8::Arguments& args)
118
{
121
{
-
 
122
    v8::Locker lock;
119
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
123
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
120
   
124
   
121
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
125
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
122
   
126
   
123
    if (args.Length() < 3)
127
    if (args.Length() < 3)
Line 132... Line 136...
132
    return v8::Boolean::New(control::Manager::Instance()->ProgramNode(*node_id, args[1]->BooleanValue(), std::string(*filename)));
136
    return v8::Boolean::New(control::Manager::Instance()->ProgramNode(*node_id, args[1]->BooleanValue(), std::string(*filename)));
133
}
137
}
134
 
138
 
135
Value Node::Export_GetNodeInformation(const v8::Arguments& args)
139
Value Node::Export_GetNodeInformation(const v8::Arguments& args)
136
{
140
{
-
 
141
    v8::Locker lock;
137
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
142
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
138
   
143
   
139
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
144
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
140
   
145
   
141
    if (args.Length() < 1)
146
    if (args.Length() < 1)