fix(hutch cam): do not override internal ophyd name
This commit is contained in:
@@ -39,7 +39,7 @@ class HutchCam(PSIDeviceBase):
|
||||
super().__init__(name=name, scan_info=scan_info, **kwargs)
|
||||
self.scan_parameters: ScanServerScanInfo = None
|
||||
self.hostname = prefix
|
||||
self.name = ""
|
||||
self.camera_name = ""
|
||||
|
||||
# pylint: disable=E1101
|
||||
def on_connected(self) -> None:
|
||||
@@ -49,12 +49,14 @@ class HutchCam(PSIDeviceBase):
|
||||
info_url = f"http://{CAM_USERNAME}:{CAM_PASSWORD}@{self.hostname}.psi.ch/-wvhttp-01-/info.cgi?item=c.1.name"
|
||||
response = requests.get(info_url, timeout=5)
|
||||
response.raise_for_status()
|
||||
self.name = response.content.decode("utf-8").split("c.1.name.utf8:=")[-1].strip().lower()
|
||||
self.camera_name = (
|
||||
response.content.decode("utf-8").split("c.1.name.utf8:=")[-1].strip().lower()
|
||||
)
|
||||
|
||||
def on_stage(self) -> DeviceStatus:
|
||||
"""Called while staging the device."""
|
||||
self.scan_parameters = fetch_scan_info(self.scan_info)
|
||||
file_path = get_full_path(self.scan_info.msg, name=self.name).removesuffix("h5")
|
||||
file_path = get_full_path(self.scan_info.msg, name=self.camera_name).removesuffix("h5")
|
||||
|
||||
thread = threading.Thread(
|
||||
target=self.acquire_and_save_from_video, args=(file_path,), daemon=True
|
||||
|
||||
Reference in New Issue
Block a user