Skip to content
Snippets Groups Projects
Commit 659b1b4f authored by payno's avatar payno
Browse files

Merge branch 'fix_868' into 'master'

scanoverview: add more metadata

Closes #868

See merge request tomotools/tomwer!526
parents bffc74ac 9eb6ae09
No related branches found
No related tags found
No related merge requests found
...@@ -41,3 +41,5 @@ PSI_CHAR = (b"\xcf\x88").decode("utf-8") ...@@ -41,3 +41,5 @@ PSI_CHAR = (b"\xcf\x88").decode("utf-8")
THETA_CHAR = (b"\xce\xb8").decode("utf-8") THETA_CHAR = (b"\xce\xb8").decode("utf-8")
MU_CHAR = (b"\xce\xbc").decode("utf-8") MU_CHAR = (b"\xce\xbc").decode("utf-8")
DEGREE_CHAR = (b"\xc2\xb0").decode("utf-8")
...@@ -36,7 +36,7 @@ from nabu.pipeline.fullfield.nabu_config import ( ...@@ -36,7 +36,7 @@ from nabu.pipeline.fullfield.nabu_config import (
from silx.gui import icons as silx_icons from silx.gui import icons as silx_icons
from silx.gui import qt from silx.gui import qt
from silx.utils.enum import Enum as _Enum from silx.utils.enum import Enum as _Enum
from tomoscan.scanbase import _FOV from tomoscan.scanbase import FOV
from tomwer.core.process.reconstruction.nabu.utils import ConfigurationLevel, _NabuMode from tomwer.core.process.reconstruction.nabu.utils import ConfigurationLevel, _NabuMode
from tomwer.core.scan.scanbase import TomwerScanBase from tomwer.core.scan.scanbase import TomwerScanBase
...@@ -553,9 +553,9 @@ class NabuWidget(qt.QWidget): ...@@ -553,9 +553,9 @@ class NabuWidget(qt.QWidget):
"""Tune the configuration from scan information if possible""" """Tune the configuration from scan information if possible"""
assert isinstance(scan, TomwerScanBase) assert isinstance(scan, TomwerScanBase)
if scan.field_of_view is not None and not self.isModeLocked(): if scan.field_of_view is not None and not self.isModeLocked():
if scan.field_of_view == _FOV.FULL: if scan.field_of_view == FOV.FULL:
self.setMode(_NabuMode.FULL_FIELD) self.setMode(_NabuMode.FULL_FIELD)
elif scan.field_of_view == _FOV.HALF: elif scan.field_of_view == FOV.HALF:
self.setMode(_NabuMode.HALF_ACQ) self.setMode(_NabuMode.HALF_ACQ)
if scan.sa_delta_beta_params is not None: if scan.sa_delta_beta_params is not None:
db = scan.sa_delta_beta_params.selected_delta_beta_value db = scan.sa_delta_beta_params.selected_delta_beta_value
......
...@@ -32,9 +32,11 @@ import logging ...@@ -32,9 +32,11 @@ import logging
import weakref import weakref
from silx.gui import qt from silx.gui import qt
from tomoscan.scanbase import FOV
from tomwer.core.scan.edfscan import EDFTomoScan from tomwer.core.scan.edfscan import EDFTomoScan
from tomwer.core.scan.scanbase import TomwerScanBase from tomwer.core.scan.scanbase import TomwerScanBase
from tomwer.core.utils.char import DEGREE_CHAR
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
...@@ -68,6 +70,8 @@ class ScanOverviewWidget(qt.QWidget): ...@@ -68,6 +70,8 @@ class ScanOverviewWidget(qt.QWidget):
self._flats.setText(0, "flats") self._flats.setText(0, "flats")
self._alignments = qt.QTreeWidgetItem(self._frames) self._alignments = qt.QTreeWidgetItem(self._frames)
self._alignments.setText(0, "alignments") self._alignments.setText(0, "alignments")
self._estimatedCOR = qt.QTreeWidgetItem(self._frames)
self._estimatedCOR.setText(0, "estimated cor")
self._x_pixel_size = qt.QTreeWidgetItem(self._instrument) self._x_pixel_size = qt.QTreeWidgetItem(self._instrument)
self._x_pixel_size.setText(0, "x pixel size") self._x_pixel_size.setText(0, "x pixel size")
...@@ -87,6 +91,8 @@ class ScanOverviewWidget(qt.QWidget): ...@@ -87,6 +91,8 @@ class ScanOverviewWidget(qt.QWidget):
self._endTime.setText(0, "end_time") self._endTime.setText(0, "end_time")
self._title = qt.QTreeWidgetItem(self._tree) self._title = qt.QTreeWidgetItem(self._tree)
self._title.setText(0, "title") self._title.setText(0, "title")
self._scanRangeQLE = qt.QTreeWidgetItem(self._tree)
self._scanRangeQLE.setText(0, "scan range")
# set up # set up
self._instrument.setExpanded(True) self._instrument.setExpanded(True)
...@@ -116,6 +122,7 @@ class ScanOverviewWidget(qt.QWidget): ...@@ -116,6 +122,7 @@ class ScanOverviewWidget(qt.QWidget):
self._updateSample, self._updateSample,
self._updateTimes, self._updateTimes,
self._updateNames, self._updateNames,
self._updateScanRange,
): ):
try: try:
fct() fct()
...@@ -190,6 +197,14 @@ class ScanOverviewWidget(qt.QWidget): ...@@ -190,6 +197,14 @@ class ScanOverviewWidget(qt.QWidget):
text=str(n_alignment), text=str(n_alignment),
) )
if scan.field_of_view == FOV.HALF:
if scan.estimated_cor_frm_motor is None:
self._estimatedCOR.setText("???")
else:
self._estimatedCOR.setText(str(scan.estimated_cor_frm_motor))
else:
self._estimatedCOR.setText("only for half")
def _updateEnergy(self): def _updateEnergy(self):
scan = self.getScan() scan = self.getScan()
assert isinstance(scan, TomwerScanBase) assert isinstance(scan, TomwerScanBase)
...@@ -221,6 +236,10 @@ class ScanOverviewWidget(qt.QWidget): ...@@ -221,6 +236,10 @@ class ScanOverviewWidget(qt.QWidget):
scan = self.getScan() scan = self.getScan()
assert isinstance(scan, TomwerScanBase) assert isinstance(scan, TomwerScanBase)
scan_range = scan.scan_range scan_range = scan.scan_range
if scan_range is None:
scan_range = "???"
else:
scan_range = f"{scan_range}{DEGREE_CHAR}"
self._setColoredTxt( self._setColoredTxt(
item=self._scanRangeQLE, item=self._scanRangeQLE,
text=str(scan_range), text=str(scan_range),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment