Files
medicallib/include/MedicalLib/SpinalCord.h
T
google-labs-jules[bot] 7459435e25 feat: Add detailed simulation to remaining simple organs
This commit applies a detailed physiological model to all remaining simple organ classes, bringing them to a level of complexity consistent with the Heart, Lungs, and Brain.

Updates include:
- Esophagus: Simulates peristalsis and bolus movement.
- Stomach: Implements a gastric state machine for digestion.
- Intestines: Adds segments (duodenum, jejunum, etc.) and simulates absorption.
- Pancreas: Differentiates endocrine and exocrine functions.
- Gallbladder: Simulates storing, concentrating, and releasing bile.
- Kidneys: Models nephrons, GFR, and electrolyte balance.
- Bladder: Implements a micturition cycle with pressure dynamics.
- Spleen: Models red and white pulp for blood filtering and immunity.
2025-08-20 07:11:44 +00:00

70 lines
1.8 KiB
C++

#pragma once
#include "Organ.h"
#include <string>
#include <vector>
/**
* @brief Represents the functional status of a neural pathway.
*/
enum class SignalStatus {
NORMAL,
IMPAIRED,
SEVERED
};
/**
* @brief Represents a major bundle of nerve fibers in the spinal cord.
*/
struct SpinalTract {
std::string name;
SignalStatus status;
double conductionVelocity_m_per_s;
};
/**
* @brief Represents the Spinal Cord with a more detailed physiological model.
*/
class MEDICAL_LIB_API SpinalCord : public Organ {
public:
/**
* @brief Constructor for the SpinalCord class.
* @param id The ID of the organ.
*/
SpinalCord(int id);
/**
* @brief Updates the spinal cord's state over a time interval.
* @param deltaTime_s The time elapsed in seconds.
*/
void update(double deltaTime_s) override;
/**
* @brief Gets a string summary of the spinal cord's vitals.
* @return A string containing the spinal cord's vital signs.
*/
std::string getSummary() const override;
// --- Getters for Key Neurological Pathways ---
/** @brief Gets the status of the primary motor pathways. */
SignalStatus getMotorPathwayStatus() const;
/** @brief Gets the status of the primary sensory pathways. */
SignalStatus getSensoryPathwayStatus() const;
/** @brief Gets the status of a basic reflex arc. */
bool isReflexArcIntact() const;
private:
// --- Helper to convert enum to string ---
std::string statusToString(SignalStatus status) const;
// --- Anatomical Components ---
SpinalTract descendingMotorTract;
SpinalTract ascendingSensoryTract;
// --- Physiological Parameters ---
bool reflexArcIntact; // Simplified representation of a reflex (e.g., patellar)
};