Skip to content

Commit 61fba73

Browse files
committed
refs #32645 fix muon gUI crash withnew instrument and phasequad
1 parent 32109b8 commit 61fba73

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

docs/source/release/v6.2.0/muon.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Bugfixes
8585
- The attribute values in a :ref:`Chebyshev <func-Chebyshev>` fitting function will no longer reset after performing a simultaneous fit.
8686
- Fixed a crash caused by fitting to rebinned :ref:`PhaseQuad <algm-PhaseQuad>` data.
8787
- When :ref:`PhaseQuad <algm-PhaseQuad>` data is rebinned it now divides by the fractional change in the bin size (to keep the asymmetry to about 0.3).
88+
- Fixed a bug that is caused by changing instrument and loading a run, after creating a phasequad.
8889

8990
ALC
9091
---

scripts/Muon/GUI/Common/contexts/muon_group_pair_context.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ def selected_groups_and_pairs(self):
176176
def clear(self):
177177
self.clear_groups()
178178
self.clear_pairs()
179+
self.clear_phasequads()
180+
181+
def clear_phasequads(self):
182+
self._phasequad = []
179183

180184
def clear_groups(self):
181185
self._groups = []

scripts/Muon/GUI/FrequencyDomainAnalysis/frequency_domain_analysis.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,11 @@ def setup_instrument_changed_notifier(self):
368368
self.context.data_context.instrumentNotifier.add_subscriber(
369369
self.home_tab.home_tab_widget.instrumentObserver)
370370

371+
self.clear_observer = GenericObserver(self.clear)
372+
373+
self.context.data_context.instrumentNotifier.add_subscriber(
374+
self.clear_observer)
375+
371376
self.context.data_context.instrumentNotifier.add_subscriber(
372377
self.load_widget.load_widget.instrumentObserver)
373378

@@ -389,6 +394,9 @@ def setup_instrument_changed_notifier(self):
389394
for observer in self.plot_widget.clear_plot_observers:
390395
self.context.data_context.instrumentNotifier.add_subscriber(observer)
391396

397+
def clear(self):
398+
self.context.clear_context()
399+
392400
def setup_group_calculation_enable_notifier(self):
393401
self.grouping_tab_widget.group_tab_presenter.enable_editing_notifier.add_subscriber(
394402
self.enable_observer)

scripts/Muon/GUI/MuonAnalysis/muon_analysis_2.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,11 @@ def setup_instrument_changed_notifier(self):
378378
self.context.data_context.instrumentNotifier.add_subscriber(
379379
self.home_tab.home_tab_widget.instrumentObserver)
380380

381+
self.clear_observer = GenericObserver(self.clear)
382+
383+
self.context.data_context.instrumentNotifier.add_subscriber(
384+
self.clear_observer)
385+
381386
self.context.data_context.instrumentNotifier.add_subscriber(
382387
self.load_widget.load_widget.instrumentObserver)
383388

@@ -396,6 +401,9 @@ def setup_instrument_changed_notifier(self):
396401
for observer in self.plot_widget.clear_plot_observers:
397402
self.context.data_context.instrumentNotifier.add_subscriber(observer)
398403

404+
def clear(self):
405+
self.context.clear_context()
406+
399407
def setup_group_calculation_enable_notifier(self):
400408

401409
self.grouping_tab_widget.group_tab_presenter.enable_editing_notifier.add_subscriber(

0 commit comments

Comments
 (0)