From c197f431bbebac00c7b443314c81677f1899264c Mon Sep 17 00:00:00 2001 From: Parthib Roy Date: Thu, 20 Feb 2025 19:13:36 -0800 Subject: [PATCH] Handle selection of collective effects based on tracking_mode selection --- .../dashboard/Input/inputParameters/inputMain.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/python/impactx/dashboard/Input/inputParameters/inputMain.py b/src/python/impactx/dashboard/Input/inputParameters/inputMain.py index 026eea132..2f26dc361 100644 --- a/src/python/impactx/dashboard/Input/inputParameters/inputMain.py +++ b/src/python/impactx/dashboard/Input/inputParameters/inputMain.py @@ -23,6 +23,18 @@ def on_kin_energy_unit_change(**kwargs) -> None: if state.kin_energy_on_ui != 0: InputFunctions.update_kin_energy_sim_value() + @state.change("tracking_mode") + def on_tracking_mode_change(tracking_mode, **kwargs) -> None: + if tracking_mode in ("Envelope Tracking", "Reference Tracking"): + state.space_charge = False + state.csr = False + + state.disable_space_charge = True + state.disable_csr = True + else: + state.disable_space_charge = False + state.disable_csr = False + def card(self): """ Creates UI content for beam properties. @@ -41,12 +53,14 @@ def card(self): label="Space Charge", v_model=("space_charge", False), dense=True, + disabled=("disable_space_charge",), ) with vuetify.VCol(cols=6, classes="py-0"): vuetify.VCheckbox( label="CSR", v_model=("csr", False), dense=True, + disabled=("disable_csr",), ) with vuetify.VRow(classes="my-2"): with vuetify.VCol(cols=6, classes="py-0"):