NLS status text in editor not runtime

This commit is contained in:
Nick O'Leary
2015-07-01 23:02:50 +01:00
parent fbccf01933
commit 726069bc4b
5 changed files with 36 additions and 33 deletions

View File

@@ -67,7 +67,7 @@ module.exports = function(RED) {
node.child = spawn(gpioCommand, ["in",node.pin,node.intype]);
}
node.running = true;
node.status({fill:"green",shape:"dot",text:RED._("common.status.ok")});
node.status({fill:"green",shape:"dot",text:"common.status.ok"});
node.child.stdout.on('data', function (data) {
data = data.toString().trim();
@@ -90,10 +90,10 @@ module.exports = function(RED) {
node.running = false;
if (RED.settings.verbose) { node.log(RED._("rpi-gpio.status.closed")); }
if (node.done) {
node.status({fill:"grey",shape:"ring",text:RED._("rpi-gpio.status.closed")});
node.status({fill:"grey",shape:"ring",text:"rpi-gpio.status.closed"});
node.done();
}
else { node.status({fill:"red",shape:"ring",text:RED._("rpi-gpio.status.stopped")}); }
else { node.status({fill:"red",shape:"ring",text:"rpi-gpio.status.stopped"}); }
});
node.child.on('error', function (err) {
@@ -108,7 +108,7 @@ module.exports = function(RED) {
}
node.on("close", function(done) {
node.status({fill:"grey",shape:"ring",text:RED._("rpi-gpio.status.closed")});
node.status({fill:"grey",shape:"ring",text:"rpi-gpio.status.closed"});
delete pinsInUse[node.pin];
if (node.child != null) {
node.done = done;
@@ -151,7 +151,7 @@ module.exports = function(RED) {
}
else {
node.error(RED._("rpi-gpio.errors.pythoncommandnotfound"),msg);
node.status({fill:"red",shape:"ring",text:RED._("rpi-gpio.status.not-running")});
node.status({fill:"red",shape:"ring",text:"rpi-gpio.status.not-running"});
}
}
else { node.warn(RED._("rpi-gpio.errors.invalidinput")+": "+out); }
@@ -164,7 +164,7 @@ module.exports = function(RED) {
node.child = spawn(gpioCommand, [node.out,node.pin]);
}
node.running = true;
node.status({fill:"green",shape:"dot",text:RED._("common.status.ok")});
node.status({fill:"green",shape:"dot",text:"common.status.ok"});
node.on("input", inputlistener);
@@ -181,10 +181,10 @@ module.exports = function(RED) {
node.running = false;
if (RED.settings.verbose) { node.log(RED._("rpi-gpio.status.closed")); }
if (node.done) {
node.status({fill:"grey",shape:"ring",text:RED._("rpi-gpio.status.closed")});
node.status({fill:"grey",shape:"ring",text:"rpi-gpio.status.closed"});
node.done();
}
else { node.status({fill:"red",shape:"ring",text:RED._("rpi-gpio.status.stopped")}); }
else { node.status({fill:"red",shape:"ring",text:"rpi-gpio.status.stopped"}); }
});
node.child.on('error', function (err) {
@@ -199,7 +199,7 @@ module.exports = function(RED) {
}
node.on("close", function(done) {
node.status({fill:"grey",shape:"ring",text:RED._("rpi-gpio.status.closed")});
node.status({fill:"grey",shape:"ring",text:"rpi-gpio.status.closed"});
delete pinsInUse[node.pin];
if (node.child != null) {
node.done = done;
@@ -232,7 +232,7 @@ module.exports = function(RED) {
var node = this;
node.child = spawn(gpioCommand+".py", ["mouse",node.butt]);
node.status({fill:"green",shape:"dot",text:RED._("common.status.ok")});
node.status({fill:"green",shape:"dot",text:"common.status.ok"});
node.child.stdout.on('data', function (data) {
data = Number(data);
@@ -249,10 +249,10 @@ module.exports = function(RED) {
node.running = false;
if (RED.settings.verbose) { node.log(RED._("rpi-gpio.status.closed")); }
if (node.done) {
node.status({fill:"grey",shape:"ring",text:RED._("rpi-gpio.status.closed")});
node.status({fill:"grey",shape:"ring",text:"rpi-gpio.status.closed"});
node.done();
}
else { node.status({fill:"red",shape:"ring",text:RED._("rpi-gpio.status.stopped")}); }
else { node.status({fill:"red",shape:"ring",text:"rpi-gpio.status.stopped"}); }
});
node.child.on('error', function (err) {
@@ -262,7 +262,7 @@ module.exports = function(RED) {
});
node.on("close", function(done) {
node.status({fill:"grey",shape:"ring",text:RED._("rpi-gpio.status.closed")});
node.status({fill:"grey",shape:"ring",text:"rpi-gpio.status.closed"});
if (node.child != null) {
node.done = done;
node.child.kill('SIGINT');