Nasal modules: expose reload as a command
This commit is contained in:
parent
f23835a832
commit
7a3a36eab2
1 changed files with 14 additions and 0 deletions
|
@ -336,3 +336,17 @@ _setlistener("sim/signals/nasal-dir-initialized", func {
|
|||
MODULES_NODE = props.getNode("/nasal/modules", 1);
|
||||
_findModules();
|
||||
});
|
||||
|
||||
var commandModuleReload = func(node)
|
||||
{
|
||||
var module = node.getChild("module").getValue();
|
||||
var m = _getInstance(module);
|
||||
if (m == nil) {
|
||||
logprint(5, "Unknown module to reload: %s", module);
|
||||
return;
|
||||
}
|
||||
|
||||
m.reload();
|
||||
};
|
||||
|
||||
addcommand("nasal-module-reload", commandModuleReload);
|
Loading…
Add table
Reference in a new issue