GUI: More adjustments to paths
This commit is contained in:
1 parent
47d24e17d1
commit
e879c1b757
2 files changed
+14
-4
No files matched your search
@@ -8,8 +8,11 @@ from aaredaqlib.models import SampleShortInfo
|
||||
from aaregui.widgets.title_label import TitleLabel
|
||||
|
||||
## Logic for filenames:
|
||||
## 1. Rasters are always placed in raster/ subfolder (managed by DAQ)
|
||||
|
||||
## 1. For rasters 'raster/' subfolder is added at the top level of the path (managed by DAQ) - e.g. rasters/20250101/PX-456/01/dataset
|
||||
## 2. For screening 'screening/' subfolder is added at the last level of the path (managed by GUI) - e.g. 20250101/PX-456/01/dataset/screening
|
||||
## 3. If sample is not registered in the database, it is by default placed in test/<date>
|
||||
## 4. If sample is registered in the database and has puck information, it is by default placed in <date>/<puck name>/<puck pos>/
|
||||
## 5. If sample is registered in the database as manual, it is by default placed in <date>/manual/<sample name>
|
||||
|
||||
class FilePathPanel(QWidget):
|
||||
path_updated = Signal(str)
|
||||
@@ -141,7 +144,7 @@ class FilePathPanel(QWidget):
|
||||
self.__puck_pos = sample.pin
|
||||
self.run_number_edit.setValue(1)
|
||||
if sample.location is not None:
|
||||
self.directory_edit.setText(f"{self.__formatted_date}/{self.__puck_name}/{self.__puck_pos}")
|
||||
self.directory_edit.setText(f"{self.__formatted_date}/{self.__puck_name}/{self.__puck_pos:02d}")
|
||||
else:
|
||||
self.directory_edit.setText(f"{self.__formatted_date}/manual/{self.__sample_name}")
|
||||
self.update_filename()
|
||||
@@ -1,3 +1,5 @@
|
||||
from pathlib import Path
|
||||
|
||||
from PySide6.QtCore import Slot, Signal, Qt
|
||||
from PySide6.QtWidgets import QLabel, QComboBox, QPushButton
|
||||
|
||||
@@ -8,6 +10,11 @@ from aaregui.panels.scan_settings_panel import ScanSettingsPanel
|
||||
from aaregui.widgets.number_line_edit import NumberLineEdit
|
||||
|
||||
|
||||
def add_screening_to_path(path):
|
||||
p = Path(path)
|
||||
return p.parent / "screening" / p.name
|
||||
|
||||
|
||||
class RotationDataCollectionPanel(ScanSettingsPanel):
|
||||
rotation_scan = Signal(RotationScanRequest)
|
||||
|
||||
@@ -97,7 +104,7 @@ class RotationDataCollectionPanel(ScanSettingsPanel):
|
||||
def run_screening(self):
|
||||
screening_settings = self.screening_type.currentData()
|
||||
r = RotationScanRequest(
|
||||
file_prefix=self._filename,
|
||||
file_prefix=str(add_screening_to_path(self._filename)),
|
||||
start_omega_deg=self.start_angle.value,
|
||||
wedge_omega_deg=self.screening_image_angle.value,
|
||||
incr_omega_deg=screening_settings["omega_step_deg"],
|
||||
|
||||
Reference in new issue
Block a user