[update] phaseText refreshing working (maybe slow)
if replotting slows down user interaction too much, change replot to pan-release instead of -move action, or add refresh timer
This commit is contained in:
parent
e2b69d043c
commit
34ae5dddd2
@ -664,6 +664,7 @@ class PylotCanvas(FigureCanvas):
|
|||||||
self.cur_ylim -= dy
|
self.cur_ylim -= dy
|
||||||
ax.set_xlim(self.cur_xlim)
|
ax.set_xlim(self.cur_xlim)
|
||||||
ax.set_ylim(self.cur_ylim)
|
ax.set_ylim(self.cur_ylim)
|
||||||
|
self.refreshPickDlgText()
|
||||||
ax.figure.canvas.draw()
|
ax.figure.canvas.draw()
|
||||||
|
|
||||||
def panRelease(self, gui_event):
|
def panRelease(self, gui_event):
|
||||||
@ -708,8 +709,19 @@ class PylotCanvas(FigureCanvas):
|
|||||||
|
|
||||||
self.setXLims(ax, new_xlim)
|
self.setXLims(ax, new_xlim)
|
||||||
self.setYLims(ax, new_ylim)
|
self.setYLims(ax, new_ylim)
|
||||||
|
|
||||||
|
self.refreshPickDlgText()
|
||||||
self.draw()
|
self.draw()
|
||||||
|
|
||||||
|
def refreshPickDlgText(self):
|
||||||
|
# TODO: Maybe decreasing performance if activated too often on move event
|
||||||
|
# refresh text for pickdlg if given
|
||||||
|
parent = self.parent()
|
||||||
|
if hasattr(parent, 'refreshArrivalsText'):
|
||||||
|
parent.refreshArrivalsText()
|
||||||
|
if hasattr(parent, 'refreshPhaseText'):
|
||||||
|
parent.refreshPhaseText()
|
||||||
|
|
||||||
def connectEvents(self):
|
def connectEvents(self):
|
||||||
self.cidscroll = self.connectScrollEvent(self.scrollZoom)
|
self.cidscroll = self.connectScrollEvent(self.scrollZoom)
|
||||||
self.cidpress = self.connectPressEvent(self.panPress)
|
self.cidpress = self.connectPressEvent(self.panPress)
|
||||||
@ -1054,8 +1066,6 @@ class PickDlg(QDialog):
|
|||||||
|
|
||||||
self.multicompfig.updateCurrentLimits()
|
self.multicompfig.updateCurrentLimits()
|
||||||
|
|
||||||
self.connectScrollEvent()
|
|
||||||
|
|
||||||
# setup ui
|
# setup ui
|
||||||
self.setupUi()
|
self.setupUi()
|
||||||
|
|
||||||
@ -1347,17 +1357,6 @@ class PickDlg(QDialog):
|
|||||||
if phaseIndex == 0:
|
if phaseIndex == 0:
|
||||||
picksMenu.addSeparator()
|
picksMenu.addSeparator()
|
||||||
|
|
||||||
def disconnectScrollEvent(self):
|
|
||||||
widget = self.multicompfig
|
|
||||||
widget.mpl_disconnect(self.cidscroll_arr)
|
|
||||||
widget.mpl_disconnect(self.cidscroll_ph)
|
|
||||||
self.cidscroll_arr = None
|
|
||||||
self.cidscroll_ph = None
|
|
||||||
|
|
||||||
def connectScrollEvent(self):
|
|
||||||
self.cidscroll_arr = self.multicompfig.connectScrollEvent(self.refreshArrivalsText)
|
|
||||||
self.cidscroll_ph = self.multicompfig.connectScrollEvent(self.refreshPhaseText)
|
|
||||||
|
|
||||||
def disable_ar_buttons(self):
|
def disable_ar_buttons(self):
|
||||||
self.enable_ar_buttons(False)
|
self.enable_ar_buttons(False)
|
||||||
|
|
||||||
@ -1455,7 +1454,6 @@ class PickDlg(QDialog):
|
|||||||
if self.zoomAction.isChecked():
|
if self.zoomAction.isChecked():
|
||||||
self.zoomAction.trigger()
|
self.zoomAction.trigger()
|
||||||
self.multicompfig.disconnectEvents()
|
self.multicompfig.disconnectEvents()
|
||||||
self.disconnectScrollEvent()
|
|
||||||
self.cidpress = self.multicompfig.connectPressEvent(self.setIniPick)
|
self.cidpress = self.multicompfig.connectPressEvent(self.setIniPick)
|
||||||
self.filterWFData()
|
self.filterWFData()
|
||||||
#self.pick_block = self.togglePickBlocker()
|
#self.pick_block = self.togglePickBlocker()
|
||||||
@ -1463,7 +1461,6 @@ class PickDlg(QDialog):
|
|||||||
|
|
||||||
def deactivatePicking(self):
|
def deactivatePicking(self):
|
||||||
self.disconnectPressEvent()
|
self.disconnectPressEvent()
|
||||||
self.connectScrollEvent()
|
|
||||||
self.multicompfig.connectEvents()
|
self.multicompfig.connectEvents()
|
||||||
self.connect_pick_delete()
|
self.connect_pick_delete()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user