]> www.vanbest.org Git - motioneye-debian/commitdiff
"sluginess" is not a word; empty mask fixes
authorCalin Crisan <ccrisan@gmail.com>
Thu, 3 Nov 2016 11:53:41 +0000 (13:53 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Thu, 3 Nov 2016 11:53:41 +0000 (13:53 +0200)
motioneye/config.py
motioneye/static/js/main.js
motioneye/templates/main.html
motioneye/utils.py

index 40f7c0c58b460fef77cbd32710c9045285733164..45b3c3e040eb57763f3e1972a9b3d7c32cb482d8 100644 (file)
@@ -886,7 +886,7 @@ def motion_camera_ui_to_dict(ui, old_config=None):
 
     if ui['mask']:
         if ui['mask_type'] == 'smart':
-            data['smart_mask_speed'] = 10 - int(ui['smart_mask_slugginess'])
+            data['smart_mask_speed'] = 10 - int(ui['smart_mask_sluggishness'])
 
         elif ui['mask_type'] == 'editable':
             data['mask_file'] = utils.build_editable_mask_file(old_config['@id'], ui['mask_lines'], data.get('width'), data.get('height'))
@@ -1073,7 +1073,7 @@ def motion_camera_dict_to_ui(data):
         'minimum_motion_frames': int(data['minimum_motion_frames']),
         'mask': False,
         'mask_type': 'smart',
-        'smart_mask_slugginess': 5,
+        'smart_mask_sluggishness': 5,
         'mask_lines': [],
         
         # motion notifications
@@ -1274,7 +1274,7 @@ def motion_camera_dict_to_ui(data):
     elif data['smart_mask_speed']:
         ui['mask'] = True
         ui['mask_type'] = 'smart'
-        ui['smart_mask_slugginess'] = 10 - data['smart_mask_speed']
+        ui['smart_mask_sluggishness'] = 10 - data['smart_mask_speed']
 
     # working schedule
     working_schedule = data['@working_schedule']
index 52aff3cc18748d8a2b3b16cd8988d27d1d1a9674..ab2b0030298b08c3617cb5a50be5f10a0da4a165 100644 (file)
@@ -1869,7 +1869,7 @@ function cameraUi2Dict() {
         'minimum_motion_frames': $('#minimumMotionFramesEntry').val(),
         'mask': $('#maskSwitch')[0].checked,
         'mask_type': $('#maskTypeSelect').val(),
-        'smart_mask_slugginess': $('#smartMaskSlugginessSlider').val(),
+        'smart_mask_sluggishness': $('#smartMaskSluggishnessSlider').val(),
         'mask_lines': $('#maskLinesEntry').val() ? $('#maskLinesEntry').val().split(',').map(function (l) {return parseInt(l);}) : [],
 
         /* motion notifications */
@@ -2222,7 +2222,7 @@ function dict2CameraUi(dict) {
     $('#minimumMotionFramesEntry').val(dict['minimum_motion_frames']); markHideIfNull('minimum_motion_frames', 'minimumMotionFramesEntry');
     $('#maskSwitch')[0].checked = dict['mask']; markHideIfNull('mask', 'maskSwitch');
     $('#maskTypeSelect').val(dict['mask_type']); markHideIfNull('mask_type', 'maskTypeSelect');
-    $('#smartMaskSlugginessSlider').val(dict['smart_mask_slugginess']); markHideIfNull('smart_mask_slugginess', 'smartMaskSlugginessSlider');
+    $('#smartMaskSluggishnessSlider').val(dict['smart_mask_sluggishness']); markHideIfNull('smart_mask_sluggishness', 'smartMaskSluggishnessSlider');
     $('#maskLinesEntry').val((dict['mask_lines'] || []).join(',')); markHideIfNull('mask_lines', 'maskLinesEntry');
 
     /* motion notifications */
index f9416119800be2924882680e968a907900bf4e04..627fed8211fb2786ee0a79889b25d934a326c28d 100644 (file)
                         <td class="settings-item-value"><input type="text" class="number styled motion-detection camera-config" id="eventGapEntry"><span class="settings-item-unit">seconds</span></td>
                         <td><span class="help-mark" title="sets the number of seconds of silence (i.e. no motion) that mark the end of a motion event">?</span></td>
                     </tr>
-                    <tr class="settings-item advanced-setting" min="0" max="100" required="true">
+                    <tr class="settings-item advanced-setting" min="0" max="1000" required="true">
                         <td class="settings-item-label"><span class="settings-item-label">Captured Before</span></td>
                         <td class="settings-item-value"><input type="text" class="number styled motion-detection camera-config" id="preCaptureEntry"><span class="settings-item-unit">frames</span></td>
                         <td><span class="help-mark" title="sets the number of frames to be captured (and included in the movie) before a motion event is detected">?</span></td>
                     </tr>
-                    <tr class="settings-item advanced-setting" min="0" max="100" required="true">
+                    <tr class="settings-item advanced-setting" min="0" max="1000" required="true">
                         <td class="settings-item-label"><span class="settings-item-label">Captured After</span></td>
                         <td class="settings-item-value"><input type="text" class="number styled motion-detection camera-config" id="postCaptureEntry"><span class="settings-item-unit">frames</span></td>
-                        <td><span class="help-mark" title="sets the number of frames to be captured (and included in the movie) after a motion event is detected">?</span></td>
+                        <td><span class="help-mark" title="sets the number of frames to be captured (and included in the movie) after the end of a motion event">?</span></td>
                     </tr>
                     <tr class="settings-item advanced-setting" min="1" max="1000" required="true">
                         <td class="settings-item-label"><span class="settings-item-label">Minimum Motion Frames</span></td>
                         <td><span class="help-mark" title="the smart option automatically detects regions with regular motion and dynamically builds an internal mask, while the editable mask allows you to manually build it yourself">?</span></td>
                     </tr>
                     <tr class="settings-item advanced-setting" min="1" max="10" snap="1" ticksnum="10" decimals="0" unit="" depends="mask maskType=smart">
-                        <td class="settings-item-label"><span class="settings-item-label">Smart Mask Slugginess</span></td>
-                        <td class="settings-item-value"><input type="text" class="range styled motion-detection camera-config" id="smartMaskSlugginessSlider"></td>
+                        <td class="settings-item-label"><span class="settings-item-label">Smart Mask Sluggishness</span></td>
+                        <td class="settings-item-value"><input type="text" class="range styled motion-detection camera-config" id="smartMaskSluggishnessSlider"></td>
                         <td><span class="help-mark" title="lower values result in a longer-lasting smart mask with a slower building process">?</span></td>
                     </tr>
                     <tr class="settings-item advanced-setting" depends="mask maskType=editable">
index a23cbd4dfcc8319105116165cc3a57f994d7ab46..4d52ff3336e1b3f0adc73d0ee0b0b8ae5efc1c69 100644 (file)
@@ -793,6 +793,9 @@ def urlopen(*args, **kwargs):
 
 
 def build_editable_mask_file(camera_id, mask_lines, capture_width=None, capture_height=None):
+    if not mask_lines:
+        return ''
+    
     width = mask_lines[0]
     height = mask_lines[1]
     mask_lines = mask_lines[2:]