No. I was wrong. Too much of a rewrite
This commit is contained in:
parent
3667c8dd36
commit
074d70510f
10
index.js
10
index.js
|
@ -149,7 +149,7 @@ function rDelay (req, res, next) {
|
||||||
if (set) {
|
if (set) {
|
||||||
intval.setDelay(delay)
|
intval.setDelay(delay)
|
||||||
} else {
|
} else {
|
||||||
delay = intval._state.delay
|
delay = intval._state.frame.delay
|
||||||
}
|
}
|
||||||
log.info('/delay', { method: req.method, set : set, delay : delay })
|
log.info('/delay', { method: req.method, set : set, delay : delay })
|
||||||
res.send({ delay : delay })
|
res.send({ delay : delay })
|
||||||
|
@ -252,8 +252,8 @@ async function rSequence (req, res, next) {
|
||||||
if (intval._state.frame.exposure !== 0) {
|
if (intval._state.frame.exposure !== 0) {
|
||||||
exposure = intval._state.frame.exposure
|
exposure = intval._state.frame.exposure
|
||||||
}
|
}
|
||||||
if (intval._state.delay !== 0) {
|
if (intval._state.frame.delay !== 0) {
|
||||||
options.delay = intval._state.delay
|
options.delay = intval._state.frame.delay
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.query && typeof req.query.dir !== 'undefined') {
|
if (req.query && typeof req.query.dir !== 'undefined') {
|
||||||
|
@ -495,8 +495,8 @@ function bSequence (obj, cb) {
|
||||||
if (intval._state.frame.exposure !== 0) {
|
if (intval._state.frame.exposure !== 0) {
|
||||||
exposure = intval._state.frame.exposure
|
exposure = intval._state.frame.exposure
|
||||||
}
|
}
|
||||||
if (intval._state.delay !== 0) {
|
if (intval._state.frame.delay !== 0) {
|
||||||
delay = intval._state.delay
|
delay = intval._state.frame.delay
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof obj.dir !== 'undefined') {
|
if (typeof obj.dir !== 'undefined') {
|
||||||
|
|
|
@ -142,10 +142,10 @@ class Intval {
|
||||||
active: false,
|
active: false,
|
||||||
paused: false,
|
paused: false,
|
||||||
exposure: 0,
|
exposure: 0,
|
||||||
|
delay: 0,
|
||||||
current: {},
|
current: {},
|
||||||
cb: () => { }
|
cb: () => { }
|
||||||
},
|
},
|
||||||
delay: 0,
|
|
||||||
counter: 0,
|
counter: 0,
|
||||||
sequence: false
|
sequence: false
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -47,7 +47,7 @@ class Sequence {
|
||||||
let len = typeof options.len !== 'undefined' ? options.len : MAX_INTEGER;
|
let len = typeof options.len !== 'undefined' ? options.len : MAX_INTEGER;
|
||||||
let multiple = typeof options.multiple !== 'undefined' ? options.multiple : 1;
|
let multiple = typeof options.multiple !== 'undefined' ? options.multiple : 1;
|
||||||
this.id = v4_1.default();
|
this.id = v4_1.default();
|
||||||
this.delay = typeof options.delay !== 'undefined' ? options.delay : this.intval._state.delay;
|
this.delay = typeof options.delay !== 'undefined' ? options.delay : this.intval._state.frame.delay;
|
||||||
this.count = 0;
|
this.count = 0;
|
||||||
this.active = true;
|
this.active = true;
|
||||||
log.info({ id: this.id, started: true });
|
log.info({ id: this.id, started: true });
|
||||||
|
|
|
@ -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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AAG,CAAC,IAAI,CAAC,EAAE,EAAE,EAAG,IAAI,CAAC,EAAE,EAAE,OAAO,EAAG,IAAI,EAAE,CAAC,CAAA;QAE1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;YAC7B,IAAI,QAAQ,GAAG,CAAC,EAAE;gBACjB,KAAK,IAAI,CAAC,GAAG,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,IAAI,EAAE,CAAA;IACZ,CAAC;CAYD;AAjFD,4BAiFC;AAED,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAA"}
|
|
@ -177,10 +177,10 @@ export default class Intval {
|
||||||
active : false, //should frame be running
|
active : false, //should frame be running
|
||||||
paused : false,
|
paused : false,
|
||||||
exposure : 0, //length of frame exposure, in ms
|
exposure : 0, //length of frame exposure, in ms
|
||||||
|
delay : 0, //delay before start of frame, in ms
|
||||||
current : {}, //current settings
|
current : {}, //current settings
|
||||||
cb : () => {}
|
cb : () => {}
|
||||||
},
|
},
|
||||||
delay : 0, //delay before start of frame, in ms
|
|
||||||
counter : 0,
|
counter : 0,
|
||||||
sequence : false
|
sequence : false
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ export class Sequence {
|
||||||
let multiple : number = typeof options.multiple !== 'undefined' ? options.multiple : 1
|
let multiple : number = typeof options.multiple !== 'undefined' ? options.multiple : 1
|
||||||
|
|
||||||
this.id = uuid()
|
this.id = uuid()
|
||||||
this.delay = typeof options.delay !== 'undefined' ? options.delay : this.intval._state.delay
|
this.delay = typeof options.delay !== 'undefined' ? options.delay : this.intval._state.frame.delay
|
||||||
this.count = 0
|
this.count = 0
|
||||||
this.active = true
|
this.active = true
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue