forked from M-Labs/artiq
1
0
Fork 0

gui: add basic parameters window

This commit is contained in:
Sebastien Bourdeauducq 2014-12-31 11:11:38 +08:00
parent 3566cd1ce0
commit cda394e0ce
3 changed files with 30 additions and 7 deletions

19
artiq/gui/parameters.py Normal file
View File

@ -0,0 +1,19 @@
from gi.repository import Gtk
from artiq.gui.tools import Window
class ParametersWindow(Window):
def __init__(self):
Window.__init__(self, title="Parameters")
self.set_default_size(500, 500)
self.parameters_store = Gtk.ListStore(str, str)
tree = Gtk.TreeView(self.parameters_store)
for i, title in enumerate(["Parameter", "Value"]):
renderer = Gtk.CellRendererText()
column = Gtk.TreeViewColumn(title, renderer, text=i)
tree.append_column(column)
scroll = Gtk.ScrolledWindow()
scroll.add(tree)
self.add(scroll)

View File

@ -89,7 +89,6 @@ class SchedulerWindow(Window):
hbox = Gtk.HBox(spacing=6)
enable = Gtk.Switch(active=True)
label = Gtk.Label("Run experiments")
label.set_justify(Gtk.Justification.RIGHT)
hbox.pack_start(label, False, False, 0)
hbox.pack_start(enable, False, False, 0)
topvbox.pack_start(hbox, False, False, 0)

View File

@ -7,6 +7,7 @@ import gbulb
from gi.repository import Gtk
from artiq.gui.scheduler import SchedulerWindow
from artiq.gui.parameters import ParametersWindow
def _get_args():
@ -29,16 +30,20 @@ def main():
asyncio.set_event_loop_policy(gbulb.GtkEventLoopPolicy())
loop = asyncio.get_event_loop()
try:
win = SchedulerWindow()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
scheduler_win = SchedulerWindow()
scheduler_win.connect("delete-event", Gtk.main_quit)
scheduler_win.show_all()
loop.run_until_complete(win.sub_connect(args.server,
args.port_schedule_notify))
parameters_win = ParametersWindow()
parameters_win.connect("delete-event", Gtk.main_quit)
parameters_win.show_all()
loop.run_until_complete(scheduler_win.sub_connect(
args.server, args.port_schedule_notify))
try:
loop.run_forever()
finally:
loop.run_until_complete(win.sub_close())
loop.run_until_complete(scheduler_win.sub_close())
finally:
loop.close()