mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
parent
ed2a45e975
commit
4588089bd6
@ -88,10 +88,11 @@ module.exports = function(RED) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var clearDelayList = function() {
|
var clearDelayList = function(s) {
|
||||||
for (var i=0; i<node.idList.length; i++ ) { node.idList[i].clear(); }
|
for (var i=0; i<node.idList.length; i++ ) { node.idList[i].clear(); }
|
||||||
node.idList = [];
|
node.idList = [];
|
||||||
node.status({text:"reset"});
|
if (s) { node.status({text:"reset"}); }
|
||||||
|
else { node.status({}); }
|
||||||
}
|
}
|
||||||
|
|
||||||
var flushDelayList = function() {
|
var flushDelayList = function() {
|
||||||
@ -124,7 +125,7 @@ module.exports = function(RED) {
|
|||||||
if ((node.timeout > 1000) && (node.idList.length !== 0)) {
|
if ((node.timeout > 1000) && (node.idList.length !== 0)) {
|
||||||
node.status({fill:"blue",shape:"dot",text:" "});
|
node.status({fill:"blue",shape:"dot",text:" "});
|
||||||
}
|
}
|
||||||
if (msg.hasOwnProperty("reset")) { clearDelayList(); }
|
if (msg.hasOwnProperty("reset")) { clearDelayList(true); }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
node.on("close", function() { clearDelayList(); });
|
node.on("close", function() { clearDelayList(); });
|
||||||
@ -145,7 +146,7 @@ module.exports = function(RED) {
|
|||||||
if ((delayvar >= 0) && (node.idList.length !== 0)) {
|
if ((delayvar >= 0) && (node.idList.length !== 0)) {
|
||||||
node.status({fill:"blue",shape:"dot",text:delayvar/1000+"s"});
|
node.status({fill:"blue",shape:"dot",text:delayvar/1000+"s"});
|
||||||
}
|
}
|
||||||
if (msg.hasOwnProperty("reset")) { clearDelayList(); }
|
if (msg.hasOwnProperty("reset")) { clearDelayList(true); }
|
||||||
if (msg.hasOwnProperty("flush")) { flushDelayList(); }
|
if (msg.hasOwnProperty("flush")) { flushDelayList(); }
|
||||||
});
|
});
|
||||||
node.on("close", function() { clearDelayList(); });
|
node.on("close", function() { clearDelayList(); });
|
||||||
@ -267,7 +268,7 @@ module.exports = function(RED) {
|
|||||||
if ((node.timeout >= 1000) && (node.idList.length !== 0)) {
|
if ((node.timeout >= 1000) && (node.idList.length !== 0)) {
|
||||||
node.status({fill:"blue",shape:"dot",text:parseInt(wait/10)/100+"s"});
|
node.status({fill:"blue",shape:"dot",text:parseInt(wait/10)/100+"s"});
|
||||||
}
|
}
|
||||||
if (msg.hasOwnProperty("reset")) { clearDelayList(); }
|
if (msg.hasOwnProperty("reset")) { clearDelayList(true); }
|
||||||
if (msg.hasOwnProperty("flush")) { flushDelayList(); }
|
if (msg.hasOwnProperty("flush")) { flushDelayList(); }
|
||||||
});
|
});
|
||||||
node.on("close", function() { clearDelayList(); });
|
node.on("close", function() { clearDelayList(); });
|
||||||
|
Loading…
Reference in New Issue
Block a user