@@ -337,6 +337,7 @@ def _persist_selection(self):
337337 ),
338338 'calculator_type' : self .calculatorTypeComboBox .currentText (),
339339 'calculator_type_index' : self .calculatorTypeComboBox .currentIndex (),
340+ 'orientation_type' : self .orientationTypeComboBox .currentText (),
340341 'orientation_type_index' : self .orientationTypeComboBox .currentIndex (),
341342 'max_line_length' : self .maxLineLengthSpinBox .value (),
342343 'sampling_frequency' : self .samplingFrequencySpinBox .value (),
@@ -408,19 +409,9 @@ def _run_calculator(self):
408409 unit_field = self .unitNameFieldComboBox .currentField (),
409410 )
410411 # The inputs of this run, read before the run starts. A change during
411- # the run makes the result out of date.
412- self ._run_inputs = (
413- self .data_manager .thickness_inputs (
414- geology = self .geologyLayerComboBox .currentLayer (),
415- unit_field = self .unitNameFieldComboBox .currentField (),
416- contacts_layer = self .basalContactsComboBox .currentLayer (),
417- calculator_type = calculator_type ,
418- structure = self .structureLayerComboBox .currentLayer (),
419- cross_sections = self .crossSectionLayerComboBox .currentLayer (),
420- )
421- if self .data_manager
422- else None
423- )
412+ # the run makes the result out of date. These are read from the same
413+ # source as the status check, after the settings were saved.
414+ self ._run_inputs = self .data_manager .thickness_inputs () if self .data_manager else None
424415
425416 def target (progress_callback ):
426417 return calculate_thickness (updater = progress_callback , ** params )
@@ -466,8 +457,7 @@ def _on_calculator_finished(self, result):
466457 # A thickness that the user typed does not change.
467458 if thicknesses is not None and self .data_manager :
468459 skipped = self ._apply_thicknesses (thicknesses )
469- if self .data_manager and getattr (self , '_run_inputs' , None ) is not None :
470- self .data_manager .derived .record (derived_data .THICKNESS , inputs = self ._run_inputs )
460+ self ._record_run ()
471461 # if thicknesses is not None:
472462 # addGeoDataFrameToproject(thicknesses, "Thickness Results")
473463 if lines is not None :
@@ -483,6 +473,7 @@ def _on_calculator_finished(self, result):
483473 self .task_succeeded .emit ()
484474 return
485475
476+ self ._record_run ()
486477 if hasattr (result , 'geometry' ):
487478 addGeoDataFrameToproject (result , "Thickness Results" )
488479 push_success (
@@ -495,6 +486,11 @@ def _on_calculator_finished(self, result):
495486 push_success ("Thickness Calculator" , f"Thickness calculation completed: { result } " )
496487 self .task_succeeded .emit ()
497488
489+ def _record_run (self ):
490+ """Record the inputs of the run that finished."""
491+ if self .data_manager and getattr (self , '_run_inputs' , None ) is not None :
492+ self .data_manager .derived .record (derived_data .THICKNESS , inputs = self ._run_inputs )
493+
498494 def _apply_thicknesses (self , thicknesses ):
499495 """Set the calculated thicknesses on the units of the column.
500496
0 commit comments