From: Calin Crisan Date: Sun, 19 Jan 2014 09:51:30 +0000 (+0200) Subject: refreshing is disabled now for cameras whose config is being applied X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=2cb89fa1ac17b50d25589795cddbded5c671e42a;p=motioneye-debian refreshing is disabled now for cameras whose config is being applied --- diff --git a/src/v4l2ctl.py b/src/v4l2ctl.py index 1412ce9..9b6ff3e 100644 --- a/src/v4l2ctl.py +++ b/src/v4l2ctl.py @@ -102,6 +102,7 @@ def list_resolutions(device): resolutions.add((1280, 720)) resolutions.add((1280, 800)) resolutions.add((1280, 960)) + resolutions.add((1280, 1024)) resolutions.add((1366, 768)) resolutions.add((1440, 900)) resolutions.add((1680, 1050)) diff --git a/static/css/main.css b/static/css/main.css index ba1e8d3..d541c61 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -611,8 +611,8 @@ div.camera-frame-place-holder { div.modal-container div.camera-frame { width: auto; - padding: 3px; - margin: -10px; + padding: 0px; + margin: -7px; background-color: #414141; } diff --git a/static/js/main.js b/static/js/main.js index 2c74ce9..61e6147 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1,6 +1,6 @@ var pushConfigs = {}; -var refreshDisabled = 0; +var refreshDisabled = {}; /* dictionary indexed by cameraId, tells if refresh is disabled for a given camera */ var fullScreenCameraId = null; var thresholdSlider = null; var inProgress = false; @@ -856,8 +856,16 @@ function doApply() { }); beginProgress(affectedCameraIds); + affectedCameraIds.forEach(function (cameraId) { + refreshDisabled[cameraId] |= 0; + refreshDisabled[cameraId]++; + }); ajax('POST', '/config/0/set/', pushConfigs, function (data) { + affectedCameraIds.forEach(function (cameraId) { + refreshDisabled[cameraId]--; + }); + if (data == null || data.error) { endProgress(); showErrorMessage(data && data.error); @@ -883,8 +891,6 @@ function doApply() { pushConfigs = {}; endProgress(); - - //recreateCameraFrames(); }); } @@ -1090,10 +1096,11 @@ function pushPreview(control) { data.hue = hue; } - refreshDisabled++; + refreshDisabled[cameraId] |= 0; + refreshDisabled[cameraId]++; ajax('POST', '/config/' + cameraId + '/set_preview/', data, function (data) { - refreshDisabled--; + refreshDisabled[cameraId]--; if (data == null || data.error) { showErrorMessage(data && data.error); @@ -1782,7 +1789,7 @@ function addCameraFrameUi(cameraConfig, framerate) { cameraProgress.removeClass('visible'); }); cameraImg.load(function () { - if (refreshDisabled) { + if (refreshDisabled[cameraId]) { return; /* refresh temporarily disabled for updating */ } @@ -1861,7 +1868,7 @@ function doConfigureCamera(cameraId) { } function doFullScreenCamera(cameraId) { - if (inProgress) { + if (inProgress || refreshCameraFrames[cameraId]) { return; } @@ -1922,15 +1929,13 @@ function doFullScreenCamera(cameraId) { } function refreshCameraFrames() { - if (refreshDisabled) { - /* camera refreshing disabled, retry later */ - - setTimeout(refreshCameraFrames, 1000); - - return; - } - function refreshCameraFrame(cameraId, img, fast) { + if (refreshDisabled[cameraId]) { + /* camera refreshing disabled, retry later */ + + return; + } + if (img.loading) { img.loading++; /* increases each time the camera would refresh but is still loading */ @@ -2014,7 +2019,7 @@ $(document).ready(function () { /* software update button */ $('div#updateButton').click(doUpdate); - /* prevent scroll events on settings div from propagating TODO this does not work */ + /* prevent scroll events on settings div from propagating TODO this does not actually work */ $('div.settings').mousewheel(function (e, d) { var t = $(this); if (d > 0 && t.scrollTop() === 0) {