def main(): root = Tk() root.minsize(800,600) app = MainWindow(root) infotab = Tabs(app) k_map = Map(app, "Maps\Kingston_z1.gif", (44.2296,76.4928), (44.2224,76.4856), 626, 872) u_map = Map(app, "Maps\Green_River_z2.gif", (38.850,110.25), (38.830,110.21), 1250, 810) u_map_big = Map(app, "Maps\Green_River_Launch_Map.gif", (38.8440, 110.255), (38.8296, 110.205), 7137, 2657) u_map_2016 = Map(app, "Maps\GR_2016.gif", (38.82,109.99), (38.77,109.88), 1240, 666) mapplot = MapGraph(app,(u_map_2016, u_map_big, u_map, k_map), index = 0) dataplot = Datamonitor(app) altplot = Plot(app, ylabel="Altitude (m)", xinterval=float("inf"), numy=2) battery_meter = Meter(app, 4.3, 3) serialmonitor = SerialMonitor(app, altplot, mapplot, dataplot, battery_meter) infotab.add_tab(mapplot, "Map") infotab.add_tab(dataplot, "Plots") widgets = (infotab, altplot, serialmonitor) app.setwidgets(widgets) #serialmonitor.scan_ports() app.bind("<Configure>", app.fit_widgets()) app.mainloop()
line = q1.get(timeout=0.1) parse_qdebug(line) except Empty: pass s = session.Session() content = [] tabs = Tabs() s.addPage(tabs) elems = base.ElementList() warninglist = base.ElementViewSlice(elems) tabs.add_tab(name = "Ring-KDE" , page= warninglist ) tabs.add_tab(name = "Daemon" , page= None ) tabs.add_tab(name = "System" , page= None ) # Display info class InfoPage(Page): def __init__(self): Page.__init__(self) self.height = 8 self._entry = None def set_entry(self, entry): self._entry = entry self.repaint() def repaint(self, clear = False):
def config_widget(self, user_config): config = deepcopy(config_defaults) config.update(user_config) self.layout = get_layout(config["layout"]) self.setLayout(self.layout) self.groups = [] self.group_names = dict() self.p = Parameter.create(name='params', type='group') if config["tabs_enabled"]: tabs = Tabs() self.layout.addWidget(tabs) for gconf in config["groups"]: if not gconf["enabled"]: continue group = deepcopy(group_default) group.update(gconf) if group["box_enabled"]: widget = QtGui.QGroupBox(group["group_name"]) # widget.setSizePolicy( # QtGui.QSizePolicy( # QtGui.QSizePolicy.Maximum, # QtGui.QSizePolicy.Maximum # ) # ) self.group_names[group["group_name"]] = widget widget.setCheckable(group["checkable"]) else: widget = QtGui.QWidget() if group["splitter_enabled"]: splitter = QtGui.QSplitter() splitter.setStretchFactor(0, 0) splitter.setStretchFactor(1, 1) layout = get_layout(group["layout"]) widget.setLayout(layout) self.groups.append(layout) for io in group["items"]: self.p.addChild(io) iow = make_funcs[io["class"]](io, callback=self.generic_callback) self.io_widgets[io["name"]] = iow if group["splitter_enabled"]: splitter.addWidget(iow) else: layout.addWidget(iow) io["added"] = True # if instance["type"] is not None: # self.p.[io["name"]] if group["scrollable"]: widget2 = QtGui.QGroupBox(group["group_name"]) layout2 = get_layout(group["layout"]) widget.setTitle("") scroll = QtGui.QScrollArea() scroll.setWidget(widget) scroll.setWidgetResizable(True) scroll.setAlignment(QtCore.Qt.AlignTop) scroll.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) layout2.addWidget(scroll) widget2.setLayout(layout2) widget = widget2 if config['tabs_enabled']: tabs.add_tab(widget, group["group_name"]) elif "group_layout_params" in config.keys(): self.layout.addWidget( widget, *config["group_layout_params"][group["group_name"]]) elif group["splitter_enabled"]: self.layout.addWidget(splitter) else: self.layout.addWidget(widget) # self.p.sigTreeStateChanged.connect(change) return self.p, config
toptabs = Tabs() toptabs.height = 10 toptabs.expand = False s.addPage(toptabs) elems = base.ElementList() elems.add(base.Element( ["locat"] )) elems.add(base.Element( ["bobcat"] )) elems.add(base.Element( ["locat"] )) bplist = base.ElementViewSlice(elems) toptabs.add_tab(name = "Commands" , page= bplist ) tabs = Tabs() s.addPage(tabs) pipeline = Editor() pipeline.expand = True s.set_key_grabber(pipeline) tabs.add_tab(name = "Commands" , page= pipeline ) tabs.add_tab(name = "Python" , page= None ) def go_up(): pipeline.page_up() def go_down():
s = session.Session() content = [] # Setup the table elems = base.ElementList() elems.alignColumn(0, base.Align.LEFT ) elems.alignColumn(1, base.Align.RIGHT) elems.alignColumn(2, base.Align.RIGHT) warninglist = base.ElementViewSlice(elems) source = Tabs() source.expand = False source.height = 10 s.addPage(source) source.add_tab(name = "Clazy" , page= warninglist ) source.add_tab(name = "GCC" , page= None ) source.add_tab(name = "Krazy2" , page= None ) source.add_tab(name = "Coverity" , page= None ) source.add_tab(name = "MemCheck" , page= None ) source.add_tab(name = "HeapTrack" , page= None ) #source.add_tab(name = "Static" , page= None ) # Create a waning list with open("/tmp/clazy.json", 'r') as f: content = json.load(f) f.close() if len(content) == 0: exit(1)
def config_widget(self, user_config): config = deepcopy(config_defaults) config.update(user_config) self.layout = get_layout(config["layout"]) self.setLayout(self.layout) self.groups = [] self.group_names = dict() self.p = Parameter.create(name='params', type='group') if config["tabs_enabled"]: tabs = Tabs() self.layout.addWidget(tabs) for gconf in config["groups"]: if not gconf["enabled"]: continue group = deepcopy(group_default) group.update(gconf) if group["box_enabled"]: widget = QtGui.QGroupBox(group["group_name"]) # widget.setSizePolicy( # QtGui.QSizePolicy( # QtGui.QSizePolicy.Maximum, # QtGui.QSizePolicy.Maximum # ) # ) self.group_names[group["group_name"]] = widget widget.setCheckable(group["checkable"]) else: widget = QtGui.QWidget() if group["splitter_enabled"]: splitter = QtGui.QSplitter() splitter.setStretchFactor(0, 0) splitter.setStretchFactor(1, 1) layout = get_layout(group["layout"]) widget.setLayout(layout) self.groups.append(layout) for io in group["items"]: self.p.addChild(io) iow = make_funcs[io["class"]](io, callback=self.generic_callback) self.io_widgets[io["name"]] = iow if group["splitter_enabled"]: splitter.addWidget(iow) else: layout.addWidget(iow) io["added"] = True # if instance["type"] is not None: # self.p.[io["name"]] if group["scrollable"]: widget2 = QtGui.QGroupBox(group["group_name"]) layout2 = get_layout(group["layout"]) widget.setTitle("") scroll = QtGui.QScrollArea() scroll.setWidget(widget) scroll.setWidgetResizable(True) scroll.setAlignment(QtCore.Qt.AlignTop) scroll.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) layout2.addWidget(scroll) widget2.setLayout(layout2) widget = widget2 if config['tabs_enabled']: tabs.add_tab(widget, group["group_name"]) elif "group_layout_params" in config.keys(): self.layout.addWidget(widget, *config["group_layout_params"][group["group_name"]]) elif group["splitter_enabled"]: self.layout.addWidget(splitter) else: self.layout.addWidget(widget) # self.p.sigTreeStateChanged.connect(change) return self.p, config
s = session.Session() content = [] toptabs = Tabs() toptabs.height = 10 toptabs.expand = False s.addPage(toptabs) elems = base.ElementList() elems.add(base.Element(["locat"])) elems.add(base.Element(["bobcat"])) elems.add(base.Element(["locat"])) bplist = base.ElementViewSlice(elems) toptabs.add_tab(name="Commands", page=bplist) tabs = Tabs() s.addPage(tabs) pipeline = Editor() pipeline.expand = True s.set_key_grabber(pipeline) tabs.add_tab(name="Commands", page=pipeline) tabs.add_tab(name="Python", page=None) def go_up(): pipeline.page_up()