From 18f5cd59f653cf6a4881bcfb63ebc263d6130314 Mon Sep 17 00:00:00 2001 From: Gary Yendell Date: Mon, 24 Jun 2024 14:18:45 +0000 Subject: [PATCH] Configure to write bob UIs to /epics/opi if it exists --- src/eiger_fastcs/__main__.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/eiger_fastcs/__main__.py b/src/eiger_fastcs/__main__.py index 2849ded..484f993 100644 --- a/src/eiger_fastcs/__main__.py +++ b/src/eiger_fastcs/__main__.py @@ -40,16 +40,22 @@ def main( EigerUrl = typer.Option("127.0.0.1", help="URL of Eiger detector") EigerPort = typer.Option(8081, help="Port of Eiger HTTP server") +OPI_PATH = Path("/epics/opi") + @app.command() -def ioc(pv_prefix: str = typer.Argument(), url: str = EigerUrl, port: int = EigerPort): +def ioc( + pv_prefix: str = typer.Argument(), + url: str = EigerUrl, + port: int = EigerPort, +): + ui_path = OPI_PATH if OPI_PATH.is_dir() else Path.cwd() + mapping = get_controller_mapping(url, port) backend = EpicsBackend(mapping, pv_prefix) backend.create_gui( - EpicsGUIOptions( - output_path=Path.cwd() / "eiger.bob", title=f"Eiger - {pv_prefix}" - ) + EpicsGUIOptions(output_path=ui_path / "eiger.bob", title=f"Eiger - {pv_prefix}") ) backend.get_ioc().run()