Push dev work to master #2
|
@ -162,7 +162,7 @@ intval._stop = function () {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
intval._watchMicro = function (err, val) {
|
intval._watchMicro = function (err, val) {
|
||||||
const NOW = +new Date()
|
const now = +new Date()
|
||||||
if (err) {
|
if (err) {
|
||||||
log.error('_watchMicro', err)
|
log.error('_watchMicro', err)
|
||||||
}
|
}
|
||||||
|
@ -171,13 +171,13 @@ intval._watchMicro = function (err, val) {
|
||||||
if (val === 0 && intval._state.frame.active) {
|
if (val === 0 && intval._state.frame.active) {
|
||||||
if (!intval._state.micro.primed) {
|
if (!intval._state.micro.primed) {
|
||||||
intval._state.micro.primed = true
|
intval._state.micro.primed = true
|
||||||
intval._state.micro.exposure = NOW
|
intval._state.micro.time = now
|
||||||
//log.info('Microswitch primed to stop motor')
|
//log.info('Microswitch primed to stop motor')
|
||||||
}
|
}
|
||||||
} else if (val === 1 && intval._state.frame.active) {
|
} else if (val === 1 && intval._state.frame.active) {
|
||||||
if (intval._state.micro.primed && !intval._state.micro.paused) {
|
if (intval._state.micro.primed && !intval._state.micro.paused && (now - intval._state.frame.start) > intval._frame.open) {
|
||||||
intval._state.micro.primed = false
|
intval._state.micro.primed = false
|
||||||
intval._state.micro.exposure = 0
|
intval._state.micro.time = 0
|
||||||
//setTimeout( () => {
|
//setTimeout( () => {
|
||||||
intval._stop()
|
intval._stop()
|
||||||
//}, intval._microDelay)
|
//}, intval._microDelay)
|
||||||
|
|
Loading…
Reference in New Issue