Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding configurable url as an option on ioc/asyncio command #24

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/odin_fastcs/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@
pass


OdinIp = typer.Option("127.0.0.1", help="IP address of odin server")
OdinPort = typer.Option(8888, help="Port of odin server")


@app.command()
def ioc(pv_prefix: str = typer.Argument()):
def ioc(pv_prefix: str = typer.Argument(), ip: str = OdinIp, port: int = OdinPort):
from fastcs.backends.epics.backend import EpicsBackend

controller = OdinController(IPConnectionSettings("127.0.0.1", 8888))
controller = OdinController(IPConnectionSettings(ip, port))

Check warning on line 50 in src/odin_fastcs/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/odin_fastcs/__main__.py#L50

Added line #L50 was not covered by tests

backend = EpicsBackend(controller, pv_prefix)
backend.create_gui(
Expand All @@ -55,8 +59,8 @@


@app.command()
def asyncio():
controller = OdinController(IPConnectionSettings("127.0.0.1", 8888))
def asyncio(ip: str = OdinIp, port: int = OdinPort):
controller = OdinController(IPConnectionSettings(ip, port))

Check warning on line 63 in src/odin_fastcs/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/odin_fastcs/__main__.py#L63

Added line #L63 was not covered by tests

backend = AsyncioBackend(controller)
backend.run()
Expand Down