Fixed bug with rejected apodization crashing the program.

This commit is contained in:
jupfi 2024-04-26 16:07:26 +02:00
parent 775d6011f1
commit f847bdabcb
2 changed files with 6 additions and 3 deletions

View file

@ -215,8 +215,11 @@ class MeasurementController(ModuleController):
dialog = Apodization(measurement, parent=self.module.view) dialog = Apodization(measurement, parent=self.module.view)
result = dialog.exec() result = dialog.exec()
if result: logger.debug("Dialog result: %s", result)
function = dialog.get_function() if not result:
return
function = dialog.get_function()
logger.debug("Apodization function: %s", function) logger.debug("Apodization function: %s", function)

View file

@ -45,7 +45,7 @@ class Apodization(DuckFormBuilder):
self.duration = (self.measurement.tdx[-1] - self.measurement.tdx[0]) * 1e-6 self.duration = (self.measurement.tdx[-1] - self.measurement.tdx[0]) * 1e-6
function_selection_field = DuckFormFunctionSelectionField( function_selection_field = DuckFormFunctionSelectionField(
False, False, functions, self.duration, parent=parent, default_function=0 text=None, tooltip=None, functions=functions, duration=self.duration, parent=parent, default_function=0
) )
self.add_field(function_selection_field) self.add_field(function_selection_field)