From e770cc91c806916f019cebf0b0dfacc714bda923 Mon Sep 17 00:00:00 2001 From: Aaron W Morris Date: Mon, 2 Oct 2023 21:02:19 -0400 Subject: [PATCH] add option to disable processing --- indi_allsky/flask/forms.py | 2 +- .../flask/templates/imageprocessing.html | 26 ++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/indi_allsky/flask/forms.py b/indi_allsky/flask/forms.py index de550fc55..3297948b6 100644 --- a/indi_allsky/flask/forms.py +++ b/indi_allsky/flask/forms.py @@ -3387,7 +3387,7 @@ def __init__(self, *args, **kwargs): class IndiAllskyImageProcessingForm(FlaskForm): - DISABLE_PROCESSING = HiddenField('Disable processing', validators=[], default='1') # disabled by default + DISABLE_PROCESSING = BooleanField('Disable processing') CAMERA_ID = HiddenField('Camera ID', validators=[DataRequired()]) FITS_ID = HiddenField('FITS ID', validators=[DataRequired()]) NIGHT_CONTRAST_ENHANCE = BooleanField('Contrast Enhance') diff --git a/indi_allsky/flask/templates/imageprocessing.html b/indi_allsky/flask/templates/imageprocessing.html index 9bf176f60..afc5a60c0 100644 --- a/indi_allsky/flask/templates/imageprocessing.html +++ b/indi_allsky/flask/templates/imageprocessing.html @@ -48,13 +48,6 @@
-
-
- {{ form_image_processing.DISABLE_PROCESSING(class='form-control bg-secondary') }} - -
-
-
{{ form_image_processing.CAMERA_ID(class='form-control bg-secondary') }} @@ -78,6 +71,16 @@
+ +
+
+ {{ form_image_processing.DISABLE_PROCESSING(class='form-check-input') }} + +
+
+
+ {{ form_image_processing.DISABLE_PROCESSING.label }} +
@@ -557,7 +560,6 @@
These options are applied to the unprocessed image automatically
const failureMessage = $('#failure-message'); const field_names = [ 'csrf_token', - 'DISABLE_PROCESSING', 'CAMERA_ID', 'FITS_ID', 'CLAHE_CLIPLIMIT', @@ -588,6 +590,7 @@
These options are applied to the unprocessed image automatically
]; const checkbox_field_names = [ + 'DISABLE_PROCESSING', 'NIGHT_CONTRAST_ENHANCE', 'CONTRAST_ENHANCE_16BIT', 'IMAGE_STRETCH__MODE1_ENABLE', @@ -674,16 +677,19 @@
These options are applied to the unprocessed image automatically
$('#form_image_processing').on('submit', function() { - $("#DISABLE_PROCESSING").val(''); // enable processing submitProcessingData(); $('#processing_time').text('Processed in ' + json_data['processing_elapsed_s'] + 's'); }); function init() { - $("#DISABLE_PROCESSING").val('1'); // disable processing to get original image + // disable processing for initial image + $('#DISABLE_PROCESSING').prop('checked', true); + submitProcessingData(); $('#processing_time').text('Unprocessed image'); + + $('#DISABLE_PROCESSING').prop('checked', false); }