Commit 471ebb9f authored by payno's avatar payno
Browse files

[Orange add-on] connect PyMca signals

parent e96147ba
Pipeline #11947 failed with stage
in 14 minutes and 19 seconds
......@@ -85,10 +85,21 @@ class ExafsOW(OWWidget):
self._window = ExafsWindow()
layout = gui.vBox(self.mainArea, 'fourier transform').layout()
layout.addWidget(self._window)
self._current_process_io = None
# signal / slot connection
_sig = self._window._pymcaWindow.sigPostEdgeParametersSignal
_sig.connect(self._updateProcess)
def _updateProcess(self):
if self._current_process_io:
self.process(self._current_process_io)
def process(self, process_io):
if process_io is None:
return
self._current_process_io = process_io
res = ExafsOW.process_function(process_io)
self._updatePlot(res)
......
......@@ -83,12 +83,23 @@ class FTOW(OWWidget):
def __init__(self):
super().__init__()
self._window = FTWindow(parent=self)
self._current_process_io = None
layout = gui.vBox(self.mainArea, 'fourier transform').layout()
layout.addWidget(self._window)
# signal / slot connection
self._window._pymcaWindow.sigFTParametersSignal.connect(self._updateProcess)
def _updateProcess(self, *arv, **kwargs):
if self._current_process_io:
self.process(process_io=self._current_process_io)
def process(self, process_io):
if process_io is None:
return
process_io.configuration.update(self._window._pymcaWindow.getParameters())
self._current_process_io = process_io
ddict = FTOW.process_function(process_io)
self._updatePlot(ddict=ddict)
......
......@@ -92,11 +92,21 @@ class KWeightOW(OWWidget):
layout = gui.vBox(self.mainArea, 'fourier transform').layout()
self._window = KWeightWindow(parent=self)
layout.addWidget(self._window)
self._current_process_io = None
# signal / slot connection
self._window._k_spin_box.valueChanged.connect(self._updateProcess)
def _updateProcess(self, *arv, **kwargs):
if self._current_process_io:
self.process(self._current_process_io)
def process(self, process_io):
if process_io is None:
return
process_io.configuration['SET_KWEIGHT'] = self._window._k_spin_box.value()
self._current_process_io = process_io
res = KWeightOW.process_function(process_io)
self._updatePlot(res)
......
......@@ -134,12 +134,12 @@ class NormalizationOW(OWWidget):
# then create all the requested curve
e0 = ddict["Edge"]
# curve 1
self._window.plot.addCurve(x=ddict["Energy"] - e0,
y=ddict["Mu"],
legend="Spectrum",
xlabel="Energy (eV)",
ylabel="Absorption (a.u.)")
ylabel="Absorption (a.u.)",
replace=True)
self._window.plot.addCurve(x=ddict["NormalizedEnergy"][idx] - e0,
y=ddict["NormalizedMu"][idx],
......@@ -157,3 +157,4 @@ class NormalizationOW(OWWidget):
y=ddict["NormalizedBackground"],
legend='Pre',
resetzoom=False)
self._window.plot.resetZoom()
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