Skip to content

Commit

Permalink
Only create controller once
Browse files Browse the repository at this point in the history
  • Loading branch information
GDYendell committed Nov 28, 2023
1 parent 63ff25f commit ab39bfd
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions src/eiger_fastcs/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,24 @@

def get_controller() -> EigerController:
ip_settings = IPConnectionSettings("127.0.0.1", 8080)
tcont = EigerController(ip_settings)
return tcont
return EigerController(ip_settings)


# TODO: Maybe combine this with test_ioc
def create_gui() -> None:
tcont = get_controller()
m = Mapping(tcont)
def create_gui(controller) -> None:
m = Mapping(controller)
backend = EpicsBackend(m)
backend.create_gui()


def test_ioc() -> None:
tcont = get_controller()
m = Mapping(tcont)
def test_ioc(controller) -> None:
m = Mapping(controller)
backend = EpicsBackend(m)
ioc = backend.get_ioc()

ioc.run()


def test_asyncio_backend() -> None:
tcont = get_controller()
m = Mapping(tcont)
def test_asyncio_backend(controller) -> None:
m = Mapping(controller)
backend = AsyncioBackend(m)
backend.run_interactive_session()

Expand All @@ -46,8 +40,9 @@ def main(args=None):
parser.add_argument("-v", "--version", action="version", version=__version__)
args = parser.parse_args(args)

create_gui()
test_ioc()
controller = get_controller()
create_gui(controller)
test_ioc(controller)


# test with: python -m eiger_fastcs
Expand Down

0 comments on commit ab39bfd

Please sign in to comment.