Element simulations were resetting needlessly when changing both request-wide settings or specific settings. This happened due to ScientificSpinBox values for ToF slope, ToF offset, angle offset and angle slope in detector settings in detector settings being initialized with zero value and only after initialization was the actual value from the detector object set in the fields. This caused the change tracking feature to trigger and think that there were changes that require resetting simulations.
This was fixed by initializing the field values with required values, instead of setting them later.
Additionally fixes an issue, where detector settings didn't save after closing request settings dialog. In the function that is called upon clicking ok in the dialog, there was no call to save the updated settings to the request default detector. I added the call to detector.to_file() method to save the updated settings to the default detector file, fixing the problem.
Element simulations were resetting needlessly when changing both request-wide settings or specific settings. This happened due to ScientificSpinBox values for ToF slope, ToF offset, angle offset and angle slope in detector settings in detector settings being initialized with zero value and only after initialization was the actual value from the detector object set in the fields. This caused the change tracking feature to trigger and think that there were changes that require resetting simulations.
This was fixed by initializing the field values with required values, instead of setting them later.
Additionally fixes an issue, where detector settings didn't save after closing request settings dialog. In the function that is called upon clicking ok in the dialog, there was no call to save the updated settings to the request default detector. I added the call to
detector.to_file()
method to save the updated settings to the default detector file, fixing the problem.