Skip to content

Commit

Permalink
add option to disable processing
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronwmorris committed Oct 3, 2023
1 parent 36197c2 commit e770cc9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion indi_allsky/flask/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
26 changes: 16 additions & 10 deletions indi_allsky/flask/templates/imageprocessing.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@

<form id="form_image_processing" onSubmit="return false;">

<div class="form-group row">
<div class="col-sm-3">
{{ form_image_processing.DISABLE_PROCESSING(class='form-control bg-secondary') }}
<div id="DISABLE_PROCESSING-error" class="invalid-feedback text-danger" style="display: none;"></div>
</div>
</div>

<div class="form-group row">
<div class="col-sm-3">
{{ form_image_processing.CAMERA_ID(class='form-control bg-secondary') }}
Expand All @@ -78,6 +71,16 @@
<div class="col-sm-1">
<div class="loader" id="loader_processing"></div>
</div>

<div class="col-sm-1">
<div class="form-switch">
{{ form_image_processing.DISABLE_PROCESSING(class='form-check-input') }}
<div id="NIGHT_CONTRAST_ENHANCE-error" class="invalid-feedback text-danger" style="display: none;"></div>
</div>
</div>
<div class="col-sm-2">
{{ form_image_processing.DISABLE_PROCESSING.label }}
</div>
</div>

<div class="form-group row">
Expand Down Expand Up @@ -557,7 +560,6 @@ <h5>These options are applied to the unprocessed image automatically</h5>
const failureMessage = $('#failure-message');
const field_names = [
'csrf_token',
'DISABLE_PROCESSING',
'CAMERA_ID',
'FITS_ID',
'CLAHE_CLIPLIMIT',
Expand Down Expand Up @@ -588,6 +590,7 @@ <h5>These options are applied to the unprocessed image automatically</h5>
];

const checkbox_field_names = [
'DISABLE_PROCESSING',
'NIGHT_CONTRAST_ENHANCE',
'CONTRAST_ENHANCE_16BIT',
'IMAGE_STRETCH__MODE1_ENABLE',
Expand Down Expand Up @@ -674,16 +677,19 @@ <h5>These options are applied to the unprocessed image automatically</h5>


$('#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);
}


Expand Down

0 comments on commit e770cc9

Please sign in to comment.