Make a new public sequence.stop method to prevent double logging

This commit is contained in:
mmcwilliams 2019-10-30 23:58:06 -04:00
parent 074d70510f
commit 6ac19c2dd8
3 changed files with 17 additions and 5 deletions

View File

@ -21,7 +21,7 @@ class Sequence {
/**
* Stop a running sequence and reset counter and delay
**/
this.stop = function () {
this._stop = function () {
this.active = false;
this.count = 0;
this.delay = 0;
@ -71,7 +71,13 @@ class Sequence {
break;
}
}
this.stop();
this._stop();
}
/**
* Public method to stop a sequence from the web or ble interface
**/
stop() {
this.active = false;
}
}
exports.Sequence = Sequence;

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sequence/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;;;;AAEZ,iDAA2B;AAC3B,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;AACrC,oCAAiC;AAEjC,MAAM,WAAW,GAAG,UAAU,CAAC;AAc/B,+BAA+B;AAC/B,MAAa,QAAQ;IAUpB;;;;QAII;IAEJ,YAAa,MAAY;QAbjB,WAAM,GAAa,KAAK,CAAA;QAExB,UAAK,GAAY,CAAC,CAAA;QAClB,UAAK,GAAY,CAAC,CAAA;QAiE1B;;YAEI;QACG,SAAI,GAAG;YACb,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;YACnB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;YACd,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;YAEd,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,EAAG,IAAI,CAAC,EAAE,EAAE,OAAO,EAAG,IAAI,EAAE,CAAC,CAAA;QACpD,CAAC,CAAA;QA/DA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG;YACtB,IAAI,IAAI,CAAC,MAAM,EAAE;gBAChB,IAAI,CAAC,IAAI,EAAE,CAAA;gBACX,OAAO,KAAK,CAAA;aAC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AG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE;oBAClC,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAA;oBACzB,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,EAAG,IAAI,CAAC,EAAE,EAAE,KAAK,EAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;oBACvD,IAAI,CAAC,KAAK,EAAE,CAAA;iBACZ;aACD;iBAAM;gBACN,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAA;gBACzB,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,EAAG,IAAI,CAAC,EAAE,EAAE,KAAK,EAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;gBACvD,IAAI,CAAC,KAAK,EAAE,CAAA;aACZ;YAGD,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,EAAE;gBAClC,MAAM,aAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;aACvB;YAED,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;gBACjB,MAAK;aACL;SACD;QAED,IAAI,CAAC,KAAK,EAAE,CAAA;IACb,CAAC;IACD;;QAEI;IACG,IAAI;QACV,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;IACpB,CAAC;CAYD;AAvFD,4BAuFC;AAED,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAA"}

View File

@ -87,13 +87,19 @@ export class Sequence {
}
}
this.stop()
this._stop()
}
/**
* Public method to stop a sequence from the web or ble interface
**/
public stop () {
this.active = false
}
/**
* Stop a running sequence and reset counter and delay
**/
public stop = function () {
private _stop = function () {
this.active = false
this.count = 0
this.delay = 0