1
0
Fork 0
mirror of https://github.com/gwm17/spspy.git synced 2024-11-22 18:18:52 -05:00

Fix bug in spsplot where updated target did not result in updated reaction.

This commit is contained in:
Gordon McCann 2022-12-06 11:47:37 -05:00
parent 78a3476d2d
commit 8ca50ee621
2 changed files with 3 additions and 0 deletions

View File

@ -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)

View File

@ -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: