# Temporary Pacing Simulator: A Training Tool for Clinicians
## 2 Materials and Methods
### The Encapsulation of the Simulator on a User Interface
#### 2.5.3 Baseline Rhythm Dropdown  
The baseline rhythm dropdown is a critical component of the TCPS interface. This dropdown allows users to select the underlying cardiac rhythm, which serves as the foundation for further simulation and analysis. The selection of a baseline rhythm initiates a series of processes that configure the simulation environment, ensuring that the visualized signals and pacing responses are accurate and relevant.  
The baseline rhythm dropdown provides a list of predefined cardiac rhythms, such as SR, AF, SR with LBBB, and others. These rhythms represent different physiological conditions of the heart, each with distinct electrical activity patterns.  
When a user selects a baseline rhythm from the dropdown, the following steps and processes are executed:  
1. Resetting to Default State: Upon selection, the simulation resets all global variables and user interface components to their default states. The reset includes clearing signal data arrays, resetting indices, and disabling irrelevant input fields that were introduced in earlier phases of the simulation process. This ensures that any previous settings or selections do not interfere with the new baseline rhythm configuration.
2. Signal Selection: The program extracts the corresponding signal data for the selected baseline rhythm. This involves retrieving the baseline ECG, ABP, and CVP signals from our dataset. The signal extraction is based on the user-selected rhythm, ensuring that the displayed signals accurately reflect the chosen cardiac condition.
3. Updating Pacing Mode Options: Depending on the selected baseline rhythm, the available pacing modes are updated. For instance, if the rhythm is AF, only ventricular pacing modes (such as VVI or VOO) may be relevant and therefore enabled. The dropdown for pacing modes is dynamically populated with the appropriate options, ensuring that the user can only select compatible pacing modes.
4. AV Time Delay Options Update: If the selected baseline rhythm requires AV delay optimization, the program updates the AV delay options accordingly. It searches for available AV delay signals for the selected patient or similar patients with the same baseline rhythm. If no AV delay signals are found for the selected patient, the program may look for another patient with the same baseline rhythm to provide relevant AV delay options.
5. Plot Initialization and Update: The program initializes the plot area with the extracted baseline signals. The ECG, ABP, and CVP signals are displayed in their respective subplots. The plot is configured to update dynamically, simulating real-time signal monitoring.
6. User Feedback and Interaction: Throughout this process, the user receives immediate visual feedback as the plot updates to reflect the selected baseline rhythm. Any invalid selections or inputs trigger warning messages, guiding the user to make appropriate choices. This interactive feedback mechanism ensures a smooth and intuitive user experience, facilitating effective learning and analysis.  
The baseline rhythm dropdown selection triggers a comprehensive series of actions that configure the simulation environment, ensuring accurate and relevant signal visualization.