Example #1
0
    def __init__(self, parent, dataset, **kwargs):
        visualizers = [V.default(dataset.parent)]
        self.dataset = dataset
        self.span_kwargs = dict(ec='r', hatch='/', fill=False, aa=False, 
                                zorder=100, )
        ListViewerFrame.__init__(self, parent, visualizers, **kwargs)        
        
        # change cursor
        self._click_mode = 0 # 0=tstart;  1=tend
        self.canvas_panel.canvas.Bind(wx.EVT_MOTION, self.ChangeCursor)
        self.canvas_panel.canvas.Bind(wx.EVT_KEY_DOWN, self.ChangeCursor)
        self.canvas_panel.canvas.Bind(wx.EVT_KEY_UP, self.ChangeCursor)
        
        # capture clicks
        self.canvas_panel.canvas.mpl_connect('button_press_event', self.OnCanvasClick)
        
        
    # ToolBar
        tb = self.ToolBar
#        tb.AddSeparator()
#        self._tb_tstart = tb.AddCheckLabelTool(ID.SET_TSTART, "Set t-start", 
#                                               Icon("tango/actions/go-first"))
#        self.Bind(wx.EVT_TOOL, self.OnSelectTool, id=ID.SET_TSTART)
#        self._tb_tend = tb.AddCheckLabelTool(ID.SET_TEND, "Set t-end", 
#                                             Icon("tango/actions/go-last"))
#        self.Bind(wx.EVT_TOOL, self.OnSelectTool, id=ID.SET_TEND)
        if wx.__version__ >= '2.9':
            tb.AddStretchableSpace()
        else:
            tb.AddSeparator()
        
        tb.AddLabelTool(wx.ID_HELP, "Help", Icon("tango/apps/help-browser"))
        self.Bind(wx.EVT_TOOL, self.OnHelp, id=wx.ID_HELP)
        
        tb.Realize()
Example #2
0
def _auto(datasets, v_type=0, y=5, debug=True, dur=None, mag=None, a=None, **kwargs):
    """
    v_type: 0  physio
            1  list
    
    a: address (to select subset of segments in the datasets)
    
    """
    if debug:
#        reload(_vw_physio)
#        reload(V)
        reload(_vw_list)
    
    v = []
    for ds in datasets:
        new_v = _V.default(ds, a=a, dur=dur, mag=mag)
        v.append(new_v)
    
    if v_type == 0:
        w, h = wx.GetDisplaySize()
        return _vw_physio.PhysioViewerFrame(_shell(), v, size=(w, 450), **kwargs)
    elif v_type == 1:
        return _vw_list.ListViewerFrame(v, y=y, **kwargs)
    else:
        raise ValueError("v_type %s not implemented"%v_type)
Example #3
0
    def __init__(self, parent, dataset):
        visualizer = visualizers.default(dataset)
        wx.Frame.__init__(self, parent)

        self.panel = ZoomPanel(self)
        self.panel.plot([visualizer])
Example #4
0
    def __init__(self, parent, dataset):
        visualizer = visualizers.default(dataset)
        wx.Frame.__init__(self, parent)

        self.panel = OverviewPanel(self)
        self.panel.plot_overview([visualizer])