Files
medicallib/include/MedicalLib/Esophagus.h
T
google-labs-jules[bot] 86488cec48 This commit performs a comprehensive documentation pass on the MedicalLib library, implementing a full documentation generation pipeline using Doxygen, Sphinx, and Breathe for Read the Docs.
Key changes include:

- **Added Comprehensive Doxygen Comments:**
  - Reviewed all header files in `include/MedicalLib/`.
  - Added Doxygen comments for public methods, structs, and their member variables to ensure full API coverage as per the project's coding standards.
  - Addressed all Doxygen warnings related to undocumented public members.

- **Restructured Sphinx Documentation:**
  - Created a new `docs/api/` directory to house detailed documentation for each component.
  - Replaced the single `api.rst` file with a well-organized structure using a `toctree`.
  - Created individual `.rst` pages for each organ, class, and major component.

- **Enabled Graph Generation:**
  - Configured Doxygen to generate class hierarchy and collaboration graphs.
  - Ensured the build process includes these graphs in the final documentation, providing visual context for the library's structure.

- **Verified Build Process:**
  - Installed all necessary dependencies (`doxygen`, `graphviz`, python packages).
  - Successfully ran the Doxygen and Sphinx build process to generate the final HTML documentation, ensuring all changes are correctly integrated.

This work results in a professional, navigable, and maintainable documentation site for the MedicalLib library.
2025-08-20 09:14:51 +00:00

74 lines
1.9 KiB
C++

#pragma once
#include "Organ.h"
#include <string>
#include <vector>
/**
* @brief Represents the state of esophageal muscle contraction.
*/
enum class PeristalsisState {
IDLE,
CONTRACTING,
RELAXING
};
/**
* @brief Represents a small mass of chewed food.
*/
struct Bolus {
double volume_mL; ///< The volume of the bolus in mL.
double position_cm; ///< Position from the top of the esophagus in cm.
};
/**
* @brief Represents the Esophagus with a more detailed physiological model.
*/
class MEDICAL_LIB_API Esophagus : public Organ {
public:
/**
* @brief Constructor for the Esophagus class.
* @param id The ID of the organ.
*/
Esophagus(int id);
/**
* @brief Updates the esophagus state over a time interval.
* @param patient A reference to the patient object.
* @param deltaTime_s The time elapsed in seconds.
*/
void update(Patient& patient, double deltaTime_s) override;
/**
* @brief Gets a string summary of the esophagus's state.
* @return A string containing the esophagus's state.
*/
std::string getSummary() const override;
/**
* @brief Initiates a swallow.
* @param bolusVolume_mL The volume of the bolus being swallowed.
*/
void initiateSwallow(double bolusVolume_mL);
// --- Getters for Esophageal State ---
/** @brief Gets the current state of peristalsis. */
PeristalsisState getCurrentState() const;
/** @brief Checks if a bolus is currently being swallowed. */
bool isSwallowing() const;
private:
// --- Helper to convert enum to string ---
std::string stateToString(PeristalsisState state) const;
// --- Physiological Parameters ---
PeristalsisState currentState;
double lowerEsophagealSphincterTone; // Pressure in mmHg
// --- Simulation State ---
std::vector<Bolus> activeBoli;
const double length_cm = 25.0; // Average length of esophagus
};