Skip to content

Commit 2fbe22e

Browse files
committedJan 30, 2015
master,client: support changing real-time results group
1 parent 9bfc207 commit 2fbe22e

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed
 

Diff for: ‎artiq/frontend/artiq_client.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ def get_argparser():
4242
help="specify a timeout for the experiment to complete")
4343
parser_add.add_argument("-u", "--unit", default=None,
4444
help="unit to run")
45+
parser_add.add_argument("--rtr-group", default=None, type=str,
46+
help="real-time result group "
47+
"(defaults to filename)")
4548
parser_add.add_argument("file", help="file containing the unit to run")
4649
parser_add.add_argument("arguments", nargs="*",
4750
help="run arguments")
@@ -101,7 +104,9 @@ def _action_submit(remote, args):
101104
run_params = {
102105
"file": args.file,
103106
"unit": args.unit,
104-
"arguments": arguments
107+
"arguments": arguments,
108+
"rtr_group": args.rtr_group if args.rtr_group is not None \
109+
else args.file
105110
}
106111
if args.timed is None:
107112
rid = remote.run_queued(run_params, args.timeout)

Diff for: ‎artiq/frontend/artiq_master.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ def main():
4343
loop = asyncio.get_event_loop()
4444
atexit.register(lambda: loop.close())
4545

46+
def run_cb(rid, run_params):
47+
rtr.current_group = run_params["rtr_group"]
4648
scheduler = Scheduler({
4749
"req_device": ddb.request,
4850
"req_parameter": pdb.request,
4951
"set_parameter": pdb.set,
5052
"init_rt_results": rtr.init,
5153
"update_rt_results": rtr.update
52-
})
54+
}, run_cb)
5355
loop.run_until_complete(scheduler.start())
5456
atexit.register(lambda: loop.run_until_complete(scheduler.stop()))
5557

Diff for: ‎artiq/gui/explorer.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ def run(self, widget):
136136
run_params = {
137137
"file": data["file"],
138138
"unit": data["unit"],
139-
"arguments": arguments
139+
"arguments": arguments,
140+
"rtr_group": data["file"]
140141
}
141142
asyncio.Task(self.schedule_ctl.run_queued(run_params, None))

Diff for: ‎artiq/master/scheduler.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77

88
class Scheduler:
9-
def __init__(self, worker_handlers):
9+
def __init__(self, worker_handlers, run_cb):
10+
self.run_cb = run_cb
1011
self.worker = Worker(worker_handlers)
1112
self.next_rid = 0
1213
self.queue = Notifier([])
@@ -64,6 +65,7 @@ def cancel_timed(self, trid):
6465

6566
@asyncio.coroutine
6667
def _run(self, rid, run_params, timeout):
68+
self.run_cb(rid, run_params)
6769
try:
6870
yield from self.worker.run(run_params, timeout)
6971
except Exception as e:

0 commit comments

Comments
 (0)
Please sign in to comment.