close #86;
This commit is contained in:
parent
4a04502012
commit
9756bf958b
@ -64,8 +64,6 @@ class QFitResult(QtWidgets.QDialog, Ui_Dialog):
|
|||||||
|
|
||||||
self.cmap = RdBuCMap(vmin=-1, vmax=1)
|
self.cmap = RdBuCMap(vmin=-1, vmax=1)
|
||||||
|
|
||||||
self.buttonBox.accepted.connect(self.accept)
|
|
||||||
|
|
||||||
self.graph_checkBox.stateChanged.connect(lambda x: self.graph_comboBox.setEnabled(x == QtCore.Qt.Unchecked))
|
self.graph_checkBox.stateChanged.connect(lambda x: self.graph_comboBox.setEnabled(x == QtCore.Qt.Unchecked))
|
||||||
|
|
||||||
self.logy_box.stateChanged.connect(lambda x: self.fit_plot.setLogMode(y=bool(x)))
|
self.logy_box.stateChanged.connect(lambda x: self.fit_plot.setLogMode(y=bool(x)))
|
||||||
@ -315,20 +313,25 @@ class QFitResult(QtWidgets.QDialog, Ui_Dialog):
|
|||||||
parts = self.partial_checkBox.checkState() == QtCore.Qt.Checked
|
parts = self.partial_checkBox.checkState() == QtCore.Qt.Checked
|
||||||
|
|
||||||
extrapolate = [None, None, None]
|
extrapolate = [None, None, None]
|
||||||
|
error = []
|
||||||
if self.extrapolate_box.isChecked():
|
if self.extrapolate_box.isChecked():
|
||||||
try:
|
try:
|
||||||
extrapolate[0] = float(self.minx_line.text())
|
extrapolate[0] = float(self.minx_line.text())
|
||||||
except TypeError:
|
except (TypeError, ValueError):
|
||||||
pass
|
error.append('Start value is missing')
|
||||||
try:
|
try:
|
||||||
extrapolate[1] = float(self.maxx_line.text())
|
extrapolate[1] = float(self.maxx_line.text())
|
||||||
except TypeError:
|
except (TypeError, ValueError):
|
||||||
pass
|
error.append('End value is missing')
|
||||||
try:
|
try:
|
||||||
extrapolate[2] = int(self.numx_line.text())
|
extrapolate[2] = int(self.numx_line.text())
|
||||||
except TypeError:
|
except (TypeError, ValueError):
|
||||||
pass
|
error.append('Number of points is missing')
|
||||||
|
|
||||||
|
if error:
|
||||||
|
msg = QtWidgets.QMessageBox.warning(self, 'Error', 'Extrapolation failed because:\n' + '\n'.join(error))
|
||||||
|
return
|
||||||
|
else:
|
||||||
self.closed.emit(self._results, self._opts, graph, plot_fits, parts, extrapolate)
|
self.closed.emit(self._results, self._opts, graph, plot_fits, parts, extrapolate)
|
||||||
self.accept()
|
self.accept()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user