Index: firmware/App/Controllers/AirTrap.c =================================================================== diff -u -r036a75d76ab01912646a480b935d97187a231a19 -ra5560a2917aa62bcafd8e6a81041ace723237109 --- firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision 036a75d76ab01912646a480b935d97187a231a19) +++ firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision a5560a2917aa62bcafd8e6a81041ace723237109) @@ -238,7 +238,9 @@ // if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_AIR_TRAP_LEVELING_ALARM ) != SW_CONFIG_ENABLE_VALUE ) #endif { +#ifndef TEST_UI_ONLY activateAlarmNoData( ALARM_ID_TD_AIR_TRAP_FILL_DURING_TREATMENT ); +#endif } } } Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r036a75d76ab01912646a480b935d97187a231a19 -ra5560a2917aa62bcafd8e6a81041ace723237109 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 036a75d76ab01912646a480b935d97187a231a19) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision a5560a2917aa62bcafd8e6a81041ace723237109) @@ -147,6 +147,7 @@ { BOOL result = FALSE; +#ifndef TEST_NO_PINCH_VALVES if ( valve < NUM_OF_VALVES ) { VALVE_STATE_T currState = currentValveStates[ valve ].controlState; @@ -170,6 +171,7 @@ { SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, SW_FAULT_ID_TD_VALVES_INVALID_VALVE8, (U32)valve ) } +#endif return result; } @@ -188,6 +190,7 @@ { BOOL result = FALSE; +#ifndef TEST_NO_PINCH_VALVES if ( ( valve < NUM_OF_VALVES ) && ( position < NUM_OF_VALVE_POSITIONS ) ) { currentValveStates[ valve ].pendingCommandedPosition = position; @@ -199,6 +202,7 @@ SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, SW_FAULT_ID_TD_VALVES_INVALID_PARAM, ( (U32)valve << SHIFT_16_BITS_FOR_WORD_SHIFT ) | (U32)position ) } +#endif return result; } @@ -295,7 +299,7 @@ * @param valve ID of valve for which to handle the Wait for POST state * @return next state of the state machine for the given valve *************************************************************************/ -VALVE_STATE_T handleValvesWait4PostState( VALVE_T valve ) +static VALVE_STATE_T handleValvesWait4PostState( VALVE_T valve ) { VALVE_STATE_T nextState = VALVE_STATE_WAIT_FOR_POST; @@ -324,7 +328,7 @@ * @param valve ID of valve for which to handle the Not Homed state * @return next state of the state machine for the given valve *************************************************************************/ -VALVE_STATE_T handleValvesNotHomedState( VALVE_T valve ) +static VALVE_STATE_T handleValvesNotHomedState( VALVE_T valve ) { VALVE_STATE_T nextState = VALVE_STATE_HOMING_NOT_STARTED; @@ -361,7 +365,7 @@ * @param valve ID of valve for which to handle the Find Energized Edge state * @return next state of the state machine for the given valve *************************************************************************/ -VALVE_STATE_T handleValvesFindEnergizedEdgeState( VALVE_T valve ) +static VALVE_STATE_T handleValvesFindEnergizedEdgeState( VALVE_T valve ) { VALVE_STATE_T nextState = VALVE_STATE_HOMING_FIND_ENERGIZED_EDGE; @@ -401,7 +405,7 @@ * @param valve ID of valve for which to handle the Find De-energized Edge state * @return next state of the state machine for the given valve *************************************************************************/ -VALVE_STATE_T handleValvesFindDeenergizedEdgeState( VALVE_T valve ) +static VALVE_STATE_T handleValvesFindDeenergizedEdgeState( VALVE_T valve ) { VALVE_STATE_T nextState = VALVE_STATE_HOMING_FIND_DEENERGIZED_EDGE; @@ -466,7 +470,7 @@ * @param valve ID of valve for which to handle the Idle state * @return next state of the state machine for the given valve *************************************************************************/ -VALVE_STATE_T handleValvesIdleState( VALVE_T valve ) +static VALVE_STATE_T handleValvesIdleState( VALVE_T valve ) { VALVE_STATE_T nextState = VALVE_STATE_IDLE; @@ -516,7 +520,7 @@ * @param valve ID of valve for which to handle the Transition state * @return next state of the state machine for the given valve *************************************************************************/ -VALVE_STATE_T handleValvesTransitionState( VALVE_T valve ) +static VALVE_STATE_T handleValvesTransitionState( VALVE_T valve ) { VALVE_STATE_T nextState = VALVE_STATE_IN_TRANSITION; Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r50f4b79164155c1bc375dd3ff0e8588f934dc729 -ra5560a2917aa62bcafd8e6a81041ace723237109 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 50f4b79164155c1bc375dd3ff0e8588f934dc729) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision a5560a2917aa62bcafd8e6a81041ace723237109) @@ -295,6 +295,7 @@ { rejReason = REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE; } +#ifndef TEST_UI_ONLY // Verify DD is communicating with HD else if ( isDDCommunicating() != TRUE ) { @@ -305,6 +306,7 @@ { rejReason = REQUEST_REJECT_REASON_DD_NOT_IN_STANDBY_IDLE_STATE; } +#endif else { // If request to start treatment not rejected, set flag to initiate treatment workflow Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -r51f42cd88bd9c50ed9096a2d1d8ff859a95aff95 -ra5560a2917aa62bcafd8e6a81041ace723237109 --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 51f42cd88bd9c50ed9096a2d1d8ff859a95aff95) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision a5560a2917aa62bcafd8e6a81041ace723237109) @@ -177,8 +177,8 @@ { // PRESSURE_LIMIT_CHANGE_RESPONSE_T respRecord; - // don't re-initialize treatment if tester is returning to treatment mode from a fault - if ( getPreviousOperationMode() != MODE_FAUL ) + // don't re-initialize treatment if tester is jumping to Tx mode +// if ( getPreviousOperationMode() != MODE_PRET ) { // Initialize treatment mode each time we transition to it initTreatmentMode(); @@ -196,8 +196,10 @@ setCurrentSubState( NO_SUB_STATE ); +#ifndef TEST_UI_ONLY // Enable venous bubble detection in treatment mode setVenousBubbleDetectionEnabled( H18_BBLD, TRUE ); +#endif // Set treatment parameters presTreatmentTimeSecs = getTreatmentParameterU32( TREATMENT_PARAM_TREATMENT_DURATION ) * SEC_PER_MIN; @@ -475,10 +477,19 @@ *************************************************************************/ static TREATMENT_STATE_T handleTreatmentStartState( void ) { +#ifndef TEST_UI_ONLY TREATMENT_STATE_T result = TREATMENT_BLOOD_PRIME_STATE; +#else + TREATMENT_STATE_T result = TREATMENT_DIALYSIS_STATE; +#endif lastTreatmentTimeStamp = getMSTimerCount(); -// transitionToBloodPrime(); +#ifndef TEST_UI_ONLY + transitionToBloodPrime(); +#else + setDialysisBloodPumpFlowRate( getTreatmentParameterU32( TREATMENT_PARAM_BLOOD_FLOW ) ); + transitionToDialysis(); +#endif return result; } @@ -828,10 +839,12 @@ payload.treatmentSubMode = (U32)currentTreatmentState; payload.bldPrimeState = 0; // getCurrentBloodPrimeState(); payload.dialysisState = getDialysisState(); - payload.txStopState = 0; // getCurrentTreatmentStopState(); + payload.txStopState = getCurrentTreatmentPausedState(); payload.rinsebackState = 0; // getCurrentRinsebackState(); payload.txRecircState = 0; // getCurrentTreatmentRecircState(); payload.txEndState = 0; // getCurrentTreatmentEndState(); + payload.txSalBolusState = 0; // + payload.txHepState = 0; // sendMessage( MSG_ID_TD_TREATMENT_STATE_DATA, COMM_BUFFER_OUT_CAN_TD_BROADCAST, (U08*)(&payload), sizeof( TREATMENT_STATE_DATA_T ) ); } Index: firmware/App/Modes/ModeTreatment.h =================================================================== diff -u -rfdb7ee915da2741dc200fef1b624b7f383f4db85 -ra5560a2917aa62bcafd8e6a81041ace723237109 --- firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision fdb7ee915da2741dc200fef1b624b7f383f4db85) +++ firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision a5560a2917aa62bcafd8e6a81041ace723237109) @@ -55,6 +55,8 @@ U32 rinsebackState; ///< Rinse back state. U32 txRecircState; ///< Treatment recirc state. U32 txEndState; ///< Treatment end state. + U32 txSalBolusState; ///< Saline bolus state. + U32 txHepState; ///< Heparin state. } TREATMENT_STATE_DATA_T; /// Payload record structure for a treatment set points message. Index: firmware/App/Modes/ModeTxParams.c =================================================================== diff -u -r50f4b79164155c1bc375dd3ff0e8588f934dc729 -ra5560a2917aa62bcafd8e6a81041ace723237109 --- firmware/App/Modes/ModeTxParams.c (.../ModeTxParams.c) (revision 50f4b79164155c1bc375dd3ff0e8588f934dc729) +++ firmware/App/Modes/ModeTxParams.c (.../ModeTxParams.c) (revision a5560a2917aa62bcafd8e6a81041ace723237109) @@ -499,6 +499,9 @@ TREATMENT_PARAMS_DATA_PAYLOAD_T params; U32 rejReasons[ NUM_OF_TREATMENT_PARAMS ]; + // Initialize reject reasons to zeroes + memset( (U08*)&rejReasons[0], 0, sizeof( U32 ) * NUM_OF_TREATMENT_PARAMS ); + // Verify message payload length is valid if ( sizeof( TREATMENT_PARAMS_DATA_PAYLOAD_T ) == message->hdr.payloadLen ) { @@ -523,27 +526,27 @@ paramsAreInvalid = FALSE; validTreatParamsReceived = TRUE; } - } - // Respond to set treatment parameters request message - sendTreatmentParamsResponse( paramsAreInvalid, &rejReasons[0] ); - // Send initial adjustable ranges to UI so UF volume range will be known when UF volume prompted for later - if ( TRUE == validTreatParamsReceived ) - { - U32 setTxDuration = stagedParams[ TREATMENT_PARAM_TREATMENT_DURATION ].uInt; - TREATMENT_PARAM_RANGE_BROADCAST_PAYLOAD_T payload; + // Respond to set treatment parameters request message + sendTreatmentParamsResponse( paramsAreInvalid, &rejReasons[0] ); + // Send initial adjustable ranges to UI so UF volume range will be known when UF volume prompted for later + if ( TRUE == validTreatParamsReceived ) + { + U32 setTxDuration = stagedParams[ TREATMENT_PARAM_TREATMENT_DURATION ].uInt; + TREATMENT_PARAM_RANGE_BROADCAST_PAYLOAD_T payload; - payload.minTreatmentTime = treatmentParameters[ TREATMENT_PARAM_TREATMENT_DURATION ].minimum.uInt; - payload.maxTreatmentTime = treatmentParameters[ TREATMENT_PARAM_TREATMENT_DURATION ].maximum.uInt; - payload.minUFVolume = 0.0F; - payload.maxUFVolume = MIN( (F32)setTxDuration * MAX_UF_RATE_ML_MIN, (F32)MAX_UF_VOLUME_ML ); - payload.minDialRate = treatmentParameters[ TREATMENT_PARAM_DIALYSATE_FLOW ].minimum.uInt; - payload.maxDialRate = treatmentParameters[ TREATMENT_PARAM_DIALYSATE_FLOW ].maximum.uInt; - sendMessage( MSG_ID_TD_TREATMENT_PARAM_RANGES, COMM_BUFFER_OUT_CAN_TD_2_UI, (U08*)(&payload), sizeof( TREATMENT_PARAM_RANGE_BROADCAST_PAYLOAD_T ) ); + payload.minTreatmentTime = treatmentParameters[ TREATMENT_PARAM_TREATMENT_DURATION ].minimum.uInt; + payload.maxTreatmentTime = treatmentParameters[ TREATMENT_PARAM_TREATMENT_DURATION ].maximum.uInt; + payload.minUFVolume = 0.0F; + payload.maxUFVolume = MIN( (F32)setTxDuration * MAX_UF_RATE_ML_MIN, (F32)MAX_UF_VOLUME_ML ); + payload.minDialRate = treatmentParameters[ TREATMENT_PARAM_DIALYSATE_FLOW ].minimum.uInt; + payload.maxDialRate = treatmentParameters[ TREATMENT_PARAM_DIALYSATE_FLOW ].maximum.uInt; + sendMessage( MSG_ID_TD_TREATMENT_PARAM_RANGES, COMM_BUFFER_OUT_CAN_TD_2_UI, (U08*)(&payload), sizeof( TREATMENT_PARAM_RANGE_BROADCAST_PAYLOAD_T ) ); + } + + result = ( TRUE == paramsAreInvalid ? FALSE : TRUE ); } - result = ( TRUE == paramsAreInvalid ? FALSE : TRUE ); - return result; } Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -r0901ce3d946bab5cae73edb102fc228a6533cb4b -ra5560a2917aa62bcafd8e6a81041ace723237109 --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 0901ce3d946bab5cae73edb102fc228a6533cb4b) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision a5560a2917aa62bcafd8e6a81041ace723237109) @@ -148,11 +148,13 @@ // Any new mode requests? newMode = arbitrateModeRequest(); // Will return current mode if no pending requests +#ifndef TEST_UI_ONLY // Verify mode transition is legal unless tester working with system TODO - restore check when all modes are implemented -// if ( ( isTestingActivated() != TRUE ) && ( getTestConfigStatus( TEST_CONFIG_RECOVER_TREATMENT ) != TRUE ) ) -// { -// newMode = MODE_TRANSITION_TABLE[ currentMode ][ newMode ]; -// } + if ( ( isTestingActivated() != TRUE ) && ( getTestConfigStatus( TEST_CONFIG_RECOVER_TREATMENT ) != TRUE ) ) + { + newMode = MODE_TRANSITION_TABLE[ currentMode ][ newMode ]; + } +#endif // Is requested new mode valid and legal at this time? if ( newMode >= MODE_NLEG ) Index: firmware/App/Monitors/Pressures.c =================================================================== diff -u -r036a75d76ab01912646a480b935d97187a231a19 -ra5560a2917aa62bcafd8e6a81041ace723237109 --- firmware/App/Monitors/Pressures.c (.../Pressures.c) (revision 036a75d76ab01912646a480b935d97187a231a19) +++ firmware/App/Monitors/Pressures.c (.../Pressures.c) (revision a5560a2917aa62bcafd8e6a81041ace723237109) @@ -806,7 +806,9 @@ { if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_TD_VENOUS_PRESSURE_LOW, venPresLow ) ) { +#ifndef TEST_UI_ONLY SET_ALARM_WITH_2_F32_DATA( ALARM_ID_TD_VENOUS_PRESSURE_LOW, venPres, (F32)currentVenousMinLimit ); +#endif } } // during reset period, if airTrapValve open, still alarm needs to be raised , hence persistence clearance should happen before or after reset period. Index: firmware/App/Services/DDInterface.c =================================================================== diff -u -r959f16a2530e68b517cbb5c12c430d5aef4c5f9d -ra5560a2917aa62bcafd8e6a81041ace723237109 --- firmware/App/Services/DDInterface.c (.../DDInterface.c) (revision 959f16a2530e68b517cbb5c12c430d5aef4c5f9d) +++ firmware/App/Services/DDInterface.c (.../DDInterface.c) (revision a5560a2917aa62bcafd8e6a81041ace723237109) @@ -305,7 +305,9 @@ dialysateDeliveryCmdSet.acidType = (U32)acid; dialysateDeliveryCmdSet.bicarbType = (U32)bicarb; +#ifndef TEST_UI_ONLY sendMessage( MSG_ID_DD_GEN_DIALYSATE_REQUEST_DATA, COMM_BUFFER_OUT_CAN_TD_2_DD, (U08*)(&dialysateDeliveryCmdSet), sizeof( DIALYSATE_DELIVERY_REQ_PAYLOAD_T ) ); +#endif ddStartCommandSent = TRUE; } @@ -324,7 +326,9 @@ if ( TRUE == dialysateDeliveryCmdSet.start ) { dialysateDeliveryCmdSet.dialRate = qd; +#ifndef TEST_UI_ONLY sendMessage( MSG_ID_DD_GEN_DIALYSATE_REQUEST_DATA, COMM_BUFFER_OUT_CAN_TD_2_DD, (U08*)(&dialysateDeliveryCmdSet), sizeof( DIALYSATE_DELIVERY_REQ_PAYLOAD_T ) ); +#endif } else { @@ -347,7 +351,9 @@ if ( TRUE == dialysateDeliveryCmdSet.start ) { dialysateDeliveryCmdSet.ufRate = quf; +#ifndef TEST_UI_ONLY sendMessage( MSG_ID_DD_GEN_DIALYSATE_REQUEST_DATA, COMM_BUFFER_OUT_CAN_TD_2_DD, (U08*)(&dialysateDeliveryCmdSet), sizeof( DIALYSATE_DELIVERY_REQ_PAYLOAD_T ) ); +#endif } else { @@ -371,7 +377,9 @@ if ( TRUE == dialysateDeliveryCmdSet.start ) { dialysateDeliveryCmdSet.bypassDialyzer = bypass; +#ifndef TEST_UI_ONLY sendMessage( MSG_ID_DD_GEN_DIALYSATE_REQUEST_DATA, COMM_BUFFER_OUT_CAN_TD_2_DD, (U08*)(&dialysateDeliveryCmdSet), sizeof( DIALYSATE_DELIVERY_REQ_PAYLOAD_T ) ); +#endif } else { @@ -393,7 +401,9 @@ memset( &dialysateDeliveryCmdSet, 0, sizeof( DIALYSATE_DELIVERY_REQ_PAYLOAD_T ) ); dialysateDeliveryCmdSet.start = FALSE; +#ifndef TEST_UI_ONLY sendMessage( MSG_ID_DD_GEN_DIALYSATE_REQUEST_DATA, COMM_BUFFER_OUT_CAN_TD_2_DD, (U08*)(&dialysateDeliveryCmdSet), sizeof( DIALYSATE_DELIVERY_REQ_PAYLOAD_T ) ); +#endif } /*********************************************************************//** Index: firmware/App/Services/SystemCommTD.c =================================================================== diff -u -r512065f0a0c9ba2c335e8856b790e8448852fc52 -ra5560a2917aa62bcafd8e6a81041ace723237109 --- firmware/App/Services/SystemCommTD.c (.../SystemCommTD.c) (revision 512065f0a0c9ba2c335e8856b790e8448852fc52) +++ firmware/App/Services/SystemCommTD.c (.../SystemCommTD.c) (revision a5560a2917aa62bcafd8e6a81041ace723237109) @@ -257,7 +257,7 @@ if ( TRUE == didTimeout( timeOfLastDDCheckIn, DG_COMM_TIMEOUT_IN_MS ) ) { -#ifndef RUN_WITHOUT_DD +#ifndef TEST_UI_ONLY // Only alarm on DG comm loss while in the treatment workflow if ( MODE_PRET == opMode || MODE_TREA == opMode || MODE_POST == opMode ) { Index: firmware/App/TDCommon.h =================================================================== diff -u -r23fed28d7b9ebcfec8bc9494f12b6ac06645d881 -ra5560a2917aa62bcafd8e6a81041ace723237109 --- firmware/App/TDCommon.h (.../TDCommon.h) (revision 23fed28d7b9ebcfec8bc9494f12b6ac06645d881) +++ firmware/App/TDCommon.h (.../TDCommon.h) (revision a5560a2917aa62bcafd8e6a81041ace723237109) @@ -34,6 +34,8 @@ // #define TASK_TIMING_OUTPUT_ENABLED 1 // Re-purposes alarm lamp pins for task timing // #define TEST_AIR_TRAP_ALPHA_TESTING 1 // Alpha unit air trap testing // #define TEST_PINCH_VALVES 1 // Alpha unit pinch valve testing +// #define TEST_UI_ONLY 1 // Alpha test with TD and UI only - no DD +// #define TEST_NO_PINCH_VALVES 1 // Alpha test with no pinch valve functionality #include #include