Rev 1741 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1741 | Rev 1887 | ||
|---|---|---|---|
| Line 37... | Line 37... | ||
| 37 | this->name_ = "node"; |
37 | this->name_ = "node"; |
| 38 | 38 | ||
| 39 | this->ExportFunction("NodeExport_ResetNode", Node::Export_ResetNode); |
39 | this->ExportFunction("NodeExport_ResetNode", Node::Export_ResetNode); |
| 40 | this->ExportFunction("NodeExport_GetAvailableNodes", Node::Export_GetAvailableNodes); |
40 | this->ExportFunction("NodeExport_GetAvailableNodes", Node::Export_GetAvailableNodes); |
| 41 | this->ExportFunction("NodeExport_ProgramNode", Node::Export_ProgramNode); |
41 | this->ExportFunction("NodeExport_ProgramNode", Node::Export_ProgramNode); |
| - | 42 | this->ExportFunction("NodeExport_ProgramNodeHex", Node::Export_ProgramNodeHex); |
|
| 42 | this->ExportFunction("NodeExport_GetNodeInformation",Node::Export_GetNodeInformation); |
43 | this->ExportFunction("NodeExport_GetNodeInformation",Node::Export_GetNodeInformation); |
| 43 | } |
44 | } |
| 44 | 45 | ||
| 45 | Node::~Node() |
46 | Node::~Node() |
| 46 | { |
47 | { |
| Line 136... | Line 137... | ||
| 136 | 137 | ||
| 137 | v8::String::AsciiValue node_id(args[0]); |
138 | v8::String::AsciiValue node_id(args[0]); |
| 138 | v8::String::AsciiValue filename(args[2]); |
139 | v8::String::AsciiValue filename(args[2]); |
| 139 | 140 | ||
| 140 | return handle_scope.Close(v8::Boolean::New(control::Manager::Instance()->ProgramNode(*node_id, args[1]->BooleanValue(), std::string(*filename)))); |
141 | return handle_scope.Close(v8::Boolean::New(control::Manager::Instance()->ProgramNode(*node_id, args[1]->BooleanValue(), std::string(*filename)))); |
| - | 142 | } |
|
| - | 143 | ||
| - | 144 | Value Node::Export_ProgramNodeHex(const v8::Arguments& args) |
|
| - | 145 | { |
|
| - | 146 | v8::Locker lock; |
|
| - | 147 | v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext()); |
|
| - | 148 | v8::HandleScope handle_scope; |
|
| - | 149 | ||
| - | 150 | //LOG.Debug(std::string(__FUNCTION__) + " called!"); |
|
| - | 151 | ||
| - | 152 | if (args.Length() < 3) |
|
| - | 153 | { |
|
| - | 154 | LOG.Error(std::string(__FUNCTION__) + ": To few arguments."); |
|
| - | 155 | return handle_scope.Close(v8::Boolean::New(false)); |
|
| - | 156 | } |
|
| - | 157 | ||
| - | 158 | v8::String::AsciiValue node_id(args[0]); |
|
| - | 159 | v8::String::AsciiValue hex_data(args[2]); |
|
| - | 160 | ||
| - | 161 | return handle_scope.Close(v8::Boolean::New(control::Manager::Instance()->ProgramNodeHex(*node_id, args[1]->BooleanValue(), std::string(*hex_data)))); |
|
| 141 | } |
162 | } |
| 142 | 163 | ||
| 143 | Value Node::Export_GetNodeInformation(const v8::Arguments& args) |
164 | Value Node::Export_GetNodeInformation(const v8::Arguments& args) |
| 144 | { |
165 | { |
| 145 | v8::Locker lock; |
166 | v8::Locker lock; |