Commit 39ce0f6e authored by payno's avatar payno
Browse files

[orangecontrib] fix several typos in saving settings

parent ad1c3dd1
Pipeline #40679 failed with stages
in 9 minutes and 42 seconds
......@@ -90,6 +90,19 @@ class _SavitskyGolayNoiseOpts(qt.QWidget):
self._polynomialOrder.setToolTip(
"window size to provide to the Savitsky-Golay algorithm"
)
# E start
self._eStart = qt.QDoubleSpinBox(self)
self._eStart.setRange(0, 10000000001)
self._eStart.setSuffix("eV")
self._eStart.setValue(100)
self.layout().addRow(qt.QLabel(" - E start", self), self._eStart)
# E end
self._eEnd = qt.QDoubleSpinBox(self)
self._eEnd.setRange(0, 10000000001)
self._eEnd.setSuffix("eV")
self._eEnd.setValue(10000000000)
self.layout().addRow(qt.QLabel(" - E end", self), self._eEnd)
## Outputs
self.layout().addRow(qt.QLabel("Outputs", self))
......@@ -142,10 +155,26 @@ class _SavitskyGolayNoiseOpts(qt.QWidget):
return
self._polynomialOrder.setValue(order)
def getEStart(self):
return self._eStart.value()
def setEStart(self, e_min):
if e_min > 0:
self._eStart.setValue(e_min)
def getEEnd(self):
return self._eEnd.value()
def setEEnd(self, e_max):
if e_max > 0:
self._eEnd.setValue(e_max)
def getParameters(self):
return {
"window_size": self._windowSize.value(),
"polynomial_order": self._polynomialOrder.value(),
"window_size": self.getWindowSize(),
"polynomial_order": self.getPolynomialOrder(),
"e_min": self.getEStart(),
"e_max": self.getEEnd(),
}
def setParameters(self, config):
......@@ -153,6 +182,10 @@ class _SavitskyGolayNoiseOpts(qt.QWidget):
self.setWindowSize(config["window_size"])
if "polynomial_order" in config:
self.setPolynomialOrder(config["polynomial_order"])
if "e_min" in config:
self.setEStart(config["e_min"])
if "e_max" in config:
self.setEEnd(config["e_max"])
def _changed(self, *args, **kwargs):
self.sigChanged.emit()
......
......@@ -194,7 +194,7 @@ class AutobkOW(_ProcessForOrangeMixIn, OWWidget):
self._advancement.sigProgress.connect(self._setProgressValue)
# set up (insure settings will be store
self._updateProcess()
self._update_settings()
def _updateProcess(self):
"""Update settings keeping current xas obj"""
......@@ -203,7 +203,7 @@ class AutobkOW(_ProcessForOrangeMixIn, OWWidget):
self.process(self._latest_xas_obj)
def _update_settings(self):
self._settings = self._window._parametersWindow.getParameters()
self._larchSettings = self._window._parametersWindow.getParameters()
@Inputs.data_table
def processFrmDataTable(self, data_table):
......
......@@ -170,7 +170,7 @@ class MbackOW(_ProcessForOrangeMixIn, OWWidget):
self._advancement.sigProgress.connect(self._setProgressValue)
# set up (insure settings will be store
self._updateProcess()
self._update_settings()
def _updateProcess(self):
self._update_settings()
......
......@@ -170,7 +170,7 @@ class Mback_normOW(_ProcessForOrangeMixIn, OWWidget):
self._advancement.sigProgress.connect(self._setProgressValue)
# set up (insure settings will be store
self._updateProcess()
self._update_settings()
def _updateProcess(self):
self._update_settings()
......
......@@ -189,7 +189,7 @@ class PreEdgeOW(_ProcessForOrangeMixIn, OWWidget):
self._advancement.sigProgress.connect(self._setProgressValue)
# set up (insure settings will be store
self._updateProcess()
self._update_settings()
def _updateProcess(self):
self._update_settings()
......
......@@ -198,7 +198,7 @@ class XFTFOW(_ProcessForOrangeMixIn, OWWidget):
self._advancement.sigProgress.connect(self._setProgressValue)
# set up (insure settings will be store
self._updateProcess()
self._update_settings()
def _updateProcess(self):
self._update_settings()
......
......@@ -71,6 +71,8 @@ class NoiseOW(_ProcessForOrangeMixIn, OWWidget):
window_size = Setting(int(-1))
polynomial_order = Setting(int(-1))
e_min = Setting(int(-1))
e_max = Setting(int(-1))
class Inputs:
xas_obj = Input("xas_obj", XASObject, default=True)
......@@ -110,6 +112,8 @@ class NoiseOW(_ProcessForOrangeMixIn, OWWidget):
{
"window_size": self.window_size,
"polynomial_order": self.polynomial_order,
"e_min": self.e_min,
"e_max": self.e_max,
}
)
......@@ -161,6 +165,8 @@ class NoiseOW(_ProcessForOrangeMixIn, OWWidget):
def _update_settings(self):
self.window_size = self._window.getWindowSize()
self.polynomial_order = self._window.getPolynomialOrder()
self.e_min = self._window.getEMin()
self.e_max = self._window.getEMax()
def _setProgressValue(self, value):
self._progress.widget.progressBarSet(value)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment