def onSelPoint(self, evt=None, opt='__', relative_e0=False, win=None): """ get last selected point from a specified plot window and fill in the value for the widget defined by `opt`. by default it finds the latest cursor position from the cursor history of the first 20 plot windows. """ if opt not in self.wids: return None _x, _y = last_cursor_pos(win=win, _larch=self.larch) if _x is not None: if relative_e0 and 'e0' in self.wids: _x -= self.wids['e0'].GetValue() self.wids[opt].SetValue(_x)
def onSelPoint(self, evt=None, opt='__', relative_e0=False, win=None): """ get last selected point from a specified plot window and fill in the value for the widget defined by `opt`. by default it finds the latest cursor position from the cursor history of the first 20 plot windows. """ if opt not in self.wids: return None _x, _y = last_cursor_pos(win=win, _larch=self.larch) if _x is not None: if relative_e0 and 'e0' in self.wids: _x -= self.wids['e0'].GetValue() self.wids[opt].SetValue(_x)
def onSelPoint(self, evt=None, opt='__', relative_e0=True, win=None): """ get last selected point from a specified plot window and fill in the value for the widget defined by `opt`. by default it finds the latest cursor position from the cursor history of the first 20 plot windows. """ if opt not in self.wids: return None _x, _y = last_cursor_pos(win=win, _larch=self.larch) if _x is None: return e0 = self.wids['e0'].GetValue() if opt == 'e0': self.wids['e0'].SetValue(_x) self.wids['auto_e0'].SetValue(0) elif opt in ('pre1', 'pre2', 'norm1', 'norm2'): self.wids[opt].SetValue(_x - e0) time.sleep(0.01) wx.CallAfter(self.onReprocess)
def onSelPoint(self, evt=None, opt='__', relative_e0=True, win=None): """ get last selected point from a specified plot window and fill in the value for the widget defined by `opt`. by default it finds the latest cursor position from the cursor history of the first 20 plot windows. """ if opt not in self.wids: return None _x, _y = last_cursor_pos(win=win, _larch=self.larch) if _x is None: return e0 = self.wids['e0'].GetValue() if opt == 'e0': self.wids['e0'].SetValue(_x) self.wids['auto_e0'].SetValue(0) elif opt in ('pre1', 'pre2', 'norm1', 'norm2'): self.wids[opt].SetValue(_x-e0) time.sleep(0.01) wx.CallAfter(self.onReprocess)
def get_cursor(self, win=None): """get last cursor from selected window""" return last_cursor_pos(win=win, _larch=self.larch)
def get_cursor(self, win=None): """get last cursor from selected window""" return last_cursor_pos(win=win, _larch=self.larch)