If exposure if over 5000ms, call back from ble service immediately and block UI until frame is done.

This commit is contained in:
mmcwilliams 2018-01-17 15:58:55 -05:00
parent 63eee43386
commit b8787c0fac
2 changed files with 24 additions and 5 deletions

View File

@ -171,9 +171,17 @@ mobile.frame = function () {
mobile.frameSuccess = function () { mobile.frameSuccess = function () {
console.log('Frame finished, getting state.'); console.log('Frame finished, getting state.');
if (STATE.exposure < 5000) {
mobile.ble.active = false; mobile.ble.active = false;
document.getElementById('frame').classList.remove('focus'); document.getElementById('frame').classList.remove('focus');
mobile.getState(); mobile.getState();
} else {
setTimeout(() => {
mobile.ble.active = false;
document.getElementById('frame').classList.remove('focus');
mobile.getState();
}, STATE.exposure + 500)
}
} }
mobile.setDir = function () { mobile.setDir = function () {
const opts = { const opts = {

View File

@ -363,9 +363,16 @@ function bFrame (obj, cb) {
} }
} }
log.info('frame', { method : 'ble', dir : dir, exposure : exposure }) log.info('frame', { method : 'ble', dir : dir, exposure : exposure })
if (exposure < 5000) {
intval.frame(dir, exposure, (len) => { intval.frame(dir, exposure, (len) => {
return cb() return cb()
}) })
} else {
intval.frame(dir, exposure, (len) => {})
return cb()
}
//setTimeout(cb, exposure === 0 ? 630 : exposure) //setTimeout(cb, exposure === 0 ? 630 : exposure)
} }
@ -485,6 +492,10 @@ function bSequence (obj, cb) {
} }
} }
function bSequenceStop (obj, cb) {
}
function bReset (obj, cb) { function bReset (obj, cb) {
intval.reset() intval.reset()
setTimeout(cb, 10) setTimeout(cb, 10)