Index: firmware/App/Services/TxParams.h =================================================================== diff -u -r96377d3f1e16d6f8a48fddbe9f645f9e2fd68478 -r78fe8ab743ad4c64144421662960757a29b9b0b0 --- firmware/App/Services/TxParams.h (.../TxParams.h) (revision 96377d3f1e16d6f8a48fddbe9f645f9e2fd68478) +++ firmware/App/Services/TxParams.h (.../TxParams.h) (revision 78fe8ab743ad4c64144421662960757a29b9b0b0) @@ -15,34 +15,85 @@ * ***************************************************************************/ -#ifndef APP_SERVICES_TX_PARAMS_H_ -#define APP_SERVICES_TX_PARAMS_H_ +#ifndef __TX_PARAMS_H__ +#define __TX_PARAMS_H__ #include "TDCommon.h" #include "TDDefs.h" #include "Utilities.h" /** * @defgroup TxParams TxParams - * @brief Treatment parameters unit provides validation and confirmation handling for treatment parameters from the UI. + * @brief Treatment parameters unit provides validation + * and confirmation handling for treatment parameters from the UI. * * @addtogroup TxParams * @{ */ +// ********** public definitions ********** + +#define MIN_PRESSURE_ALARM_LIMIT_DELTA_MMHG ( 30 ) ///< Minimum pressure alarm limit delta (in mmHg) +#define MAX_UF_RATE_ML_MIN ( 2000.01F / (F32)MIN_PER_HOUR ) ///< Maximum ultrafiltration rate (in mL/min). Added small decimal to prevent float round off issues. +#define MIN_UF_RATE_ML_MIN ( 0.0F ) ///< Minimum ultrafiltration rate (in mL/min). +#define MAX_UF_VOLUME_ML ( 8 * ML_PER_LITER ) ///< Maximum ultrafiltration volume (in mL). + +/// Record structure for a treatment parameters payload from UI. +typedef struct +{ + U32 bloodFlowRate_mL_min; ///< User set blood flow rate (in mL/min) + U32 dialysateFlowRate_mL_min; ///< User set dialysate flow rate (in mL/min) + U32 treatmentDuration_min; ///< User set treatment duration (in min) + U32 salineBolusVolume_mL; ///< User set saline bolus volume (in mL) + U32 hepStopTime_min; ///< User set Heparin stop time (in min) + U32 hepType; ///< User set Heparin type option + U32 acidConcentrate; ///< User set acid concentrate option + U32 bicarbConcentrate; ///< User set bicarbonate concentrate option + U32 dialyzerType; ///< User set dialyzer type option + U32 bpInterval_min; ///< User set blood pressure measurement interval (in min) + U32 rinsebackFlowRate_mL_min; ///< User set rinseback flow rate (in mL/min) + U32 rinsebackVolume_mL; ///< User set rinseback volume (in mL) + S32 arterialPressureLimitWindow_mmHg; ///< User set alarm limit window for arterial pressure (in mmHg) + S32 venousPressureLimitWindow_mmHg; ///< User set alarm limit window for venous pressure (in mmHg) + S32 venousPressureLimitAsymmetric_mmHg; ///< User set alarm limit asymmetric for venous pressure (in mmHg) + S32 tmpLimitWindow_mmHg; ///< User set alarm limit window for trans-membrane pressure (in mmHg) + F32 dialysateTemperature_degC; ///< User set dialysate temperature (in deg C) + F32 hepDispenseRate_mL_hr; ///< User set Heparin dispense rate (in mL/hr) + F32 hepBolusVolume_mL; ///< User set Heparin bolus volume (in mL) +} TREATMENT_PARAMS_DATA_PAYLOAD_T; + +/// Record structure for reporting all current treatment parameters to Dialin +typedef struct +{ + TREATMENT_PARAMS_DATA_PAYLOAD_T treatment_parameters; ///< Record structure of treatment parameters + F32 uFVolume_L; ///< Current ultrafiltration volume (in L). +} CURRENT_TREATMENT_PARAMS_DATA_PAYLOAD_T; + +/// Payload record structure for treatment parameter range broadcast messages. +typedef struct +{ + U32 minTreatmentTime; ///< Minimum treatment duration (in minutes) + U32 maxTreatmentTime; ///< Maximum treatment duration (in minutes) + F32 minUFVolume; ///< Minimum ultrafiltration volume (in mL) + F32 maxUFVolume; ///< Maximum ultrafiltration volume (in mL) + U32 minDialRate; ///< Minimum dialysate flow rate (in mL/min) + U32 maxDialRate; ///< Maximum dialysate flow rate (in mL/min) +} TREATMENT_PARAM_RANGE_BROADCAST_PAYLOAD_T; + // ********** public function prototypes **************** void resetTreatmentParameters( void ); // Reset all parameters to defaults -void signalUserConfirmTreatmentParameters( MESSAGE_T *message ); // Process UI confirm/reject Treatment Parameters +BOOL signalUserConfirmTreatmentParameters( MESSAGE_T *message ); // Process UI confirm/reject Treatment parameters BOOL validateAndSetTreatmentParameters( MESSAGE_T *message ); // Validate Treatment Parameters received from UI BOOL validateAndSetUFVolume( MESSAGE_T *message ); // Validate UF volume received from UI BOOL getValidTreatParamsReceived( void ); // Determine whether valid Treatment Parameters exist BOOL getTreatParamsConfirmed( void ); // Determine whether user confirmed the parameters -BOOL getTreatParamsRejected( void ); // Determine whether user rejected the parameters +U32 getDialyzerBloodVolume( DIALYZER_TYPE_T dialyzer ); // Get the blood side volume for a given dialyzer type +U32 getDialyzerDialysateVolume( DIALYZER_TYPE_T dialyzer ); // Get the dialysate side volume for a given dialyzer type + /**@}*/ #endif -