Log after frame is complete

This commit is contained in:
mmcw-dev 2017-10-21 12:21:15 -04:00
parent 9302cf1b21
commit 0b245a00c4
2 changed files with 6 additions and 6 deletions

View File

@ -121,11 +121,10 @@ function rDelay (req, res, next) {
function rFrame (req, res, next) {
log.info('/frame', { method : req.method })
intval.frame(true, 0, () => {
log.info('frame stopped')
})
res.send({})
intval.frame(true, 0, (dir, len) => {
res.send({ dir : true, len : len})
return next()
})
}
function rStatus (req, res, next) {

View File

@ -297,7 +297,6 @@ intval.frame = function (dir = null, time = null, cb = () => {}) {
}
if (time !== 0) {
intval._state.frame.paused = true
if (dir) {
setTimeout(intval._pause, intval._frame.open)
//log.info('frame', { pausing : time + intval._frame.open })
@ -314,7 +313,9 @@ intval.frame = function (dir = null, time = null, cb = () => {}) {
}, time + intval._frame.closed)
}
}
intval._state.frame.cb = cb
intval._state.frame.cb = (len) => {
cb(dir, len)
}
}
/**
* Start a sequence of frames, using defaults or explicit instructions