Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mslice/plotting/plot_window/interactive_cut.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def flip_axis(self):
self.plot_cut(*self.rect.extents)

def window_closing(self):
self.slice_plot.toggle_interactive_cuts(False)
self.slice_plot.toggle_interactive_cuts()
self.slice_plot.plot_window.action_interactive_cuts.setChecked(False)

def refresh_rect_selector(self, ax):
Expand Down
8 changes: 4 additions & 4 deletions src/mslice/plotting/plot_window/slice_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,11 @@ def _update_lines(self):
self.update_legend()
self._canvas.draw()

def toggle_interactive_cuts(self, store=True):
self.toggle_icut_button(store)
def toggle_interactive_cuts(self):
self.toggle_icut_button()
self.toggle_icut()

def toggle_icut_button(self, store=True):
def toggle_icut_button(self):
if not self.icut:
self.manager.picking_connected(False)
if self.plot_window.action_zoom_in.isChecked():
Expand All @@ -545,7 +545,7 @@ def toggle_icut_button(self, store=True):
self.plot_window.action_flip_axis.setVisible(False)
self._canvas.setCursor(Qt.ArrowCursor)
self.icut.set_icut_intensity_category(self.intensity_type)
self.icut.store_icut_cut_upon_toggle_and_reset(store)
self.icut.store_icut_cut_upon_toggle_and_reset(True)
self.plot_window.menu_intensity.setDisabled(False)

def toggle_icut(self):
Expand Down
38 changes: 28 additions & 10 deletions src/mslice/presenters/cut_plotter_presenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
from mslice.models.cut.cut_functions import compute_cut
from mslice.models.labels import generate_legend
from mslice.models.workspacemanager.workspace_algorithms import export_workspace_to_ads
from mslice.models.workspacemanager.workspace_provider import get_workspace_handle
from mslice.models.workspacemanager.workspace_provider import (
add_workspace,
get_workspace_handle,
)
import mslice.plotting.pyplot as plt
from mslice.presenters.presenter_utility import PresenterUtility
from mslice.plotting.plot_window.overplot_interface import (
Expand All @@ -18,7 +21,6 @@
)
from mslice.models.powder.powder_functions import compute_powder_line
from mslice.models.intensity_correction_algs import sample_temperature
from mslice.models.workspacemanager.workspace_provider import add_workspace
from mslice.models.axis import Axis
from mslice.util.intensity_correction import IntensityType, IntensityCache
import warnings
Expand Down Expand Up @@ -350,24 +352,40 @@ def _show_intensity(self, cut_cache, intensity_correction):
self._temp_cut_cache = []

def show_scattering_function(self, axes):
self._show_intensity(
self._cut_cache_dict[axes], IntensityType.SCATTERING_FUNCTION
)
for key, value in self._cut_cache_dict.items():
if key == axes:
self._show_intensity(value, IntensityType.SCATTERING_FUNCTION)
break

def show_dynamical_susceptibility(self, axes):
self._show_intensity(self._cut_cache_dict[axes], IntensityType.CHI)
for key, value in self._cut_cache_dict.items():
if key == axes:
self._show_intensity(value, IntensityType.CHI)
break

def show_dynamical_susceptibility_magnetic(self, axes):
self._show_intensity(self._cut_cache_dict[axes], IntensityType.CHI_MAGNETIC)
for key, value in self._cut_cache_dict.items():
if key == axes:
self._show_intensity(value, IntensityType.CHI_MAGNETIC)
break

def show_d2sigma(self, axes):
self._show_intensity(self._cut_cache_dict[axes], IntensityType.D2SIGMA)
for key, value in self._cut_cache_dict.items():
if key == axes:
self._show_intensity(value, IntensityType.D2SIGMA)
break

def show_symmetrised(self, axes):
self._show_intensity(self._cut_cache_dict[axes], IntensityType.SYMMETRISED)
for key, value in self._cut_cache_dict.items():
if key == axes:
self._show_intensity(value, IntensityType.SYMMETRISED)
break

def show_gdos(self, axes):
self._show_intensity(self._cut_cache_dict[axes], IntensityType.GDOS)
for key, value in self._cut_cache_dict.items():
if key == axes:
self._show_intensity(value, IntensityType.GDOS)
break

def set_sample_temperature(self, axes, ws_name, temp):
cut_dict = {}
Expand Down
Loading