Commit 1dc2c251 authored by payno's avatar payno
Browse files

tmp commit

parent c9dc4655
......@@ -46,6 +46,8 @@ from typing import Union
from .dim import Dim
from .spectra import Spectra
from est.settings import DEFAULT_READ_TIMEOUT
from est.thirdparty.silx.hdf5file import get_data, HDF5File
from esrftaskgraph import Variable
try:
import larch
......@@ -57,7 +59,7 @@ else:
_logger = logging.getLogger(__name__)
class XASObject(object):
class XASObject():
"""Base class of XAS
:param spectra: absorbed beam as a list of :class:`.Spectrum` or a
......
......@@ -30,11 +30,30 @@ __date__ = "06/07/2019"
from silx.gui import qt
from Orange.widgets import gui
from Orange.widgets.widget import OWWidget
from esrf2orange3 import OWWidgetTaskExecutor
import logging
_logger = logging.getLogger(__file__)
class OWESRFWidget(OWWidget):
def __init__(self):
super().__init__()
self._esrfexecutor = OWWidgetTaskExecutor(self)
# maybe we could create a callback to handleNewSignals when this is created ?
def handleNewSignals(self):
for name, value in self._esrfexecutor.dynamic_input_values.items():
self._dynamic_input_form.setParameter(name, value)
self._static_input_form.disable(name)
self._esrfexecutor.run()
for name, value in self._esrfexecutor.output_values.items():
self._output_form.setParameter(name, value)
class _ProcessForOrangeMixIn(object):
"""
Group processing and progress display in a common class for xasObject
......
......@@ -51,7 +51,7 @@ from est.gui.XasObjectViewer import (
)
from orangecontrib.est.progress import QProgress
from orangecontrib.est.utils import Converter
from ..container import _ParameterWindowContainer
from orangecontrib.est.widgets.container import _ParameterWindowContainer
_logger = logging.getLogger(__file__)
......
......@@ -51,7 +51,7 @@ from est.gui.XasObjectViewer import _ft_intensity_plot, _ft_imaginary_plot
from orangecontrib.est.progress import QProgress
from orangecontrib.est.utils import Converter
from ..container import _ParameterWindowContainer
from orangecontrib.est.widgets.container import _ParameterWindowContainer
_logger = logging.getLogger(__file__)
......
......@@ -31,6 +31,7 @@ __date__ = "06/11/2019"
import logging
from Orange.widgets import gui
from Orange.widgets.settings import Setting
from orangecontrib.est.process import OWESRFWidget
from Orange.widgets.widget import OWWidget
from Orange.widgets.widget import Output
from silx.gui import qt
......@@ -39,6 +40,7 @@ import est.core.io
import est.core.process.ignoreprocess
from est.core.types import XASObject
from est.gui.xas_object_definition import XASObjectWindow
from esrftaskgraph import Variable
_logger = logging.getLogger(__file__)
......@@ -46,7 +48,7 @@ _logger = logging.getLogger(__file__)
_DEBUG = False
class XASInputOW(OWWidget):
class XASInputOW(OWESRFWidget):
"""
Widget used for signal extraction
"""
......@@ -78,7 +80,7 @@ class XASInputOW(OWWidget):
process_function = est.core.io.read_frm_file
class Outputs:
res_xas_obj = Output("xas_obj", XASObject)
output = Output("xas_obj", Variable)
# by default we want to avoid sending 'Orange.data.Table' to avoid
# loosing the XASObject flow process and results.
......@@ -121,6 +123,8 @@ class XASInputOW(OWWidget):
self._inputDialog.getMainWindow().editingFinished.connect(self._storeSettings)
self.setFileSelected = self._inputDialog.setDatFile
self.handleNewSignals()
def _emitNewFile(self, *args, **kwargs):
try:
xas_obj = self._inputDialog.buildXASObject()
......
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