Push dev work to master #2

Merged
sixteenmillimeter merged 416 commits from dev into master 2018-07-19 15:29:02 +00:00
2 changed files with 8 additions and 14 deletions
Showing only changes of commit 8333f451f8 - Show all commits

View File

@ -304,11 +304,10 @@ function rSequence (req, res, next) {
} }
} }
if (intval._state.sequence && sequence._state.active) { if (intval._state.sequence && sequence._state.active) {
return sequence.setStop(() => { sequence.setStop()
intval._state.sequence = false intval._state.sequence = false
res.send({ stopped : true }) res.send({ stopped : true })
return next() return next()
})
} else { } else {
console.time('sequence time') console.time('sequence time')
intval._state.sequence = true intval._state.sequence = true
@ -488,10 +487,9 @@ function seq () {
if (intval._state.sequence && sequence._state.active) { if (intval._state.sequence && sequence._state.active) {
log.info('sequence', { method : 'release' , stop: true }) log.info('sequence', { method : 'release' , stop: true })
return sequence.setStop(() => { sequence.setStop()
intval._state.sequence = false intval._state.sequence = false
return cb() return cb()
})
} else { } else {
console.time('sequence time') console.time('sequence time')
log.info('sequence', { method : 'release', start : true }) log.info('sequence', { method : 'release', start : true })

View File

@ -43,9 +43,8 @@ sequence.start = function (options, cb) {
sequence.step() sequence.step()
} }
sequence.setStop = function (cb) { sequence.setStop = function () {
sequence._state.active = false sequence._state.active = false
sequence._state.input = cb
} }
sequence.stop = function () { sequence.stop = function () {
@ -58,10 +57,8 @@ sequence.stop = function () {
sequence._loop.arr = [] sequence._loop.arr = []
if (sequence._state.stop) sequence._state.stop() if (sequence._state.stop) sequence._state.stop()
if (sequence._state.input) sequence._state.input()
sequence._state.stop = null sequence._state.stop = null
sequence._state.input = null
} }
sequence.pause = function () { sequence.pause = function () {
@ -74,7 +71,6 @@ sequence.resume = function () {
} }
sequence.step = function () { sequence.step = function () {
log.info('step', `Started step ${sequence._state.count}`)
if (sequence._state.active && !sequence._state.paused) { if (sequence._state.active && !sequence._state.paused) {
if (sequence._state.arr.length > 0) { if (sequence._state.arr.length > 0) {
if (sequence._state.count > sequence._state.arr.length - 1) { if (sequence._state.count > sequence._state.arr.length - 1) {