From 8ca50ee621be5114d1cefe15dc66d9473f915624 Mon Sep 17 00:00:00 2001 From: gwm17 Date: Tue, 6 Dec 2022 11:47:37 -0500 Subject: [PATCH] Fix bug in spsplot where updated target did not result in updated reaction. --- spspy/SPSPlot.py | 2 ++ spspy/SPSPlotUI.py | 1 + 2 files changed, 3 insertions(+) diff --git a/spspy/SPSPlot.py b/spspy/SPSPlot.py index 6efb5cf..c1c2a0c 100644 --- a/spspy/SPSPlot.py +++ b/spspy/SPSPlot.py @@ -45,6 +45,8 @@ class SPSPlot: def update_reactions(self) -> None: for datum in self.data.values(): datum.rxn.update_parameters(self.beamEnergy, self.spsAngle, self.magneticField) + if datum.rxn.targetMaterial.name in self.targets: + datum.rxn.targetMaterial = self.targets[datum.rxn.targetMaterial.name] for ex in datum.excitations: ex.kineticEnergy = datum.rxn.calculate_ejectile_KE(ex.excitation) ex.rho = datum.rxn.convert_ejectile_KE_2_rho(ex.kineticEnergy) diff --git a/spspy/SPSPlotUI.py b/spspy/SPSPlotUI.py index 64fa883..59f5c99 100644 --- a/spspy/SPSPlotUI.py +++ b/spspy/SPSPlotUI.py @@ -182,6 +182,7 @@ class SPSPlotGUI(QMainWindow): targDia.new_target.connect(self.sps.add_target) if targDia.exec(): self.update_target_table() + self.sps.update_reactions() self.update_plot() #in case a reaction is using the target def handle_run(self) -> None: