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: