Subversion Repositories HomeAutomation

Rev

Rev 1887 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1887 Rev 2164
Line 36... Line 36...
36
{
36
{
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_GetProgramProgress",Node::Export_GetProgramProgress);
41
    this->ExportFunction("NodeExport_ProgramNode",       Node::Export_ProgramNode);
42
    this->ExportFunction("NodeExport_ProgramNode",       Node::Export_ProgramNode);
42
    this->ExportFunction("NodeExport_ProgramNodeHex",    Node::Export_ProgramNodeHex);
43
    this->ExportFunction("NodeExport_ProgramNodeHex",    Node::Export_ProgramNodeHex);
43
    this->ExportFunction("NodeExport_GetNodeInformation",Node::Export_GetNodeInformation);
44
    this->ExportFunction("NodeExport_GetNodeInformation",Node::Export_GetNodeInformation);
44
}
45
}
45
 
46
 
Line 117... Line 118...
117
    {
118
    {
118
        result->Set(n, v8::String::New(available_nodes[n].data()));
119
        result->Set(n, v8::String::New(available_nodes[n].data()));
119
    }
120
    }
120
   
121
   
121
    return handle_scope.Close(result);
122
    return handle_scope.Close(result);
-
 
123
}
-
 
124
 
-
 
125
Value Node::Export_GetProgramProgress(const v8::Arguments& args)
-
 
126
{
-
 
127
    v8::Locker lock;
-
 
128
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
-
 
129
    v8::HandleScope handle_scope;
-
 
130
   
-
 
131
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
-
 
132
   
-
 
133
    if (args.Length() < 1)
-
 
134
    {
-
 
135
        LOG.Error(std::string(__FUNCTION__) + ": To few arguments.");
-
 
136
        return handle_scope.Close(v8::Uint32::New(255));
-
 
137
    }
-
 
138
   
-
 
139
    v8::String::AsciiValue node_id(args[0]);
-
 
140
   
-
 
141
    return handle_scope.Close(v8::Uint32::New(control::Manager::Instance()->GetProgramProgress(*node_id)));
-
 
142
   
-
 
143
    //return handle_scope.Close(v8::Boolean::New(control::Manager::Instance()->ProgramNode(*node_id, args[1]->BooleanValue(), std::string(*filename))));
122
}
144
}
123
 
145
 
124
Value Node::Export_ProgramNode(const v8::Arguments& args)
146
Value Node::Export_ProgramNode(const v8::Arguments& args)
125
{
147
{
126
    v8::Locker lock;
148
    v8::Locker lock;