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()