Skip to content

Commit 17685d1

Browse files
committedFeb 6, 2015
controller manager skeleton
1 parent 2f06574 commit 17685d1

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
 

Diff for: ‎artiq/frontend/artiq_ctlmgr.py

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env python3
2+
3+
import asyncio
4+
import argparse
5+
import os
6+
7+
from artiq.protocols.sync_struct import Subscriber
8+
9+
10+
def get_argparser():
11+
parser = argparse.ArgumentParser(description="ARTIQ controller manager")
12+
parser.add_argument(
13+
"-s", "--server", default="::1",
14+
help="hostname or IP of the master to connect to")
15+
parser.add_argument(
16+
"--port", default=3250, type=int,
17+
help="TCP port to use to connect to the master")
18+
return parser
19+
20+
21+
def main():
22+
args = get_argparser().parse_args()
23+
24+
if os.name == "nt":
25+
loop = asyncio.ProactorEventLoop()
26+
asyncio.set_event_loop(loop)
27+
else:
28+
loop = asyncio.get_event_loop()
29+
try:
30+
subscriber = Subscriber("master_ddb", lambda x: x)
31+
loop.run_until_complete(subscriber.connect(args.server, args.port))
32+
try:
33+
loop.run_forever()
34+
finally:
35+
loop.run_until_complete(subscriber.close())
36+
finally:
37+
loop.close()
38+
39+
if __name__ == "__main__":
40+
main()

Diff for: ‎doc/manual/management_system.rst

+7
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@ GUI client
2121
.. argparse::
2222
:ref: artiq.frontend.artiq_gui.get_argparser
2323
:prog: artiq_gui
24+
25+
Controller manager
26+
------------------
27+
28+
.. argparse::
29+
:ref: artiq.frontend.artiq_ctlmgr.get_argparser
30+
:prog: artiq_ctlmgr

Diff for: ‎setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"console_scripts": [
2929
"artiq_client=artiq.frontend.artiq_client:main",
3030
"artiq_ctlid=artiq.frontend.artiq_ctlid:main",
31+
"artiq_ctlmgr=artiq.frontend.artiq_ctlmgr:main",
3132
"artiq_gui=artiq.frontend.artiq_gui:main",
3233
"artiq_master=artiq.frontend.artiq_master:main",
3334
"artiq_run=artiq.frontend.artiq_run:main",

0 commit comments

Comments
 (0)
Please sign in to comment.