def __init__(self, **kwargs): Window.__init__(self, title="Parameters", default_size=(500, 500), **kwargs) notebook = Gtk.Notebook() self.add(notebook) 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) notebook.insert_page(scroll, Gtk.Label("Current values"), -1) self.lastchanges_store = Gtk.ListStore(str, str, str) tree = Gtk.TreeView(self.lastchanges_store) for i, title in enumerate(["Time", "Parameter", "Value"]): renderer = Gtk.CellRendererText() column = Gtk.TreeViewColumn(title, renderer, text=i) tree.append_column(column) scroll = Gtk.ScrolledWindow() scroll.add(tree) notebook.insert_page(scroll, Gtk.Label("Last changes"), -1)
def __init__(self, set_names): self.set_names = set_names self.data = None Window.__init__(self, title="/".join(set_names), default_size=(700, 500)) self.darea = Gtk.DrawingArea() self.darea.set_size_request(100, 100) self.darea.connect("draw", self.on_draw) self.add(self.darea)
def __init__(self, group_name, set_names): self.labels = dict() Window.__init__(self, title=group_name + ": Raw values", default_size=(200, 150)) grid = Gtk.Grid(row_spacing=6, column_spacing=6) self.add(grid) for i, name in enumerate(set_names): grid.attach(Gtk.Label(name), 0, i, 1, 1) label = Gtk.Label("-") self.labels[name] = label grid.attach(label, 1, i, 1, 1)
def __init__(self, schedule_ctl, repository, layout_dict=dict()): self.schedule_ctl = schedule_ctl self.repository = repository Window.__init__(self, title="Explorer", default_size=(800, 570), layout_dict=layout_dict) topvbox = Gtk.VBox(spacing=6) self.add(topvbox) menubar = Gtk.MenuBar() topvbox.pack_start(menubar, False, False, 0) windows = Gtk.MenuItem("Windows") windows_menu = Gtk.Menu() scheduler = Gtk.MenuItem("Scheduler") parameters = Gtk.MenuItem("Parameters") quit = Gtk.MenuItem("Quit") windows_menu.append(scheduler) windows_menu.append(parameters) windows_menu.append(Gtk.SeparatorMenuItem()) windows_menu.append(quit) windows.set_submenu(windows_menu) menubar.append(windows) self.pane = Gtk.HPaned( position=getitem(layout_dict, "pane_position", 180)) topvbox.pack_start(self.pane, True, True, 0) listvbox = Gtk.VBox(spacing=6) self.pane.pack1(listvbox) self.list_store = Gtk.ListStore(str) self.list_tree = Gtk.TreeView(self.list_store) scroll = Gtk.ScrolledWindow() scroll.add(self.list_tree) listvbox.pack_start(scroll, True, True, 0) button = Gtk.Button("Run") button.connect("clicked", self.run) listvbox.pack_start(button, False, False, 0)
def get_layout_dict(self): r = Window.get_layout_dict(self) r["pane_position"] = self.pane.get_position() return r
def __init__(self, exit_fn, schedule_ctl, repository, layout_dict=dict()): self.schedule_ctl = schedule_ctl self.repository = repository Window.__init__(self, title="Explorer", default_size=(800, 570), layout_dict=layout_dict) self.connect("delete-event", exit_fn) topvbox = Gtk.VBox(spacing=6) self.add(topvbox) menubar = Gtk.MenuBar() topvbox.pack_start(menubar, False, False, 0) top_menuitem = Gtk.MenuItem("Windows") menu = Gtk.Menu() menuitem = Gtk.MenuItem("Scheduler") menu.append(menuitem) menuitem = Gtk.MenuItem("Parameters") menu.append(menuitem) menu.append(Gtk.SeparatorMenuItem()) menuitem = Gtk.MenuItem("Quit") menuitem.connect("activate", exit_fn) menu.append(menuitem) top_menuitem.set_submenu(menu) menubar.append(top_menuitem) top_menuitem = Gtk.MenuItem("Registry") menu = Gtk.Menu() menuitem = Gtk.MenuItem("Run selected") menuitem.connect("activate", self.run) menu.append(menuitem) menu.append(Gtk.SeparatorMenuItem()) menuitem = Gtk.MenuItem("Add experiment") menu.append(menuitem) menuitem = Gtk.MenuItem("Remove experiment") menu.append(menuitem) top_menuitem.set_submenu(menu) menubar.append(top_menuitem) self.pane = Gtk.HPaned( position=getitem(layout_dict, "pane_position", 180)) topvbox.pack_start(self.pane, True, True, 0) explistvbox = Gtk.VBox(spacing=6) self.pane.pack1(explistvbox) self.explist_store = Gtk.ListStore(str) self.explist_tree = Gtk.TreeView(self.explist_store) renderer = Gtk.CellRendererText() column = Gtk.TreeViewColumn("Registered experiments", renderer, text=0) self.explist_tree.append_column(column) self.explist_tree.connect("row-activated", self.explist_row_activated) self.explist_tree.set_activate_on_single_click(True) scroll = Gtk.ScrolledWindow() scroll.add(self.explist_tree) explistvbox.pack_start(scroll, True, True, 0) button = Gtk.Button("Run") button.connect("clicked", self.run) explistvbox.pack_start(button, False, False, 0) self.pane_contents = Gtk.Label("") self.pane.pack2(self.pane_contents)
def __init__(self, schedule_ctl, **kwargs): self.schedule_ctl = schedule_ctl Window.__init__(self, title="Scheduler", default_size=(720, 570), **kwargs) topvbox = Gtk.VBox(spacing=6) self.add(topvbox) hbox = Gtk.HBox(spacing=6) enable = Gtk.Switch(active=True) label = Gtk.Label("Run experiments") hbox.pack_start(label, False, False, 0) hbox.pack_start(enable, False, False, 0) topvbox.pack_start(hbox, False, False, 0) notebook = Gtk.Notebook() topvbox.pack_start(notebook, True, True, 0) self.queue_store = Gtk.ListStore(int, str, str, str, str) self.queue_tree = Gtk.TreeView(self.queue_store) for i, title in enumerate( ["RID", "File", "Unit", "Timeout", "Arguments"]): renderer = Gtk.CellRendererText() column = Gtk.TreeViewColumn(title, renderer, text=i) self.queue_tree.append_column(column) scroll = Gtk.ScrolledWindow() scroll.add(self.queue_tree) vbox = Gtk.VBox(spacing=6) vbox.pack_start(scroll, True, True, 0) hbox = Gtk.HBox(spacing=6) button = Gtk.Button("Find") hbox.pack_start(button, True, True, 0) button = Gtk.Button("Move up") hbox.pack_start(button, True, True, 0) button = Gtk.Button("Move down") hbox.pack_start(button, True, True, 0) button = Gtk.Button("Remove") button.connect("clicked", self.remove_queued) hbox.pack_start(button, True, True, 0) vbox.pack_start(hbox, False, False, 0) vbox.set_border_width(6) notebook.insert_page(vbox, Gtk.Label("Queue"), -1) self.timed_store = Gtk.ListStore(str, int, str, str, str, str) self.timed_tree = Gtk.TreeView(self.timed_store) for i, title in enumerate( ["Next run", "TRID", "File", "Unit", "Timeout", "Arguments"]): renderer = Gtk.CellRendererText() column = Gtk.TreeViewColumn(title, renderer, text=i) self.timed_tree.append_column(column) scroll = Gtk.ScrolledWindow() scroll.add(self.timed_tree) vbox = Gtk.VBox(spacing=6) vbox.pack_start(scroll, True, True, 0) button = Gtk.Button("Remove") button.connect("clicked", self.remove_timed) vbox.pack_start(button, False, False, 0) vbox.set_border_width(6) notebook.insert_page(vbox, Gtk.Label("Timed schedule"), -1)