Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -re3699de422fa3ba1b8145c4cc44257702c9e336f -re7fe0454b5b2d39009dc784dc8c156856df8bc86 --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision e3699de422fa3ba1b8145c4cc44257702c9e336f) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision e7fe0454b5b2d39009dc784dc8c156856df8bc86) @@ -542,6 +542,8 @@ * @details \b Outputs: none * @details \b Alarms: ALARM_ID_DD_SOFTWARE_FAULT when invalid pump ID is seen. * @param pumpId concentrate pump id to increase current step speed + * @Note Pump speed is referred as flow rate as they are directly related across + * the concentrate pump unit. * @return the current measured flow rate (in mL/min) for the given concentrate * pump. *************************************************************************/ @@ -1056,211 +1058,83 @@ * concentrate pump data publish interval. * @details \b Inputs: none * @details \b Outputs: concentratePumpDataPublishInterval - * @param value override concentrate pump data publish interval with (in ms) + * @param Override message from Dialin which includes the interval + * (in ms) to override the concentrate pump data broadcast interval to. * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testConcentratePumpDataPublishIntervalOverride( MESSAGE_T *message ) { - BOOL result = FALSE; - TEST_OVERRIDE_PAYLOAD_T override; - OVERRIDE_TYPE_T ovType = getOverridePayloadFromMessage( message, &override ); + BOOL result = u32BroadcastIntervalOverride( message, &concentratePumpDataPublishInterval, TASK_GENERAL_INTERVAL ); - // Verify tester has logged in with TD and override type is valid - if ( ( TRUE == isTestingActivated() ) && ( ovType != OVERRIDE_INVALID ) && ( ovType < NUM_OF_OVERRIDE_TYPES ) ) - { - if ( OVERRIDE_OVERRIDE == ovType ) - { - U32 intvl = override.state.u32 / TASK_GENERAL_INTERVAL; - - concentratePumpDataPublishInterval.ovData = intvl; - concentratePumpDataPublishInterval.override = OVERRIDE_KEY; - } - else - { - concentratePumpDataPublishInterval.override = OVERRIDE_RESET; - concentratePumpDataPublishInterval.ovData = concentratePumpDataPublishInterval.ovInitData; - } - - result = TRUE; - } - return result; } /*********************************************************************//** * @brief - * The testSetConcentratePumpTargetSpeedOverride function overrides the target + * The testConcentratePumpTargetSpeedOverride function overrides the target * speed value of given concentrate pump id. * @details \b Inputs: none * @details \b Outputs: pumpTargetSpeed - * @param pumpId concentrate pump id - * @param value override concentrate pump target speed + * @param message Override message from Dialin which includes an ID of + * the pump to override and the state to override the pump to. * @return TRUE if override successful, FALSE if not * @note pump traget speed range should be between 3.0F and 45.0F. *************************************************************************/ BOOL testConcentratePumpTargetSpeedOverride( MESSAGE_T *message ) { - BOOL result = FALSE; - TEST_OVERRIDE_ARRAY_PAYLOAD_T override; - OVERRIDE_TYPE_T ovType = getOverrideArrayPayloadFromMessage( message, &override ); + BOOL result = f32ArrayOverride( message, &concentratePumps[0].pumpTargetSpeed, NUM_OF_CONCENTRATE_PUMPS - 1 ); - // Verify tester has logged in with DD and override type is valid - if ( ( TRUE == isTestingActivated() ) && ( ovType != OVERRIDE_INVALID ) && ( ovType < NUM_OF_OVERRIDE_TYPES ) ) - { - U32 pumpId = override.index; - - // Verify concentrate pump index of override - if ( pumpId < NUM_OF_CONCENTRATE_PUMPS ) - { - if ( OVERRIDE_OVERRIDE == ovType ) - { - F32 value = override.state.f32; - - concentratePumps[ pumpId ].pumpTargetSpeed.ovData = value; - concentratePumps[ pumpId ].pumpTargetSpeed.override = OVERRIDE_KEY; - } - else - { - concentratePumps[ pumpId ].pumpTargetSpeed.override = OVERRIDE_RESET; - concentratePumps[ pumpId ].pumpTargetSpeed.ovData = concentratePumps[ pumpId ].pumpTargetSpeed.ovInitData; - } - - result = TRUE; - } - } - return result; } /*********************************************************************//** * @brief - * The testSetConcentratePumpMeasuredSpeedOverride function overrides the + * The testConcentratePumpMeasuredSpeedOverride function overrides the * measured speed value of given concentrate pump id. * @details \b Inputs: none - * @details \b Outputs: measuredPumpSpeed[] - * @param pumpId concentrate pump id - * @param value override concentrate pump measured speed + * @details \b Outputs: measuredPumpSpeed + * @param message Override message from Dialin which includes an ID of + * the pump to override and the state to override the pump to. * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testConcentratePumpMeasuredSpeedOverride( MESSAGE_T *message ) { - BOOL result = FALSE; - TEST_OVERRIDE_ARRAY_PAYLOAD_T override; - OVERRIDE_TYPE_T ovType = getOverrideArrayPayloadFromMessage( message, &override ); + BOOL result = f32ArrayOverride( message, &concentratePumps[0].measuredPumpSpeed, NUM_OF_CONCENTRATE_PUMPS - 1 ); - // Verify tester has logged in with DD and override type is valid - if ( ( TRUE == isTestingActivated() ) && ( ovType != OVERRIDE_INVALID ) && ( ovType < NUM_OF_OVERRIDE_TYPES ) ) - { - U32 pumpId = override.index; - - // Verify concentrate pump index of override - if ( pumpId < NUM_OF_CONCENTRATE_PUMPS ) - { - if ( OVERRIDE_OVERRIDE == ovType ) - { - F32 value = override.state.f32; - - concentratePumps[ pumpId ].measuredPumpSpeed.ovData = value; - concentratePumps[ pumpId ].measuredPumpSpeed.override = OVERRIDE_KEY; - } - else - { - concentratePumps[ pumpId ].measuredPumpSpeed.override = OVERRIDE_RESET; - concentratePumps[ pumpId ].measuredPumpSpeed.ovData = concentratePumps[ pumpId ].measuredPumpSpeed.ovInitData; - } - - result = TRUE; - } - } - return result; } /*********************************************************************//** * @brief - * The testSetConcentratePumpParkedOverride function overrides the parked + * The testConcentratePumpParkedOverride function overrides the parked * status of given concentrate pump id. * @details \b Inputs: none - * @details \b Outputs: parked[] - * @param pumpId concentrate pump id - * @param value override concentrate pump parked status + * @details \b Outputs: parked + * @param message Override message from Dialin which includes an ID of + * the pump to override and the state to override the pump to. * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testConcentratePumpParkedOverride( MESSAGE_T *message ) { - BOOL result = FALSE; - TEST_OVERRIDE_ARRAY_PAYLOAD_T override; - OVERRIDE_TYPE_T ovType = getOverrideArrayPayloadFromMessage( message, &override ); + BOOL result = u32ArrayOverride( message, &concentratePumps[0].parked, NUM_OF_CONCENTRATE_PUMPS - 1, FALSE, TRUE ); - // Verify tester has logged in with DD and override type is valid - if ( ( TRUE == isTestingActivated() ) && ( ovType != OVERRIDE_INVALID ) && ( ovType < NUM_OF_OVERRIDE_TYPES ) ) - { - U32 pumpId = override.index; - - // Verify concentrate pump index of override - if ( pumpId < NUM_OF_CONCENTRATE_PUMPS ) - { - if ( OVERRIDE_OVERRIDE == ovType ) - { - U32 value = override.state.u32; - - concentratePumps[ pumpId ].parked.ovData = value; - concentratePumps[ pumpId ].parked.override = OVERRIDE_KEY; - } - else - { - concentratePumps[ pumpId ].parked.override = OVERRIDE_RESET; - concentratePumps[ pumpId ].parked.ovData = concentratePumps[ pumpId ].parked.ovInitData; - } - - result = TRUE; - } - } - return result; } /*********************************************************************//** * @brief - * The testSetConcentratePumpParkCmdFaultedOverride function overrides the + * The testConcentratePumpParkCmdFaultedOverride function overrides the * park command fault status of given concentrate pump id. * @details \b Inputs: none - * @details \b Outputs: parkFaulted[] - * @param pumpId concentrate pump id - * @param value override concentrate pump park command faulted status + * @details \b Outputs: parkFaulted + * @param message Override message from Dialin which includes an ID of + * the pump to override and the state to override the pump to. * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testConcentratePumpParkCmdFaultedOverride( MESSAGE_T *message ) { - BOOL result = FALSE; - TEST_OVERRIDE_ARRAY_PAYLOAD_T override; - OVERRIDE_TYPE_T ovType = getOverrideArrayPayloadFromMessage( message, &override ); + BOOL result = u32ArrayOverride( message, &concentratePumps[0].parkFaulted, NUM_OF_CONCENTRATE_PUMPS - 1, FALSE, TRUE ); - // Verify tester has logged in with DD and override type is valid - if ( ( TRUE == isTestingActivated() ) && ( ovType != OVERRIDE_INVALID ) && ( ovType < NUM_OF_OVERRIDE_TYPES ) ) - { - U32 pumpId = override.index; - - // Verify concentrate pump index of override - if ( pumpId < NUM_OF_CONCENTRATE_PUMPS ) - { - if ( OVERRIDE_OVERRIDE == ovType ) - { - U32 value = override.state.u32; - - concentratePumps[ pumpId ].parkFaulted.ovData = value; - concentratePumps[ pumpId ].parkFaulted.override = OVERRIDE_KEY; - } - else - { - concentratePumps[ pumpId ].parkFaulted.override = OVERRIDE_RESET; - concentratePumps[ pumpId ].parkFaulted.ovData = concentratePumps[ pumpId ].parkFaulted.ovInitData; - } - - result = TRUE; - } - } - return result; } @@ -1270,7 +1144,8 @@ * to park request. * @details \b Inputs: concentratePumps * @details \b Outputs: concentratePumps - * @param pumpId concentrate pump id + * @param message Override message from Dialin which includes an ID of + * the pump to override and the state to override the pump to. * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testConcentratePumpParkRequestOverride( MESSAGE_T *message )