Skip to content

Commit

Permalink
Code is more functional. Moving towards generalization of fit ranges.
Browse files Browse the repository at this point in the history
  • Loading branch information
Geegee committed Sep 30, 2021
1 parent aa2caf6 commit 9470501
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions gui/odmr/odmrgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def on_deactivate(self):
self._odmr_logic.sigOdmrElapsedTimeUpdated.disconnect()
self.sigCwMwOn.disconnect()
self.sigMwOff.disconnect()
self.sigClearData.disconnect()
self.sigClearData.disconnectt()()
self.sigStartOdmrScan.disconnect()
self.sigStopOdmrScan.disconnect()
self.sigContinueOdmrScan.disconnect()
Expand Down Expand Up @@ -941,12 +941,7 @@ def update_fit(self, x_data, y_data, result_str_dict, current_fit):
""" Update the shown fit. """
if current_fit != 'No Fit':
# display results as formatted text
self._mw.odmr_fit_results_DisplayWidget.clear()
try:
formated_results = units.create_formatted_output(result_str_dict)
except:
formated_results = 'this fit does not return formatted results'
self._mw.odmr_fit_results_DisplayWidget.setPlainText(formated_results)
self.update_display_widget(result_str_dict)

self._mw.fit_methods_ComboBox.blockSignals(True)
self._mw.fit_methods_ComboBox.setCurrentFit(current_fit)
Expand All @@ -965,6 +960,15 @@ def update_fit(self, x_data, y_data, result_str_dict, current_fit):
self._mw.odmr_PlotWidget.getViewBox().updateAutoRange()
return

def update_display_widget(self, result_str_dict):
self._mw.odmr_fit_results_DisplayWidget.clear()
try:
formated_results = units.create_formatted_output(result_str_dict)
except:
formated_results = 'this fit does not return formatted results'
self._mw.odmr_fit_results_DisplayWidget.setPlainText(formated_results)
return

def update_fit_range(self):
self._odmr_logic.range_to_fit = self._mw.fit_range_SpinBox.value()
return
Expand Down

0 comments on commit 9470501

Please sign in to comment.