tomwer 1.0.3__py3-none-any.whl → 1.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- orangecontrib/tomwer/tutorials/EBS_tomo_listener.ows +39 -0
- orangecontrib/tomwer/tutorials/cast_volume.ows +34 -0
- orangecontrib/tomwer/tutorials/simple_slice_reconstruction.ows +39 -0
- orangecontrib/tomwer/tutorials/simple_volume_local_reconstruction.ows +49 -0
- orangecontrib/tomwer/tutorials/simple_volume_to_slurm_reconstruction.ows +59 -0
- orangecontrib/tomwer/tutorials/using_saaxis_to_find_cor.ows +44 -0
- orangecontrib/tomwer/widgets/cluster/FutureSupervisorOW.py +1 -1
- orangecontrib/tomwer/widgets/cluster/SlurmClusterOW.py +14 -4
- orangecontrib/tomwer/widgets/cluster/__init__.py +1 -1
- orangecontrib/tomwer/widgets/control/DataListOW.py +12 -5
- orangecontrib/tomwer/widgets/control/DataListenerOW.py +18 -9
- orangecontrib/tomwer/widgets/control/DataSelectorOW.py +13 -6
- orangecontrib/tomwer/widgets/control/DataTransfertOW.py +3 -5
- orangecontrib/tomwer/widgets/control/DataValidatorOW.py +8 -4
- orangecontrib/tomwer/widgets/control/DataWatcherOW.py +4 -6
- orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +49 -62
- orangecontrib/tomwer/widgets/control/FilterOW.py +2 -4
- orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +93 -0
- orangecontrib/tomwer/widgets/control/NXTomomillOW.py +135 -129
- orangecontrib/tomwer/widgets/control/NotifierOW.py +34 -9
- orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +3 -5
- orangecontrib/tomwer/widgets/control/TomoObjSerieOW.py +19 -13
- orangecontrib/tomwer/widgets/control/VolumeSelector.py +12 -4
- orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +11 -7
- orangecontrib/tomwer/widgets/control/icons/notification.svg +4 -4
- orangecontrib/tomwer/widgets/control/icons/nxtomomill.png +0 -0
- orangecontrib/tomwer/widgets/control/icons/nxtomomill.svg +8 -5
- orangecontrib/tomwer/widgets/control/icons/tomoobjserie.png +0 -0
- orangecontrib/tomwer/widgets/control/icons/tomoobjserie.svg +73 -78
- orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +16 -4
- orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +100 -0
- orangecontrib/tomwer/widgets/edit/icons/image_key_editor.png +0 -0
- orangecontrib/tomwer/widgets/edit/icons/image_key_upgrader.png +0 -0
- orangecontrib/tomwer/widgets/edit/icons/nx_tomo_editor.png +0 -0
- orangecontrib/tomwer/widgets/edit/icons/nx_tomo_editor.svg +123 -0
- orangecontrib/tomwer/widgets/edit/test/test_dark_flat_patch.py +21 -1
- orangecontrib/tomwer/widgets/edit/test/test_image_key_editor.py +1 -1
- orangecontrib/tomwer/widgets/edit/test/test_image_key_upgrader.py +1 -1
- orangecontrib/tomwer/widgets/edit/test/test_nxtomo_editor.py +25 -0
- orangecontrib/tomwer/widgets/other/PythonScriptOW.py +19 -11
- orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +20 -14
- orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +24 -10
- orangecontrib/tomwer/widgets/reconstruction/DarkRefAndCopyOW.py +26 -21
- orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +29 -12
- orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +44 -17
- orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +28 -20
- orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +24 -18
- orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +6 -6
- orangecontrib/tomwer/widgets/reconstruction/TofuOW.py +4 -2
- orangecontrib/tomwer/widgets/reconstruction/icons/nabu_2d.png +0 -0
- orangecontrib/tomwer/widgets/reconstruction/icons/nabu_2d.svg +11 -8
- orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +10 -4
- orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +1 -1
- orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +69 -0
- orangecontrib/tomwer/widgets/visualization/SampleMovedOW.py +2 -4
- orangecontrib/tomwer/widgets/visualization/icons/nx_tomo_metadata_viewer.png +0 -0
- orangecontrib/tomwer/widgets/visualization/icons/nx_tomo_metadata_viewer.svg +105 -0
- tomwer/__main__.py +10 -5
- tomwer/app/canvas_launcher/config.py +10 -10
- tomwer/app/canvas_launcher/mainwindow.py +68 -6
- tomwer/app/canvas_launcher/widgetsscheme.py +1 -3
- tomwer/app/darkref.py +16 -12
- tomwer/app/imagekeyeditor.py +2 -2
- tomwer/app/imagekeyupgrader.py +104 -0
- tomwer/app/intensitynormalization.py +0 -1
- tomwer/app/nxtomoeditor.py +103 -0
- tomwer/app/rsync.py +1 -1
- tomwer/core/cluster/cluster.py +1 -1
- tomwer/core/futureobject.py +1 -0
- tomwer/core/process/control/datalistener/datalistener.py +7 -1
- tomwer/core/process/control/datalistener/rpcserver.py +3 -4
- tomwer/core/process/control/datawatcher/datawatcher.py +18 -18
- tomwer/core/process/control/datawatcher/datawatcherobserver.py +5 -8
- tomwer/core/process/control/datawatcher/datawatcherprocess.py +2 -3
- tomwer/core/process/control/datawatcher/edfdwprocess.py +2 -2
- tomwer/core/process/control/nxtomomill.py +33 -58
- tomwer/core/process/control/scanlist.py +2 -1
- tomwer/core/process/control/scanselector.py +7 -0
- tomwer/core/process/control/scantransfer.py +2 -2
- tomwer/core/process/control/scanvalidator.py +6 -5
- tomwer/core/process/control/singletomoobj.py +2 -1
- tomwer/core/process/control/timer.py +2 -1
- tomwer/core/process/control/tomoobjserie.py +8 -2
- tomwer/core/process/control/volumeselector.py +2 -1
- tomwer/core/process/control/volumesymlink.py +2 -1
- tomwer/core/process/edit/darkflatpatch.py +2 -1
- tomwer/core/process/edit/imagekeyeditor.py +4 -3
- tomwer/core/process/reconstruction/axis/axis.py +29 -32
- tomwer/core/process/reconstruction/axis/mode.py +3 -2
- tomwer/core/process/reconstruction/axis/params.py +35 -16
- tomwer/core/process/reconstruction/darkref/darkrefs.py +90 -707
- tomwer/core/process/reconstruction/darkref/darkrefscopy.py +44 -16
- tomwer/core/process/reconstruction/darkref/params.py +62 -67
- tomwer/core/process/reconstruction/lamino/tofu.py +1 -2
- tomwer/core/process/reconstruction/nabu/castvolume.py +21 -26
- tomwer/core/process/reconstruction/nabu/nabucommon.py +36 -38
- tomwer/core/process/reconstruction/nabu/nabuscores.py +28 -13
- tomwer/core/process/reconstruction/nabu/nabuslices.py +41 -14
- tomwer/core/process/reconstruction/nabu/nabuvolume.py +21 -12
- tomwer/core/process/reconstruction/nabu/utils.py +32 -3
- tomwer/core/process/reconstruction/normalization/normalization.py +9 -8
- tomwer/core/process/reconstruction/saaxis/saaxis.py +46 -20
- tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +38 -12
- tomwer/core/process/reconstruction/test/__init__.py +0 -39
- tomwer/core/process/reconstruction/test/test_axis_params.py +25 -3
- tomwer/core/process/reconstruction/test/test_darkref_copy.py +117 -1
- tomwer/core/process/script/python.py +16 -12
- tomwer/core/process/task.py +3 -7
- tomwer/core/process/test/test_axis.py +1 -1
- tomwer/core/process/test/test_dark_and_flat.py +41 -111
- tomwer/core/process/test/test_data_listener.py +0 -29
- tomwer/core/process/test/test_data_transfer.py +10 -14
- tomwer/core/process/test/test_nabu.py +1 -1
- tomwer/core/process/test/test_normalization.py +1 -1
- tomwer/core/process/visualization/liveslice.py +6 -0
- tomwer/core/scan/blissscan.py +37 -2
- tomwer/core/scan/edfscan.py +19 -8
- tomwer/core/scan/hdf5scan.py +10 -4
- tomwer/core/scan/scanbase.py +35 -29
- tomwer/core/scan/scanfactory.py +3 -17
- tomwer/core/scan/test/test_h5.py +1 -1
- tomwer/core/scan/test/test_process_registration.py +0 -11
- tomwer/core/scan/test/test_scan.py +32 -30
- tomwer/core/settings.py +2 -2
- tomwer/core/test/test_utils.py +1 -1
- tomwer/core/tomwer_object.py +19 -0
- tomwer/core/utils/__init__.py +0 -45
- tomwer/core/utils/char.py +2 -0
- tomwer/core/utils/gpu.py +5 -5
- tomwer/core/utils/nxtomoutils.py +2 -2
- tomwer/core/utils/scanutils.py +50 -0
- tomwer/core/utils/volumeutils.py +13 -0
- tomwer/core/volume/edfvolume.py +4 -0
- tomwer/core/volume/hdf5volume.py +4 -0
- tomwer/core/volume/jp2kvolume.py +4 -0
- tomwer/core/volume/rawvolume.py +22 -5
- tomwer/core/volume/tiffvolume.py +4 -0
- tomwer/core/volume/volumebase.py +19 -12
- tomwer/core/volume/volumefactory.py +20 -1
- tomwer/gui/cluster/slurm.py +1 -1
- tomwer/gui/cluster/supervisor.py +0 -2
- tomwer/gui/cluster/test/test_cluster.py +2 -2
- tomwer/gui/control/datalist.py +109 -36
- tomwer/gui/control/datatransfert.py +1 -1
- tomwer/gui/control/datawatcher/configuration.py +0 -2
- tomwer/gui/control/datawatcher/datawatcher.py +23 -13
- tomwer/gui/control/datawatcher/datawatcherobserver.py +1 -1
- tomwer/gui/control/observations.py +0 -3
- tomwer/gui/control/selectorwidgetbase.py +42 -12
- tomwer/gui/control/serie/seriecreator.py +967 -0
- tomwer/{web/__init__.py → gui/control/serie/seriewaiter.py} +5 -7
- tomwer/gui/control/singletomoobj.py +15 -4
- tomwer/gui/control/test/test_datalist.py +1 -1
- tomwer/gui/control/test/test_datalistener.py +1 -1
- tomwer/gui/control/test/test_inputwidget.py +1 -1
- tomwer/gui/control/test/test_process_manager.py +1 -13
- tomwer/gui/control/test/test_scanselector.py +1 -1
- tomwer/gui/control/test/test_scanvalidator.py +1 -1
- tomwer/gui/control/test/test_single_tomo_obj.py +1 -1
- tomwer/gui/control/test/test_volume_dialog.py +19 -7
- tomwer/gui/control/test/test_volumeselector.py +4 -4
- tomwer/gui/debugtools/datasetgenerator.py +1 -9
- tomwer/gui/edit/dkrfpatch.py +2 -3
- tomwer/gui/edit/imagekeyeditor.py +12 -11
- tomwer/gui/edit/nxtomoeditor.py +475 -0
- tomwer/gui/edit/test/test_dkrf_patch.py +2 -14
- tomwer/gui/edit/test/test_image_key_editor.py +2 -2
- tomwer/gui/edit/test/test_nx_editor.py +155 -0
- tomwer/gui/icons.py +0 -1
- tomwer/gui/qfolderdialog.py +11 -0
- tomwer/gui/reconstruction/axis/CompareImages.py +27 -29
- tomwer/gui/reconstruction/axis/axis.py +2 -0
- tomwer/gui/reconstruction/axis/radioaxis.py +70 -14
- tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +7 -9
- tomwer/gui/reconstruction/darkref/darkrefwidget.py +22 -24
- tomwer/gui/reconstruction/lamino/tofu/projections.py +1 -1
- tomwer/gui/reconstruction/lamino/tofu/tofu.py +3 -3
- tomwer/gui/reconstruction/lamino/tofu/tofuexpert.py +4 -4
- tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +10 -5
- tomwer/gui/reconstruction/nabu/castvolume.py +103 -24
- tomwer/gui/reconstruction/nabu/check.py +1 -1
- tomwer/gui/reconstruction/nabu/nabuconfig/ctf.py +352 -0
- tomwer/gui/reconstruction/nabu/nabuconfig/nabuconfig.py +0 -9
- tomwer/gui/reconstruction/nabu/nabuconfig/output.py +1 -1
- tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +18 -19
- tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +30 -7
- tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +26 -15
- tomwer/gui/reconstruction/nabu/slices.py +10 -4
- tomwer/gui/reconstruction/nabu/slurm.py +1 -1
- tomwer/gui/reconstruction/nabu/volume.py +13 -7
- tomwer/gui/reconstruction/normalization/intensity.py +1 -5
- tomwer/gui/reconstruction/saaxis/corrangeselector.py +10 -37
- tomwer/gui/reconstruction/saaxis/saaxis.py +11 -7
- tomwer/gui/reconstruction/saaxis/sliceselector.py +11 -26
- tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +13 -8
- tomwer/gui/reconstruction/scores/scoreplot.py +67 -62
- tomwer/gui/reconstruction/test/test_axis.py +2 -2
- tomwer/gui/reconstruction/test/test_lamino.py +2 -2
- tomwer/gui/reconstruction/test/test_nabu.py +14 -1
- tomwer/gui/reconstruction/test/test_saaxis.py +8 -17
- tomwer/gui/reconstruction/test/test_sadeltabeta.py +7 -13
- tomwer/gui/stackplot.py +11 -28
- tomwer/gui/test/test_axis_gui.py +4 -4
- tomwer/gui/test/test_qfolder_dialog.py +12 -0
- tomwer/gui/utils/inputwidget.py +42 -22
- tomwer/gui/utils/lineselector/lineselector.py +13 -21
- tomwer/gui/utils/scandescription.py +2 -4
- tomwer/gui/utils/slider.py +1 -102
- tomwer/gui/utils/unitsystem.py +48 -11
- tomwer/gui/visualization/dataviewer.py +24 -17
- tomwer/gui/visualization/diffviewer/diffviewer.py +2 -11
- tomwer/gui/visualization/nxtomometadata.py +21 -0
- tomwer/gui/visualization/scanoverview.py +0 -1
- tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +72 -0
- tomwer/gui/visualization/test/test_stacks.py +1 -1
- tomwer/gui/visualization/tomoobjoverview.py +49 -0
- tomwer/gui/visualization/volumeoverview.py +64 -0
- tomwer/gui/visualization/volumeviewer.py +1 -1
- tomwer/io/utils/utils.py +2 -2
- tomwer/resources/gui/icons/multi-document-save.png +0 -0
- tomwer/resources/gui/icons/multi-document-save.svg +101 -0
- tomwer/resources/gui/illustrations/ctf_z1.png +0 -0
- tomwer/resources/gui/illustrations/ctf_z1.svg +471 -0
- tomwer/synctools/axis.py +0 -1
- tomwer/synctools/darkref.py +0 -1
- tomwer/synctools/datalistener.py +5 -1
- tomwer/synctools/imageloaderthread.py +2 -2
- tomwer/synctools/saaxis.py +0 -1
- tomwer/synctools/sadeltabeta.py +0 -1
- tomwer/synctools/stacks/edit/imagekeyeditor.py +1 -1
- tomwer/synctools/stacks/processingstack.py +2 -2
- tomwer/synctools/stacks/reconstruction/castvolume.py +1 -0
- tomwer/synctools/stacks/reconstruction/dkrefcopy.py +1 -1
- tomwer/synctools/stacks/reconstruction/lamino.py +1 -3
- tomwer/synctools/stacks/reconstruction/sadeltabeta.py +0 -2
- tomwer/synctools/test/test_darkRefs.py +32 -149
- tomwer/synctools/test/test_foldertransfer.py +1 -1
- tomwer/synctools/test/test_scanstages.py +2 -2
- tomwer/tests/conftest.py +51 -0
- tomwer/{test → tests}/test_scripts.py +1 -1
- tomwer/tests/test_utils.py +10 -0
- tomwer/{test → tests}/utils/utilstest.py +0 -11
- tomwer/version.py +3 -3
- {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/METADATA +14 -16
- {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/RECORD +255 -235
- {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/WHEEL +1 -1
- {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/entry_points.txt +6 -0
- orangecontrib/tomwer/setup.py +0 -45
- orangecontrib/tomwer/widgets/setup.py +0 -49
- tomwer/app/process.py +0 -153
- tomwer/core/process/reconstruction/nabu/slurm.py +0 -36
- tomwer/core/process/reconstruction/utils/nabu_slice_exec.py +0 -10
- tomwer/core/utils/laminoutils.py +0 -80
- tomwer/gui/utils/lineselector/lineselection.py +0 -76
- tomwer/setup.py +0 -52
- tomwer/slurm/executor.py +0 -36
- tomwer/slurm/job.py +0 -349
- tomwer/slurm/utils.py +0 -44
- tomwer/web/client.py +0 -43
- tomwer/web/config.py +0 -36
- tomwer/web/test/test_graylog_connection.py +0 -59
- {tomwer/slurm → orangecontrib/tomwer/tutorials}/__init__.py +0 -0
- /tomwer/{test → gui/control/serie}/__init__.py +0 -0
- /tomwer/{web/test → tests}/__init__.py +0 -0
- /tomwer/{test → tests}/utils/__init__.py +0 -0
- /tomwer-1.0.3-py3.8-nspkg.pth → /tomwer-1.1.0-py3.9-nspkg.pth +0 -0
- {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/LICENSE +0 -0
- {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/namespace_packages.txt +0 -0
- {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/top_level.txt +0 -0
@@ -173,11 +173,14 @@ class DataWatcherWidget(_DataWatcher, qt.QMainWindow):
|
|
173
173
|
if self.loopObservationThread is not None:
|
174
174
|
self.loopObservationThread.blockSignals(True)
|
175
175
|
self._disconnectObserverThread()
|
176
|
-
self.loopObservationThread.wait()
|
176
|
+
self.loopObservationThread.wait(4000)
|
177
177
|
self.loopObservationThread = None
|
178
|
-
if
|
179
|
-
self.observationThread
|
180
|
-
self.observationThread.
|
178
|
+
if (
|
179
|
+
self.observationThread is not None
|
180
|
+
and self.observationThread.isRunning() # pylint: disable=E1101
|
181
|
+
):
|
182
|
+
self.observationThread.blockSignals(True) # pylint: disable=E1101
|
183
|
+
self.observationThread.wait(4000)
|
181
184
|
self.observationThread = None
|
182
185
|
super(DataWatcherWidget, self).close()
|
183
186
|
|
@@ -266,6 +269,7 @@ class DataWatcherWidget(_DataWatcher, qt.QMainWindow):
|
|
266
269
|
self._filterQLE.setToolTip(
|
267
270
|
"You can provide a Linux Regular Expression that will insure only file fitting the expression will be discovered"
|
268
271
|
)
|
272
|
+
self._filterQLE.setPlaceholderText("*file_pattern*")
|
269
273
|
widget.layout().addWidget(self._filterQLE)
|
270
274
|
self._filterQLE.editingFinished.connect(self._restartObservation)
|
271
275
|
self._filterQLE.editingFinished.connect(self._filterChanged)
|
@@ -375,8 +379,8 @@ class DataWatcherWidget(_DataWatcher, qt.QMainWindow):
|
|
375
379
|
if self.observationThread is not None:
|
376
380
|
# remove connection
|
377
381
|
self._disconnectObserverThread()
|
378
|
-
self.observationThread.blockSignals(True)
|
379
|
-
self.observationThread.wait()
|
382
|
+
self.observationThread.blockSignals(True) # pylint: disable=E1101
|
383
|
+
self.observationThread.wait(4000)
|
380
384
|
|
381
385
|
if sucess is False:
|
382
386
|
self._setCurrentStatus(str("not processing"))
|
@@ -410,7 +414,7 @@ class DataWatcherWidget(_DataWatcher, qt.QMainWindow):
|
|
410
414
|
|
411
415
|
def _setIsObserving(self, b):
|
412
416
|
_DataWatcher._setIsObserving(self, b)
|
413
|
-
if
|
417
|
+
if self.isObserving is True: # pylint: disable=E1101
|
414
418
|
self._qpbstartstop.setText(self._textStopObservation)
|
415
419
|
else:
|
416
420
|
self._qpbstartstop.setText(self._textStartObservation)
|
@@ -447,7 +451,7 @@ class DataWatcherWidget(_DataWatcher, qt.QMainWindow):
|
|
447
451
|
widget.setLayout(layout)
|
448
452
|
return widget
|
449
453
|
|
450
|
-
def _setFolderPath(self):
|
454
|
+
def _setFolderPath(self): # pragma: no cover
|
451
455
|
"""
|
452
456
|
Ask the user the path to the folder to observe
|
453
457
|
"""
|
@@ -542,7 +546,7 @@ class DataWatcherWidget(_DataWatcher, qt.QMainWindow):
|
|
542
546
|
if not self.__threadAnimation.isRunning():
|
543
547
|
self.__threadAnimation.start()
|
544
548
|
elif self.__threadAnimation is not None:
|
545
|
-
self.__threadAnimation.wait()
|
549
|
+
self.__threadAnimation.wait(4000)
|
546
550
|
elif self.currentStatus == "acquisition ended":
|
547
551
|
self._setStateIcon(silxicons.getQIcon("selected"))
|
548
552
|
elif self.currentStatus == "failure":
|
@@ -578,7 +582,7 @@ class DataWatcherWidget(_DataWatcher, qt.QMainWindow):
|
|
578
582
|
_scan = ScanFactory.create_scan_object(scan_path=scan)
|
579
583
|
except Exception as e:
|
580
584
|
logger.error(
|
581
|
-
"Fail to create a TomoBase instance from
|
585
|
+
f"Fail to create a TomoBase instance from {scan} Reason is {e}"
|
582
586
|
)
|
583
587
|
return
|
584
588
|
else:
|
@@ -624,9 +628,12 @@ class DataWatcherWidget(_DataWatcher, qt.QMainWindow):
|
|
624
628
|
return
|
625
629
|
|
626
630
|
# manage data watcher observation
|
627
|
-
if
|
631
|
+
if (
|
632
|
+
self.observationThread is None
|
633
|
+
or not self.observationThread.isRunning() # pylint: disable=E1101
|
634
|
+
):
|
628
635
|
if self._initObservation() is False:
|
629
|
-
self.
|
636
|
+
self._setCurrentStatus("failure")
|
630
637
|
logger.info(
|
631
638
|
"failed on observation",
|
632
639
|
extra={logconfig.DOC_TITLE: self._scheme_title},
|
@@ -648,4 +655,7 @@ class DataWatcherWidget(_DataWatcher, qt.QMainWindow):
|
|
648
655
|
self.loopObservationThread.start()
|
649
656
|
|
650
657
|
def _observation_thread_running(self):
|
651
|
-
return
|
658
|
+
return (
|
659
|
+
self.observationThread is not None
|
660
|
+
and self.observationThread.isRunning() # pylint: disable=E1101
|
661
|
+
)
|
@@ -179,7 +179,7 @@ class _QOngoingObservation(_OngoingObservation, qt.QObject):
|
|
179
179
|
scan_path=scanID, accept_bliss_scan=True
|
180
180
|
)
|
181
181
|
except Exception as e:
|
182
|
-
logger.error("Fail to create TomoBase instance from
|
182
|
+
logger.error(f"Fail to create TomoBase instance from {scanID} Error is {e}")
|
183
183
|
else:
|
184
184
|
for scan in scans:
|
185
185
|
self.sigScanReady.emit(scan)
|
@@ -197,9 +197,6 @@ class _ObservedScanModel(qt.QAbstractTableModel):
|
|
197
197
|
return "(at least) {} over {}".format(
|
198
198
|
obs.n_acquired or "?", obs.tomo_n or "?"
|
199
199
|
)
|
200
|
-
elif HDF5TomoScan.directory_contains_scan(directory=obs):
|
201
|
-
scan = HDF5TomoScan(scan=obs)
|
202
|
-
return str(len(scan.projections))
|
203
200
|
elif os.path.exists(obs) and os.path.isdir(obs):
|
204
201
|
return str(len(os.listdir(obs)))
|
205
202
|
else:
|
@@ -1,5 +1,6 @@
|
|
1
1
|
from silx.gui import qt
|
2
2
|
import logging
|
3
|
+
from tomwer.gui.utils.qt_utils import block_signals
|
3
4
|
|
4
5
|
_logger = logging.getLogger(__name__)
|
5
6
|
|
@@ -8,22 +9,28 @@ class _SelectorWidget(qt.QWidget):
|
|
8
9
|
"""widget used to select a dataset on a list (a scan or a volume for now)"""
|
9
10
|
|
10
11
|
sigSelectionChanged = qt.Signal(list)
|
11
|
-
"""Signal emitted when the selection changed"""
|
12
|
+
"""Signal emitted when the selection changed. List elements are tomo object identifier as str"""
|
12
13
|
|
13
14
|
sigUpdated = qt.Signal()
|
14
15
|
"""signal emitted when the scan list change"""
|
15
16
|
|
16
17
|
def __init__(self, parent=None):
|
17
|
-
|
18
18
|
qt.QWidget.__init__(self, parent)
|
19
19
|
self.setLayout(qt.QVBoxLayout())
|
20
20
|
self.dataList = self._buildDataList()
|
21
21
|
self.dataList.setSelectionMode(qt.QAbstractItemView.ExtendedSelection)
|
22
22
|
self.layout().addWidget(self.dataList)
|
23
23
|
self.layout().addWidget(self._getAddAndRmButtons())
|
24
|
-
self.layout().addWidget(self.
|
24
|
+
self.layout().addWidget(self._getSendButtons())
|
25
25
|
self.setAcceptDrops(True)
|
26
26
|
|
27
|
+
# connect signal / slot
|
28
|
+
# for drag / drop we need to have an indirect call to the sigUpdated
|
29
|
+
self.dataList.listChanged.connect(self._updatedFromDragDrop)
|
30
|
+
|
31
|
+
def _updatedFromDragDrop(self, *args, **kwargs):
|
32
|
+
self.sigUpdated.emit()
|
33
|
+
|
27
34
|
def add(self, scan):
|
28
35
|
added_scans = self.dataList.add(scan)
|
29
36
|
self.sigUpdated.emit()
|
@@ -46,7 +53,7 @@ class _SelectorWidget(qt.QWidget):
|
|
46
53
|
self._addButton = qt.QPushButton("Add")
|
47
54
|
self._addButton.clicked.connect(self._callbackAddData)
|
48
55
|
self._rmButton = qt.QPushButton("Remove")
|
49
|
-
self._rmButton.clicked.connect(self.
|
56
|
+
self._rmButton.clicked.connect(self._callbackRemoveSelectedDatasets)
|
50
57
|
|
51
58
|
spacer = qt.QWidget(self)
|
52
59
|
spacer.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Minimum)
|
@@ -56,16 +63,24 @@ class _SelectorWidget(qt.QWidget):
|
|
56
63
|
|
57
64
|
return w
|
58
65
|
|
59
|
-
def
|
66
|
+
def _getSendButtons(self):
|
60
67
|
lLayout = qt.QHBoxLayout()
|
61
68
|
widget = qt.QWidget(self)
|
62
69
|
widget.setLayout(lLayout)
|
63
|
-
self._sendButton = qt.QPushButton("Select")
|
64
|
-
self._sendButton.clicked.connect(self._selectActiveData)
|
65
70
|
|
71
|
+
# spacer
|
66
72
|
spacer = qt.QWidget(self)
|
67
73
|
spacer.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Minimum)
|
68
74
|
lLayout.addWidget(spacer)
|
75
|
+
|
76
|
+
# send all button
|
77
|
+
self._sendAllButton = qt.QPushButton("Send all")
|
78
|
+
self._sendAllButton.clicked.connect(self._sendAll)
|
79
|
+
lLayout.addWidget(self._sendAllButton)
|
80
|
+
|
81
|
+
# send selected button
|
82
|
+
self._sendButton = qt.QPushButton("Send selected")
|
83
|
+
self._sendButton.clicked.connect(self._selectActiveData)
|
69
84
|
lLayout.addWidget(self._sendButton)
|
70
85
|
|
71
86
|
return widget
|
@@ -87,12 +102,17 @@ class _SelectorWidget(qt.QWidget):
|
|
87
102
|
else:
|
88
103
|
_logger.warning("No active scan detected")
|
89
104
|
|
90
|
-
def
|
105
|
+
def _sendAll(self):
|
106
|
+
allItems = list(self.dataList._myitems.keys())
|
107
|
+
if len(allItems) > 0:
|
108
|
+
self.sigSelectionChanged.emit(allItems)
|
109
|
+
|
110
|
+
def _callbackRemoveSelectedDatasets(self):
|
91
111
|
""" """
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
112
|
+
selected_items = self.dataList.selectedItems()
|
113
|
+
tomwer_objs_to_remove = [item.data(qt.Qt.UserRole) for item in selected_items]
|
114
|
+
for tomwer_obj in tomwer_objs_to_remove:
|
115
|
+
self.remove(tomwer_obj)
|
96
116
|
self.sigUpdated.emit()
|
97
117
|
|
98
118
|
def setActiveData(self, data):
|
@@ -104,3 +124,13 @@ class _SelectorWidget(qt.QWidget):
|
|
104
124
|
"""
|
105
125
|
data_id = data
|
106
126
|
self.dataList.setCurrentItem(self.dataList.items[data_id])
|
127
|
+
|
128
|
+
def removeSelectedDatasets(self):
|
129
|
+
sItem = self.dataList.selectedItems()
|
130
|
+
selection = [_item.text() for _item in sItem]
|
131
|
+
|
132
|
+
with block_signals(self):
|
133
|
+
# make sure sigUpdated is called only once.
|
134
|
+
for identifier in selection:
|
135
|
+
self.remove(identifier)
|
136
|
+
self.sigUpdated.emit()
|