I wish to perform three successive measurements when a button is clicked. But the user should position a sensor before each measurement and the program should ask for confirmation before each measurement.
The dcc confirmDialog (ConfirmDialog | Dash for Python Documentation | Plotly) or confirmDialogProvider seem to be an option, but they are triggered when the user clicks a button.
Is there a way to trigger such a confirm dialog during the execution of a code?
Below is the structure of the callback executed when the button btn-start-meas is clicked where start_measure is a function that performs the desired measurement.
@app.callback(
Output(âstatusâ, âvalueâ),
Input(âbtn-start-measâ, ân_clicksâ),
prevent_initial_call = True
)
def make3measurements(btn):
<âWait for confirmationâ>
start_measure(1)
<âWait for confirmationâ>
start_measure(2)
<âWait for confirmationâ>
start_measure(3)