# Temporary Pacing Simulator: A Training Tool for Clinicians
## 2 Materials and Methods
### The Encapsulation of the Simulator on a User Interface
#### 2.5.4 Pacing Mode Dropdown  
The pacing mode selection dropdown allows users to select different pacing modes, which dictate how the TCPS interacts with the heart to regulate its rhythm. The choice of pacing mode initiates a series of processes that configure the simulation environment, ensuring that the pacing signals, parameters, and visualizations are appropriately updated.  
The pacing mode dropdown provides a list of available pacing modes, such as VVI, VOO, AAI, AOO, DDI, and DOO. Each pacing mode represents a specific strategy for pacing the heart, with distinct rules for sensing and pacing atrial and ventricular activity.  
When a user selects a pacing mode from the dropdown, the following steps and processes are executed:  
1. Validation of Baseline Rhythm: The program first checks whether a baseline rhythm has been selected. If no baseline rhythm is chosen, the user is prompted to select one before proceeding with pacing mode selection. This ensures that pacing parameters are applied within the context of a defined cardiac condition.
2. Updating Pacing Mode Options: Based on the selected baseline rhythm, the pacing mode dropdown is populated with relevant options. For example, certain pacing modes may be disabled if they are incompatible with the chosen baseline rhythm.
3. Enabling/Disabling Input Fields: The selection of a pacing mode dynamically enables or disables various input fields and dropdowns related to pacing parameters. For instance, dual-chamber pacing modes (such as DDI or DOO) enable the AV delay dropdown, as these modes require synchronization between atrial and ventricular pacing. Input fields for pacing rate, capture thresholds, and sensitivity thresholds are also enabled or disabled based on the selected pacing mode. This ensures that users can only interact with relevant controls, minimizing the risk of invalid configurations.
4. Interaction with AV delay dropdown: For dual-chamber pacing modes, the AV delay dropdown is set to'readonly' to allow users to select an appropriate delay. This dropdown remains disabled for single-chamber pacing modes where AV delay is not applicable.
5. Updating Failure Mode Options: The available failure modes are updated based on the selected pacing mode. Failure modes such as undersensing, oversensing, atrial loss of capture, and ventricular loss of capture are dynamically populated in the failure mode dropdown. This allows users to simulate and analyze specific pacing failures relevant to the chosen mode.
6. Real-Time Feedback and Visualization: Upon selecting a pacing mode, the program retrieves the corresponding paced signals for ECG, ABP, and CVP from the predefined datasets. These signals are then plotted within the graphical interface, providing immediate visual feedback to the user.The plot area is updated dynamically, simulating real-time signal monitoring. This visualization helps users understand the impact of the selected pacing mode on cardiac function.
7. Plot Update and Redrawing: The selected pacing mode influences the window of data displayed on the plot. The program ensures that the appropriate signals are plotted, clearing the previous data and updating the plot with the new signals. This process provides a clear and accurate representation of the pacing effects.
8. User Guidance and Warnings: Throughout the process, the user receives real-time guidance and warnings. For instance, if an invalid pacing mode is selected, or if a required parameter is not set, the program displays warning messages, prompting the user to correct the input. This interactive feedback mechanism ensures a smooth and intuitive user experience, facilitating effective learning and analysis.