Index: firmware/App/Services/AlarmMgmtTD.c =================================================================== diff -u -r395522dffef1348e176564925656012f529c1910 -r1275f9e92eb1ab0cd1b321c0c8eb940524e22117 --- firmware/App/Services/AlarmMgmtTD.c (.../AlarmMgmtTD.c) (revision 395522dffef1348e176564925656012f529c1910) +++ firmware/App/Services/AlarmMgmtTD.c (.../AlarmMgmtTD.c) (revision 1275f9e92eb1ab0cd1b321c0c8eb940524e22117) @@ -157,6 +157,7 @@ alarmStatus.noBloodRecirc = FALSE; alarmStatus.noDialRecirc = FALSE; alarmStatus.ok = FALSE; + alarmStatus.noTempBreak = FALSE; alarmsBlockedTimer = 0; lastUserAlarmActionReceivedTime = 0; @@ -498,6 +499,13 @@ } break; + case ALARM_USER_ACTION_TEMPORARY_BREAK: + if ( ( alarmStatus.noTempBreak != TRUE ) && ( alarmStatus.noRinseback != TRUE ) ) + { + alarmActionIsValid = TRUE; + } + break; + default: SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_ALARM_USER_ACTION1, action ); break; @@ -544,7 +552,8 @@ break; case ALARM_USER_ACTION_RINSEBACK: - initiateAlarmAction( ALARM_ACTION_RINSEBACK ); + // Send message to UI to get user confirmation to rinseback (blood return & end treatment) - action initiated only upon receipt of user confirmation from UI + addConfirmationRequest( GENERIC_CONFIRM_ID_RINSEBACK, GENERIC_CONFIRM_CMD_REQUEST_OPEN, 0 ); break; case ALARM_USER_ACTION_END_TREATMENT: @@ -556,6 +565,11 @@ initiateAlarmAction( ALARM_ACTION_ACK ); break; + case ALARM_USER_ACTION_TEMPORARY_BREAK: + // Send message to UI to get user confirmation to temporary break - action initiated only upon receipt of user confirmation from UI + addConfirmationRequest( GENERIC_CONFIRM_ID_TEMPORARY_BREAK, GENERIC_CONFIRM_CMD_REQUEST_OPEN, 0 ); + break; + // This default cannot be reached in VectorCAST due to check above for alarmActionIsValid #ifndef _VECTORCAST_ default: @@ -925,24 +939,54 @@ /*********************************************************************//** * @brief * The monitorAlarms function monitors alarm audio current and also looks - * for and executes a user confirmation of user request to end treatment. + * for and executes a user confirmation of user request to shutdown, + * end treatment, temporary break, rinseback. * @details \b Inputs: none * @details \b Outputs: none * @return none *************************************************************************/ static void monitorAlarms( void ) { + GENERIC_CONFIRM_ID_T confirmID = getPendingConfirmationID(); + execAlarmAudio(); - // Check for user confirmation of end treatment alarm response - if ( CONFIRMATION_REQUEST_STATUS_ACCEPTED == getConfirmationRequestStatus( GENERIC_CONFIRM_ID_TREATMENT_END ) ) + if ( ( GENERIC_CONFIRM_ID_NONE != confirmID ) && + ( CONFIRMATION_REQUEST_STATUS_ACCEPTED == getConfirmationRequestStatus( confirmID ) ) ) { - // To avoid raising repeated alarm before reaching end treatment - setVenousBubbleDetectionEnabled( H18_BBLD, FALSE ); - clearAllRecoverableAlarms( ALARM_USER_ACTION_END_TREATMENT ); - initiateAlarmAction( ALARM_ACTION_END_TREATMENT ); + switch ( confirmID ) + { + case GENERIC_CONFIRM_ID_SHUT_DOWN: + // TODO — handle shutdown confirmation + break; + + case GENERIC_CONFIRM_ID_TREATMENT_END: + setVenousBubbleDetectionEnabled( H18_BBLD, FALSE ); + clearAllRecoverableAlarms( ALARM_USER_ACTION_END_TREATMENT ); + initiateAlarmAction( ALARM_ACTION_END_TREATMENT ); + break; + + case GENERIC_CONFIRM_ID_RINSEBACK: + clearAllRecoverableAlarms( ALARM_USER_ACTION_RINSEBACK ); + initiateAlarmAction( ALARM_ACTION_RINSEBACK ); + break; + + case GENERIC_CONFIRM_ID_TEMPORARY_BREAK: + clearAllRecoverableAlarms( ALARM_USER_ACTION_TEMPORARY_BREAK ); + initiateAlarmAction( ALARM_ACTION_TEMPORARY_BREAK ); + break; + + default: + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, + SW_FAULT_ID_ALARM_MGMT_INVALID_CONFIRM_ID, + (U32)confirmID ); + break; + } } + // Timeout pending confirmation dialog if user does not respond within 1 minute + handleConfirmationDialogTimeout(); + // TODO - Check current vs. expected audio output } @@ -1150,6 +1194,7 @@ BOOL endTxOnlyAlarmActive = FALSE; BOOL usrAckReq = FALSE; BOOL noMinimize = TRUE; + BOOL noTempBreak = FALSE; TD_OP_MODE_T currentMode = getCurrentOperationMode(); ALARM_T propsTop = getAlarmProperties( alarmStatus.alarmTop ); ALARM_ID_T a; @@ -1158,10 +1203,12 @@ alarmButtonBlockers[ ALARM_BUTTON_STATE_BLOCK_RESUME ] = ( TRUE == alarmUserRecoveryActionEnabled[ ALARM_USER_ACTION_RESUME ] ? FALSE : TRUE ); alarmButtonBlockers[ ALARM_BUTTON_STATE_BLOCK_RINSEBACK ] = ( TRUE == alarmUserRecoveryActionEnabled[ ALARM_USER_ACTION_RINSEBACK ] ? FALSE : TRUE ); alarmButtonBlockers[ ALARM_BUTTON_STATE_BLOCK_END_TREATMENT ] = ( TRUE == alarmUserRecoveryActionEnabled[ ALARM_USER_ACTION_END_TREATMENT ] ? FALSE : TRUE ); + alarmButtonBlockers[ ALARM_BUTTON_STATE_BLOCK_TEMP_BREAK ] = ( TRUE == alarmUserRecoveryActionEnabled[ ALARM_USER_ACTION_TEMPORARY_BREAK ] ? FALSE : TRUE ); // Reset user alarm recovery actions allowed by active alarms flags alarmButtonBlockers[ ALARM_BUTTON_TABLE_BLOCK_RESUME ] = FALSE; alarmButtonBlockers[ ALARM_BUTTON_TABLE_BLOCK_RINSEBACK ] = FALSE; alarmButtonBlockers[ ALARM_BUTTON_TABLE_BLOCK_END_TREATMENT ] = FALSE; + alarmButtonBlockers[ ALARM_BUTTON_TABLE_BLOCK_TEMP_BREAK ] = FALSE; // Determine alarm flags for ( a = ALARM_ID_NO_ALARM; a < NUM_OF_ALARM_IDS; a++ ) @@ -1178,6 +1225,7 @@ alarmButtonBlockers[ ALARM_BUTTON_TABLE_BLOCK_RESUME ] |= props.alarmNoResume; alarmButtonBlockers[ ALARM_BUTTON_TABLE_BLOCK_RINSEBACK ] |= props.alarmNoRinseback; alarmButtonBlockers[ ALARM_BUTTON_TABLE_BLOCK_END_TREATMENT ] |= props.alarmNoEndTreatment; + alarmButtonBlockers[ ALARM_BUTTON_TABLE_BLOCK_TEMP_BREAK ] |= props.alarmNoRinseback; if ( TRUE == alarmUserRecoveryActionEnabled[ ALARM_USER_ACTION_RESUME ] ) { noResume = ( TRUE == props.alarmNoResume ? TRUE : noResume ); @@ -1202,6 +1250,14 @@ { noEndTreatment = TRUE; } + if ( TRUE == alarmUserRecoveryActionEnabled[ ALARM_USER_ACTION_TEMPORARY_BREAK ] ) + { + noTempBreak = ( TRUE == props.alarmNoRinseback ? TRUE : noTempBreak ); + } + else + { + noTempBreak = TRUE; + } // if there are any active alarms that only allow end treatment, set flag so we can ensure we do not allow OK option. if ( ( TRUE == props.alarmNoResume ) && ( TRUE == props.alarmNoRinseback ) && @@ -1227,6 +1283,7 @@ noResume = TRUE; noRinseback = TRUE; noEndTreatment = TRUE; + noTempBreak = TRUE; } // if OK option enabled and there are any active alarms that only allow end treatment, block OK option and allow end treatment option (DEN-16594). @@ -1243,6 +1300,7 @@ noResume = TRUE; noRinseback = TRUE; noEndTreatment = TRUE; + noTempBreak = TRUE; } // If in Treatment-Stop state or Fault/Service/Standby Mode, allow user to minimize the alarm window @@ -1261,6 +1319,7 @@ alarmStatus.noEndTreatment = noEndTreatment; alarmStatus.ok = usrAckReq; alarmStatus.noMinimize = noMinimize; + alarmStatus.noTempBreak = noTempBreak; resumeBlockedByAlarmProperty = noResumePerAlarmPropertyOnly; } @@ -1399,6 +1458,7 @@ payload.alarmsFlags |= ( almStatus.noResume ? BIT_BY_POS(ALARM_STATE_FLAG_BIT_POS_NO_RESUME) : 0 ); payload.alarmsFlags |= ( almStatus.noRinseback ? BIT_BY_POS(ALARM_STATE_FLAG_BIT_POS_NO_RINSEBACK) : 0 ); payload.alarmsFlags |= ( almStatus.noEndTreatment ? BIT_BY_POS(ALARM_STATE_FLAG_BIT_POS_NO_END_TREATMENT) : 0 ); + payload.alarmsFlags |= ( almStatus.noTempBreak ? BIT_BY_POS(ALARM_STATE_FLAG_BIT_POS_NO_TEMPORARY_BREAK) : 0 ); payload.alarmsFlags |= ( almStatus.ok ? BIT_BY_POS(ALARM_STATE_FLAG_BIT_POS_OK_BUTTON_ONLY) : 0 ); payload.alarmsFlags |= ( almStatus.alarmsSilenced ? BIT_BY_POS(ALARM_STATE_FLAG_BIT_POS_ALARMS_SILENCED) : 0 ); payload.alarmsFlags |= ( almStatus.lampOn ? BIT_BY_POS(ALARM_STATE_FLAG_BIT_POS_LAMP_ON) : 0 );