UI cleanup 1: confirm setting the exposure

This commit is contained in:
Matt McWilliams 2023-07-30 22:26:05 -04:00
parent dac720863d
commit 699c2dbec8
1 changed files with 13 additions and 3 deletions

View File

@ -91,13 +91,23 @@ cam.end = function (c, id, ms) {
} }
}; };
cam.exposure = function (exposure) { cam.exposure = async function (exposure) {
var obj = { var obj = {
id : uuid(), id : uuid(),
exposure exposure
}; };
var change = false;
try {
change = await gui.confirm(`Are you sure you want to set camera exposure to ${exposure}ms?`);
} catch (err) {
log.error(err);
}
if (change) {
log.info(`Setting exposure: ${exposure}`); log.info(`Setting exposure: ${exposure}`);
ipcRenderer.sendSync(cam.id, obj); ipcRenderer.sendSync(cam.id, obj);
} else {
timing.updateUI('#cam_time', timing.data['cam']);
}
} }
cam.listen = function () { cam.listen = function () {