Public Access
crosshair and pan toolbar buttons are mutually exclusive
This commit is contained in:
1 parent
9d60eeabf6
commit
63da240504
2 files changed
+12
-2
No files matched your search
+1
-1
@@ -105,7 +105,7 @@ There are now two possibilities to export the figure:
|
|||||||
1. Saving the plot as a figure (EPS, PNG, JPEG and more) by pressing the save button in the toolbar below the plot area
|
1. Saving the plot as a figure (EPS, PNG, JPEG and more) by pressing the save button in the toolbar below the plot area
|
||||||
2. Saving the data of the plot as CSV file (comma separated values) by pressing the button on the right side of the toolbar under the plot
|
2. Saving the data of the plot as CSV file (comma separated values) by pressing the button on the right side of the toolbar under the plot
|
||||||
|
|
||||||
The plot can be navigated directly with the mouse: dragging with the left mouse button pans the view and the mouse wheel zooms in and out around the pointer position. Holding the right mouse button and dragging horizontally zooms only the x axis, dragging vertically zooms only the y axis (dragging right or up zooms in), just like the right button in the toolbar pan mode. This works on linear and logarithmic axes. The pan and zoom buttons in the toolbar below the plot are still available; while one of these toolbar modes is active, the direct mouse panning and right-button zooming are suspended so the toolbar behavior is unchanged. Note that with the autoscaling option enabled, the view is reset to the full data range whenever a new result arrives.
|
The plot can be navigated directly with the mouse: dragging with the left mouse button pans the view and the mouse wheel zooms in and out around the pointer position. Holding the right mouse button and dragging horizontally zooms only the x axis, dragging vertically zooms only the y axis (dragging right or up zooms in), just like the right button in the toolbar pan mode. This works on linear and logarithmic axes. The pan and zoom buttons in the toolbar below the plot are still available; while one of these toolbar modes is active, the direct mouse panning and right-button zooming are suspended so the toolbar behavior is unchanged. The crosshair button and the Pan button in the toolbar below the plot are mutually exclusive; activating one automatically deactivates the other. Note that with the autoscaling option enabled, the view is reset to the full data range whenever a new result arrives.
|
||||||
|
|
||||||
A horizontal slider (0-360°) with a "Phase:" label and a value read-out is available in the "Display" tab, located to the right of the "Source:" drop-down selector. This slider allows for a display-only interactive rotation of the displayed ADC_Result or Accumulation two-channel signal for visual phase correction. The rotation applies to all displayed scans and updates for the selected source.
|
A horizontal slider (0-360°) with a "Phase:" label and a value read-out is available in the "Display" tab, located to the right of the "Source:" drop-down selector. This slider allows for a display-only interactive rotation of the displayed ADC_Result or Accumulation two-channel signal for visual phase correction. The rotation applies to all displayed scans and updates for the selected source.
|
||||||
|
|
||||||
|
|||||||
@@ -3014,6 +3014,9 @@ class MonitorWidgets:
|
|||||||
#self.matplot_toolbar.DeleteToolByPos(1)
|
#self.matplot_toolbar.DeleteToolByPos(1)
|
||||||
#self.matplot_toolbar.remove(self.matplot_toolbar.get_nth_item(3))
|
#self.matplot_toolbar.remove(self.matplot_toolbar.get_nth_item(3))
|
||||||
self.matplot_toolbar.remove(self.matplot_toolbar.get_nth_item(6))
|
self.matplot_toolbar.remove(self.matplot_toolbar.get_nth_item(6))
|
||||||
|
# crosshair and Pan button are mutually exclusive
|
||||||
|
self.matplot_pan_button = self.matplot_toolbar._gtk_ids['Pan']
|
||||||
|
self.matplot_pan_button.connect( 'toggled', self.toggle_pan_button )
|
||||||
# now let's add a button to the toolbar
|
# now let's add a button to the toolbar
|
||||||
self.matplot_cursor_button = gtk.ToggleButton(label='')
|
self.matplot_cursor_button = gtk.ToggleButton(label='')
|
||||||
cursor_icon = GdkPixbuf.Pixbuf.new_from_xpm_data( crosshair_xpm )
|
cursor_icon = GdkPixbuf.Pixbuf.new_from_xpm_data( crosshair_xpm )
|
||||||
@@ -3662,6 +3665,11 @@ class MonitorWidgets:
|
|||||||
self._pan_start = None
|
self._pan_start = None
|
||||||
self._zoom_drag = None
|
self._zoom_drag = None
|
||||||
|
|
||||||
|
def toggle_pan_button(self, button):
|
||||||
|
"""Deactivate the crosshair button when the Pan mode is activated."""
|
||||||
|
if button.get_active( ) and self.matplot_cursor_button.get_active( ):
|
||||||
|
self.matplot_cursor_button.set_active( False )
|
||||||
|
|
||||||
def toggle_cursor(self, widget):
|
def toggle_cursor(self, widget):
|
||||||
"""Toggle matplotlib crosshair cursor"""
|
"""Toggle matplotlib crosshair cursor"""
|
||||||
if widget.get_active():
|
if widget.get_active():
|
||||||
@@ -3670,7 +3678,9 @@ class MonitorWidgets:
|
|||||||
self.matplot_cursor = CrosshairCursor(self.matplot_axes,
|
self.matplot_cursor = CrosshairCursor(self.matplot_axes,
|
||||||
color='red', linewidth=1)
|
color='red', linewidth=1)
|
||||||
self.matplot_canvas.draw()
|
self.matplot_canvas.draw()
|
||||||
# TODO: Deactivate the pane button
|
# leave the Pan mode, the two buttons are mutually exclusive
|
||||||
|
if self.matplot_pan_button.get_active( ):
|
||||||
|
self.matplot_pan_button.set_active( False )
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Deactivate cursor
|
# Deactivate cursor
|
||||||
|
|||||||
Reference in new issue
Block a user