]> www.vanbest.org Git - motioneye-debian/commitdiff
onyl smart and editable mask types will be supported
authorCalin Crisan <ccrisan@gmail.com>
Mon, 12 Sep 2016 19:42:24 +0000 (22:42 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Mon, 12 Sep 2016 19:42:24 +0000 (22:42 +0300)
motioneye/config.py
motioneye/templates/main.html

index 4b82ad9dbe0294de94962f616e57dcf08818399d..b3684f0f2b90b162872b6d87d8d344ed0cc60ece 100644 (file)
@@ -875,9 +875,6 @@ def motion_camera_ui_to_dict(ui, old_config=None):
         elif ui['mask_type'] == 'editable':
             data['mask_file'] = utils.build_editable_mask_file(ui['editable_mask'])
 
-        else:
-            data['mask_file'] = ui['mask_file']
-
     # working schedule
     if ui['working_schedule']:
         data['@working_schedule'] = (
@@ -1060,7 +1057,6 @@ def motion_camera_dict_to_ui(data):
         'mask': False,
         'mask_type': 'smart',
         'smart_mask_slugginess': 5,
-        'mask_file': '',
         'editable_mask': '',
         
         # motion notifications
@@ -1245,6 +1241,17 @@ def motion_camera_dict_to_ui(data):
 
     ui['movie_quality'] = int(q)
 
+    # mask
+    if data['mask_file']:
+        ui['mask'] = True
+        ui['mask_type'] = 'editable'
+        ui['editable_mask'] = utils.parse_editable_mask_file(data['mask_file'])
+
+    elif data['smart_mask_speed']:
+        ui['mask'] = True
+        ui['mask_type'] = 'smart'
+        ui['smart_mask_slugginess'] = 10 - data['smart_mask_speed']
+
     # working schedule
     working_schedule = data['@working_schedule']
     if working_schedule:
index 20df1ef3ff8b591b48186a2f2d835370b137a9b7..9b579e33d9621d12c374d5148a47796881306a03 100644 (file)
                             <select class="styled motion-detection camera-config" id="maskTypeSelect">
                                 <option value="smart">Smart</option>
                                 <option value="editable">Editable</option>
-                                <option value="file">File</option>
                             </select>
                         </td>
-                        <td><span class="help-mark" title="the smart option automatically detects regions with regular motion and builds an internal mask, the editable mask allows you to manually build it and the file option allows you to specify a mask file (not recommended)">?</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><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" required="true" depends="mask maskType=file" strip="true">
-                        <td class="settings-item-label"><span class="settings-item-label">Mask File</span></td>
-                        <td class="settings-item-value"><input type="text" class="styled motion-detection camera-config" id="maskFileEntry"></td>
-                        <td><span class="help-mark" title="full path to the PGM mask image file">?</span></td>
-                    </tr>
                     {% for config in camera_sections.get('motion-detection', {}).get('configs', []) %}
                         {{config_item(config)}}
                     {% endfor %}