コード例 #1
0
ファイル: gui.py プロジェクト: derringa/GFR-Telemetry-GUI
    def render_graphs(self):
        # If MDF loaded iterate through tabs and render each plot onto their graphs.
        if self.mdf_extracted != None:
            # Delete old tab wigets. Redraw leads to ugly behavior.
            for i in reversed(range(self.tabs.count())):
                self.tabs.removeTab(i)
            new_tabs = []
            # Create new tab widgets, add to new tab list.
            for tab_obj in self.tab_list:
                newTab = Tab(tab_obj.get_title(), self.play_slider)
                for plot in tab_obj.get_plots():
                    group = plot[0]
                    signal = plot[1]
                    try:
                        mdf_obj = self.channel_dict[group][signal]
                        if mdf_obj is not None:
                            newTab.add_plot(group, signal, mdf_obj.timestamps,
                                            mdf_obj.samples, mdf_obj.unit)
                    except Exception:
                        newTab.add_plot(group, signal)
                self.tabs.addTab(newTab.get_tab_widget(), newTab.get_title())
                new_tabs.append(newTab)
                newTab.render_multiplot()

            # Replace old tab list with new and redraw features.
            self.tab_list.clear()
            self.tab_list = new_tabs
            self.redraw_slider()