Match exposure time to intval2 logic. Try a 5 second exposure time.

This commit is contained in:
mmcw-dev 2017-10-20 19:44:58 -04:00
parent 16f8675339
commit 43213cc6ce
2 changed files with 6 additions and 3 deletions

View File

@ -243,12 +243,15 @@ intval.setDir = function (val = true) {
return log.warn('Direction must be represented as either true or false')
}
intval._state.dir = val
log.info('setDir', { direction : dir ? 'forward' : 'backward' })
}
intval.setTime = function (val = 0) {
intval._state.frame.time = val
log.info('setTime', { time : val })
}
intval.setDelay = function (val = 0) {
intval._state.frame.delay = val
log.info('setDelay', { delay : val })
}
/**
* Begin a single frame with set variables or defaults
@ -284,9 +287,9 @@ intval.frame = function (dir = null, time = null) {
if (time !== null && time !== 0) {
setTimeout(intval._pause, intval._state.frame.open)
if (dir) {
setTimeout(intval._startFwd, 1000)
setTimeout(intval._startFwd, (time - intval._state.frame.open))
} else {
setTimeout(intval._startBwd, 1000)
setTimeout(intval._startBwd, (time - intval._state.frame.open))
}
}
}

View File

@ -4,4 +4,4 @@ const intval = require('../lib/intval')
intval.init()
intval.setTime(1000)
intval.setTime(5000)