Skip to content

Commit

Permalink
Handle selection of collective effects based on tracking_mode selection
Browse files Browse the repository at this point in the history
  • Loading branch information
proy30 committed Feb 21, 2025
1 parent 597789f commit c197f43
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/python/impactx/dashboard/Input/inputParameters/inputMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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"):
Expand Down

0 comments on commit c197f43

Please sign in to comment.