Commit 2337c8fb authored by payno's avatar payno

[gui] ComWidget: manage problem if map not created when requested

parent ccff46e8
......@@ -32,6 +32,9 @@ from silx.gui import qt
from silx.gui.plot import Plot2D
from collections import OrderedDict
from id06workflow.core.experiment.operation.com import COM as COMOperation
import logging
_logger = logging.getLogger(__file__)
class ComWidget(qt.QWidget):
......@@ -64,8 +67,13 @@ class ComWidget(qt.QWidget):
if dim >= 0:
# TODO: maps[dim] should be also a list with key values: 'value',
# 'mean', 'gradients' ...
_map = self._operation.maps[dim][_iMap]
self._plot.addImage(_map)
if len(self._operation.maps[dim]) <= _iMap:
_logger.error('map of index %s has not been created' % _iMap)
self._plot.clear()
return
else:
_map = self._operation.maps[dim][_iMap]
self._plot.addImage(_map)
class _ComControlWidget(qt.QWidget):
......
Markdown is supported
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