Fixes at the BL
This commit is contained in:
1 parent
d2c33605c0
commit
e2a66507c8
30 files changed
+82
-76
No files matched your search
@@ -1,4 +1,4 @@
|
||||
from aaredaqlib import SmargonCoordinate
|
||||
from aaredaqlib.coordinate import SmargonCoordinate
|
||||
from aaredaqlib.rotation_scan import RotationScanRequest
|
||||
|
||||
|
||||
|
||||
@@ -140,10 +140,11 @@ class BeamlineStatus(BaseModel):
|
||||
light: Annotated[float, Field(ge=0.0, le=100.0)]
|
||||
cryojet_K: float
|
||||
shutter_open: bool
|
||||
flux_ph_s: float
|
||||
|
||||
class SessionStatus(BaseModel):
|
||||
session: SessionsStateEnum = SessionsStateEnum.Vacant
|
||||
current_pgroup: str | None
|
||||
current_pgroup: str | None = None
|
||||
staff: bool = False
|
||||
|
||||
class DAQStatusModel(BaseModel):
|
||||
|
||||
@@ -3,9 +3,9 @@ from typing import Annotated
|
||||
|
||||
from pydantic import Field, AfterValidator
|
||||
|
||||
from aaredaqlib import Coordinate, positive_coords, SmargonCoordinate
|
||||
from aaredaqlib import SampleGeometryModel
|
||||
from aaredaqlib import ScanRequest
|
||||
from aaredaqlib.coordinate import Coordinate, positive_coords, SmargonCoordinate
|
||||
from aaredaqlib.sample_geometry import SampleGeometryModel
|
||||
from aaredaqlib.scan_request import ScanRequest
|
||||
|
||||
|
||||
def normalize_angle(angle_deg: float) -> float:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from aaredaqlib import SmargonCoordinate
|
||||
from aaredaqlib import ScanRequest
|
||||
from aaredaqlib.coordinate import SmargonCoordinate
|
||||
from aaredaqlib.scan_request import ScanRequest
|
||||
|
||||
|
||||
class RotationScanRequest(ScanRequest):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from aaredaqlib import ScanRequest
|
||||
from aaredaqlib.scan_request import ScanRequest
|
||||
|
||||
|
||||
class ScreeningScanRequest(ScanRequest):
|
||||
|
||||
+3
-2
@@ -14,8 +14,9 @@ dependencies = [
|
||||
"uvicorn==0.34.2",
|
||||
"ultralytics==8.3.133",
|
||||
"aareDB==0.1.1a4",
|
||||
"aaredaqlib==0.1.0",
|
||||
"jfjoch_client==1.0.0rc37"
|
||||
"jfjoch_client==1.0.0rc37",
|
||||
"opencv-python-headless==4.11.0.86",
|
||||
"python_multipart==0.0.20"
|
||||
]
|
||||
|
||||
[lint]
|
||||
|
||||
@@ -11,7 +11,7 @@ from aaredaqlib.models import (
|
||||
SampleShortInfo,
|
||||
PuckLoadedInfo,
|
||||
SampleShortInfoList,
|
||||
DAQStatusModel, BeamlineStatus, )
|
||||
DAQStatusModel, BeamlineStatus, SessionStatus, )
|
||||
from aaredaqlib.raster_grid import RasterGridRequest
|
||||
from aaredaqlib.rotation_scan import RotationScanRequest
|
||||
from aaredaqlib.sample_geometry import SampleGeometryModel
|
||||
@@ -712,7 +712,8 @@ class AareDAQ:
|
||||
ring_current_mA=self.__devs.ring_current,
|
||||
light=self.light,
|
||||
cryojet_K=self.__devs.cryojet_temp,
|
||||
shutter_open=self.__devs.shutter
|
||||
shutter_open=self.__devs.shutter,
|
||||
flux_ph_s=3.0e12
|
||||
)
|
||||
|
||||
@property
|
||||
@@ -723,6 +724,7 @@ class AareDAQ:
|
||||
busy=self.busy,
|
||||
geom=self.sample_geometry,
|
||||
bl=self.beamline_status,
|
||||
sample=self.sample
|
||||
sample=self.sample,
|
||||
session=SessionStatus()
|
||||
)
|
||||
|
||||
@@ -30,7 +30,7 @@ class BeamlineDevices:
|
||||
self.tell = TellClient(beamline)
|
||||
self.smargon = smargon.Smargon(beamline)
|
||||
|
||||
self.__energy_pv = PV(f"{BEAMLINE}-OP_DCCM:ENERGY1")
|
||||
self.__energy_pv = PV(f"{BEAMLINE}-OP-DCCM:ENERGY1")
|
||||
self.__ring_current_pv = PV(f"ARS07-DPCT-0100:CURR")
|
||||
self.__cryojet_temp = PV(f"{BEAMLINE}-ES-CRSM:TEMP_RBV")
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import sys
|
||||
|
||||
from PySide6.QtWidgets import QApplication, QDialog
|
||||
|
||||
from aaregui import MainWindow
|
||||
from aaregui import LoginDialog
|
||||
from aaregui.main_window import MainWindow
|
||||
from aaregui.widgets.login import LoginDialog
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
@@ -13,16 +13,16 @@ from aaredaqlib.coordinate import Coordinate, SmargonCoordinate
|
||||
from aaredaqlib.models import SampleShortInfoList, TokenData
|
||||
from aaredaqlib.sample_geometry import SampleGeometryModel
|
||||
|
||||
from aaregui import BeamlineControls
|
||||
from aaregui import DataCollectionSettings
|
||||
from aaregui import SampleQueuePanel
|
||||
from aaregui import StatusPanel
|
||||
from aaregui import TellSamplePanel
|
||||
from aaregui import SampleCameraThread
|
||||
from aaregui import DAQWorker
|
||||
from aaregui import SampleCameraImageLabel
|
||||
from aaregui import NoWheelScrollArea
|
||||
from aaregui import StatusBar
|
||||
from aaregui.panels.beamline_controls import BeamlineControls
|
||||
from aaregui.panels.data_collection_settings import DataCollectionSettings
|
||||
from aaregui.panels.sample_queue_panel import SampleQueuePanel
|
||||
from aaregui.panels.status_panel import StatusPanel
|
||||
from aaregui.panels.tell_sample_panel import TellSamplePanel
|
||||
from aaregui.threads.camera_thread import SampleCameraThread
|
||||
from aaregui.threads.daq_worker import DAQWorker
|
||||
from aaregui.widgets.camera_image import SampleCameraImageLabel
|
||||
from aaregui.widgets.no_wheel_scroll_area import NoWheelScrollArea
|
||||
from aaregui.widgets.status_bar import StatusBar
|
||||
|
||||
|
||||
# Subclass QMainWindow to define the behavior of your application
|
||||
|
||||
@@ -4,9 +4,9 @@ from PySide6.QtWidgets import QWidget, QGridLayout, QLabel, QPushButton
|
||||
from aaredaqlib.coordinate import Coordinate
|
||||
from aaredaqlib.models import DAQStatusModel
|
||||
|
||||
from aaregui import ButtonWithPayload
|
||||
from aaregui import NumberLineEdit
|
||||
from aaregui import TitleLabel
|
||||
from aaregui.widgets.button_with_payload import ButtonWithPayload
|
||||
from aaregui.widgets.number_line_edit import NumberLineEdit
|
||||
from aaregui.widgets.title_label import TitleLabel
|
||||
|
||||
|
||||
class AbrTweakButtons(QWidget):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from PySide6.QtCore import Signal, Slot
|
||||
from PySide6.QtWidgets import QWidget, QGridLayout, QPushButton
|
||||
|
||||
from aaregui import TitleLabel
|
||||
from aaregui.widgets.title_label import TitleLabel
|
||||
|
||||
|
||||
class BeamCenterWidget(QWidget):
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
from PySide6.QtWidgets import QFrame, QVBoxLayout
|
||||
|
||||
from aaregui import AbrTweakWidget
|
||||
from aaregui import BeamCenterWidget
|
||||
from aaregui import BeamlineStatePanel
|
||||
from aaregui import IlluminationPanel
|
||||
from aaregui import LoopCenteringPanel
|
||||
from aaregui import OmegaPanel
|
||||
from aaregui import SmargonPanel
|
||||
from aaregui import ZoomPanel
|
||||
from aaregui.panels.abr_tweak_panel import AbrTweakWidget
|
||||
from aaregui.panels.beam_center_panel import BeamCenterWidget
|
||||
from aaregui.panels.beamline_state_panel import BeamlineStatePanel
|
||||
from aaregui.panels.illumination_panel import IlluminationPanel
|
||||
from aaregui.panels.loop_centering_panel import LoopCenteringPanel
|
||||
from aaregui.panels.omega_panel import OmegaPanel
|
||||
from aaregui.panels.smargon_panel import SmargonPanel
|
||||
from aaregui.panels.zoom_panel import ZoomPanel
|
||||
|
||||
|
||||
class BeamlineControls(QFrame):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from PySide6.QtWidgets import QWidget, QGridLayout, QPushButton
|
||||
|
||||
from aaregui import TitleLabel
|
||||
from aaregui.widgets.title_label import TitleLabel
|
||||
|
||||
|
||||
class BeamlineStatePanel(QWidget):
|
||||
|
||||
@@ -12,12 +12,12 @@ from aaredaqlib.rotation_scan import RotationScanRequest
|
||||
from aaredaqlib.sample_geometry import SampleGeometryModel
|
||||
from aaredaqlib.screening_scan import ScreeningScanRequest
|
||||
|
||||
from aaregui import FilePathPanel
|
||||
from aaregui import HelicalDataCollectionPanel
|
||||
from aaregui import RasterDataCollectionPanel
|
||||
from aaregui import ScreeningDataCollectionPanel
|
||||
from aaregui import StandardDataCollectionPanel
|
||||
from aaregui import TitleLabel
|
||||
from aaregui.panels.file_path_panel import FilePathPanel
|
||||
from aaregui.panels.helical_scan_panel import HelicalDataCollectionPanel
|
||||
from aaregui.panels.raster_data_collection import RasterDataCollectionPanel
|
||||
from aaregui.panels.screening_data_collection import ScreeningDataCollectionPanel
|
||||
from aaregui.panels.standard_data_collection import StandardDataCollectionPanel
|
||||
from aaregui.widgets.title_label import TitleLabel
|
||||
|
||||
|
||||
class DataCollectionSettings(QFrame):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from PySide6.QtWidgets import QWidget, QGridLayout, QLabel, QLineEdit
|
||||
|
||||
from aaregui import TitleLabel
|
||||
from aaregui.widgets.title_label import TitleLabel
|
||||
|
||||
|
||||
class FilePathPanel(QWidget):
|
||||
|
||||
@@ -12,7 +12,7 @@ from aaredaqlib.helical_geometry import HelicalScanRequest
|
||||
from aaredaqlib.models import DAQStatusModel
|
||||
from aaredaqlib.sample_geometry import SampleGeometryModel
|
||||
|
||||
from aaregui import NumberLineEdit
|
||||
from aaregui.widgets.number_line_edit import NumberLineEdit
|
||||
|
||||
|
||||
class HelicalDataCollectionPanel(QWidget):
|
||||
|
||||
@@ -2,7 +2,7 @@ from PySide6.QtCore import Qt, Signal, Slot
|
||||
from PySide6.QtWidgets import QWidget, QGridLayout, QSlider
|
||||
from aaredaqlib.models import DAQStatusModel
|
||||
|
||||
from aaregui import TitleLabel
|
||||
from aaregui.widgets.title_label import TitleLabel
|
||||
|
||||
|
||||
class IlluminationPanel(QWidget):
|
||||
@@ -35,4 +35,4 @@ class IlluminationPanel(QWidget):
|
||||
@Slot(DAQStatusModel)
|
||||
def update_daq_status(self, s: DAQStatusModel):
|
||||
if not self.is_sliding: # Update only if not sliding
|
||||
self.slider.setValue(round(s.light))
|
||||
self.slider.setValue(round(s.bl.light))
|
||||
@@ -1,6 +1,6 @@
|
||||
from PySide6.QtWidgets import QWidget, QGridLayout, QPushButton
|
||||
|
||||
from aaregui import TitleLabel
|
||||
from aaregui.widgets.title_label import TitleLabel
|
||||
|
||||
|
||||
class LoopCenteringPanel(QWidget):
|
||||
|
||||
@@ -2,9 +2,9 @@ from PySide6.QtCore import Signal, Slot
|
||||
from PySide6.QtWidgets import QWidget, QGridLayout, QLabel, QHBoxLayout
|
||||
from aaredaqlib.models import DAQStatusModel
|
||||
|
||||
from aaregui import ButtonWithPayload
|
||||
from aaregui import NumberLineEdit
|
||||
from aaregui import TitleLabel
|
||||
from aaregui.widgets.button_with_payload import ButtonWithPayload
|
||||
from aaregui.widgets.number_line_edit import NumberLineEdit
|
||||
from aaregui.widgets.title_label import TitleLabel
|
||||
|
||||
|
||||
class OmegaEntryWidget(QWidget):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from PySide6.QtCore import Signal, Slot
|
||||
from PySide6.QtWidgets import QWidget, QGridLayout, QLabel, QSizePolicy, QSpacerItem
|
||||
|
||||
from aaregui import NumberLineEdit
|
||||
from aaregui.widgets.number_line_edit import NumberLineEdit
|
||||
|
||||
|
||||
class RasterDataCollectionPanel(QWidget):
|
||||
|
||||
@@ -3,8 +3,8 @@ from PySide6.QtWidgets import QFrame, QVBoxLayout, QHBoxLayout, QPushButton, QHe
|
||||
QTableView
|
||||
from aaredaqlib.models import SampleShortInfoList, SampleShortInfo
|
||||
|
||||
from aaregui import SampleQueueSpreadsheet
|
||||
from aaregui import TitleLabel
|
||||
from aaregui.models.sample_queue_model import SampleQueueSpreadsheet
|
||||
from aaregui.widgets.title_label import TitleLabel
|
||||
|
||||
|
||||
class SampleQueuePanel(QFrame):
|
||||
|
||||
@@ -7,7 +7,7 @@ from PySide6.QtWidgets import (
|
||||
QSpacerItem,
|
||||
)
|
||||
|
||||
from aaregui import NumberLineEdit
|
||||
from aaregui.widgets.number_line_edit import NumberLineEdit
|
||||
|
||||
|
||||
class ScreeningDataCollectionPanel(QWidget):
|
||||
|
||||
@@ -2,9 +2,9 @@ from PySide6.QtCore import Signal, Slot
|
||||
from PySide6.QtWidgets import QWidget, QGridLayout, QLabel, QPushButton
|
||||
|
||||
from aaredaqlib.models import DAQStatusModel
|
||||
from aaregui import ButtonWithPayload
|
||||
from aaregui import NumberLineEdit
|
||||
from aaregui import TitleLabel
|
||||
from aaregui.widgets.button_with_payload import ButtonWithPayload
|
||||
from aaregui.widgets.number_line_edit import NumberLineEdit
|
||||
from aaregui.widgets.title_label import TitleLabel
|
||||
from aaredaqlib.coordinate import SmargonCoordinate, Coordinate
|
||||
from aaredaqlib.sample_geometry import SampleGeometryModel
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from PySide6.QtWidgets import QWidget, QGridLayout, QLabel, QSpacerItem, QSizePolicy
|
||||
|
||||
from aaregui import NumberLineEdit
|
||||
from aaregui.widgets.number_line_edit import NumberLineEdit
|
||||
|
||||
|
||||
class StandardDataCollectionPanel(QWidget):
|
||||
|
||||
@@ -4,8 +4,8 @@ from PySide6.QtWidgets import QFrame, QGridLayout, QLabel, QSpacerItem, QSizePol
|
||||
from aaredaqlib.models import DAQStatusModel
|
||||
from aaredaqlib.sample_geometry import SampleGeometryModel
|
||||
|
||||
from aaregui import StatusLabel
|
||||
from aaregui import TitleLabel
|
||||
from aaregui.widgets.status_label import StatusLabel
|
||||
from aaregui.widgets.title_label import TitleLabel
|
||||
|
||||
|
||||
class StatusPanel(QFrame):
|
||||
@@ -62,3 +62,5 @@ class StatusPanel(QFrame):
|
||||
self.beam_size.setText(
|
||||
f"<b>{s.geom.beam_size_mm.x * 1000.0}</b> x <b>{s.geom.beam_size_mm.y * 1000.0}</b>"
|
||||
)
|
||||
self.ring_current.setText(f"<b>{s.bl.ring_current_mA:.1f}</b>")
|
||||
self.flux.setText(f"<b>{(s.bl.flux_ph_s / 1e9):.2f}</b>")
|
||||
@@ -11,8 +11,8 @@ from PySide6.QtWidgets import (
|
||||
)
|
||||
from aaredaqlib.models import BeamlineStateEnum, SampleShortInfo, SampleShortInfoList, DAQStatusModel
|
||||
|
||||
from aaregui import UserSampleSpreadsheet
|
||||
from aaregui import TitleLabel
|
||||
from aaregui.models.user_sample_model import UserSampleSpreadsheet
|
||||
from aaregui.widgets.title_label import TitleLabel
|
||||
|
||||
|
||||
class TellSamplePanel(QFrame):
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from PySide6.QtCore import Slot, Signal
|
||||
from PySide6.QtWidgets import QWidget, QGridLayout
|
||||
|
||||
from aaregui import ButtonWithPayload
|
||||
from aaregui import TitleLabel
|
||||
from aaregui.widgets.button_with_payload import ButtonWithPayload
|
||||
from aaregui.widgets.title_label import TitleLabel
|
||||
|
||||
|
||||
class ZoomPanel(QWidget):
|
||||
|
||||
@@ -22,7 +22,7 @@ from PySide6.QtWidgets import (
|
||||
)
|
||||
|
||||
from aaredaqlib.models import DAQStatusModel
|
||||
from aaregui import SmargonBookmarkList
|
||||
from aaregui.models.bookmark import SmargonBookmarkList
|
||||
from aaredaqlib.coordinate import Coordinate, SmargonCoordinate
|
||||
from aaredaqlib.raster_grid import RasterGridRequest
|
||||
from aaredaqlib.sample_geometry import SampleGeometryModel
|
||||
@@ -52,7 +52,7 @@ class SampleCameraImageLabel(QGraphicsView):
|
||||
|
||||
self.__pixmap = QPixmap("/home/leonarski_f/loop200.jpg")
|
||||
self.__geom = geom
|
||||
self.__bookmarks: SmargonBookmarkList = SmargonBookmarkList(b=[])
|
||||
self.__bookmarks: SmargonBookmarkList = SmargonBookmarkList()
|
||||
self.__autoscale = True
|
||||
self.__show_coords = False
|
||||
self.__helical_start = SmargonCoordinate()
|
||||
|
||||
@@ -2,8 +2,8 @@ from PySide6.QtCore import Signal, Slot, QPoint
|
||||
from PySide6.QtWidgets import QStatusBar, QDialog, QMenu
|
||||
|
||||
from aaredaqlib.models import TokenData, BeamlineStateEnum, DAQStatusModel, SessionsStateEnum
|
||||
from aaregui import ClickableLabel
|
||||
from aaregui import PGroupDialog
|
||||
from aaregui.widgets.clickable_label import ClickableLabel
|
||||
from aaregui.widgets.pgroup_dialog import PGroupDialog
|
||||
|
||||
|
||||
class StatusBar(QStatusBar):
|
||||
@@ -38,8 +38,8 @@ class StatusBar(QStatusBar):
|
||||
|
||||
@Slot(DAQStatusModel)
|
||||
def update_daq_status(self, status: DAQStatusModel):
|
||||
if status.current_pgroup is not None:
|
||||
self.pgroup_label.setText(f"""p-group: {status.current_pgroup} """)
|
||||
if status.session.current_pgroup is not None:
|
||||
self.pgroup_label.setText(f"""p-group: {status.session.current_pgroup} """)
|
||||
else:
|
||||
self.pgroup_label.setText(f"Inactive p-group ")
|
||||
|
||||
@@ -73,11 +73,11 @@ class StatusBar(QStatusBar):
|
||||
self.busy_label.setText(html_content)
|
||||
|
||||
session_flag = ""
|
||||
if status.session == SessionsStateEnum.Vacant:
|
||||
if status.session.session == SessionsStateEnum.Vacant:
|
||||
session_flag = """<span style="color: yellow ; "> Vacant ⬤ </span>"""
|
||||
elif status.session == SessionsStateEnum.OwnedByYou:
|
||||
elif status.session.session == SessionsStateEnum.OwnedByYou:
|
||||
session_flag = """<span style="color: green ; "> Owned ⬤ </span>"""
|
||||
elif status.session == SessionsStateEnum.OwnedByElse:
|
||||
elif status.session.session == SessionsStateEnum.OwnedByElse:
|
||||
session_flag = """<span style="color: red ; "> Other ⬤ </span>"""
|
||||
|
||||
html_content_session = f"""Session: {session_flag}"""
|
||||
|
||||
Reference in new issue
Block a user