Disable Order Check PL PCDU #825

Merged
muellerr merged 10 commits from disable-order-check-plpcdu into main 2023-11-29 15:13:58 +01:00
Showing only changes of commit c0b4761ba0 - Show all commits

View File

@ -429,20 +429,20 @@ void PayloadPcduHandler::checkAdcValues() {
params.getValue(PARAM_KEY_MAP[NEG_V_UPPER_BOUND], upperBound);
if (not checkVoltage(adcSet.processed[U_NEG_V_FB], lowerBound, upperBound,
NEG_V_OUT_OF_BOUNDS)) {
sif::warning << "Negative voltage was out of bounds, went back to OFF" << std::endl;
meggert marked this conversation as resolved
Review

shouldn't these also be events?

shouldn't these also be events?
Review

I think an event gets triggered in the checker function, checking again..

I think an event gets triggered in the checker function, checking again..
Review

can confirm the events already get triggered in checkVoltage and checkCurrent

can confirm the events already get triggered in `checkVoltage` and `checkCurrent`
return;
}
params.getValue(PARAM_KEY_MAP[DRO_U_LOWER_BOUND], lowerBound);
params.getValue(PARAM_KEY_MAP[DRO_U_UPPER_BOUND], upperBound);
if (not checkVoltage(adcSet.processed[U_DRO_DIV_6], lowerBound, upperBound,
U_DRO_OUT_OF_BOUNDS)) {
sif::warning << "DRO voltage was out of bounds, went back to OFF" << std::endl;
return;
}
params.getValue(PARAM_KEY_MAP[DRO_I_UPPER_BOUND], upperBound);
if (not checkCurrent(adcSet.processed[I_DRO], upperBound, I_DRO_OUT_OF_BOUNDS)) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::warning << "Detected out of bounds current for DRO: " << adcSet.processed[I_DRO]
<< ", Raw: " << adcSet.channels[I_DRO] << std::endl;
#endif
return;
}
}
@ -456,10 +456,12 @@ void PayloadPcduHandler::checkAdcValues() {
params.getValue(PARAM_KEY_MAP[X8_U_UPPER_BOUND], upperBound);
if (not checkVoltage(adcSet.processed[U_X8_DIV_6], lowerBound, upperBound,
U_X8_OUT_OF_BOUNDS)) {
sif::warning << "X8 voltage was out of bounds, went back to OFF" << std::endl;
return;
}
params.getValue(PARAM_KEY_MAP[X8_I_UPPER_BOUND], upperBound);
if (not checkCurrent(adcSet.processed[I_X8], upperBound, I_X8_OUT_OF_BOUNDS)) {
sif::warning << "X8 current was out of bounds, went back to OFF" << std::endl;
return;
}
}
@ -473,10 +475,12 @@ void PayloadPcduHandler::checkAdcValues() {
params.getValue(PARAM_KEY_MAP[TX_U_UPPER_BOUND], upperBound);
if (not checkVoltage(adcSet.processed[U_TX_DIV_6], lowerBound, upperBound,
U_TX_OUT_OF_BOUNDS)) {
sif::warning << "TX voltage was out of bounds, went back to OFF" << std::endl;
return;
}
params.getValue(PARAM_KEY_MAP[TX_I_UPPER_BOUND], upperBound);
if (not checkCurrent(adcSet.processed[I_TX], upperBound, I_TX_OUT_OF_BOUNDS)) {
sif::warning << "TX current was out of bounds, went back to OFF" << std::endl;
return;
}
}
@ -490,10 +494,12 @@ void PayloadPcduHandler::checkAdcValues() {
params.getValue(PARAM_KEY_MAP[MPA_U_UPPER_BOUND], upperBound);
if (not checkVoltage(adcSet.processed[U_MPA_DIV_6], lowerBound, upperBound,
U_MPA_OUT_OF_BOUNDS)) {
sif::warning << "MPA voltage was out of bounds, went back to OFF" << std::endl;
return;
}
params.getValue(PARAM_KEY_MAP[MPA_I_UPPER_BOUND], upperBound);
if (not checkCurrent(adcSet.processed[I_MPA], upperBound, I_MPA_OUT_OF_BOUNDS)) {
sif::warning << "MPA current was out of bounds, went back to OFF" << std::endl;
return;
}
}
@ -507,6 +513,7 @@ void PayloadPcduHandler::checkAdcValues() {
params.getValue(PARAM_KEY_MAP[HPA_U_UPPER_BOUND], upperBound);
if (not checkVoltage(adcSet.processed[U_HPA_DIV_6], lowerBound, upperBound,
U_HPA_OUT_OF_BOUNDS)) {
sif::warning << "HPA voltage was out of bounds, went back to OFF" << std::endl;
return;
}
params.getValue(PARAM_KEY_MAP[HPA_I_UPPER_BOUND], upperBound);
@ -595,6 +602,7 @@ ReturnValue_t PayloadPcduHandler::checkModeCommand(Mode_t commandedMode, Submode
txOnForSubmode(commandedSubmode) or mpaOnForSubmode(commandedSubmode) or
hpaOnForSubmode(commandedSubmode)) and
not ssrOnForSubmode(dhbSubmode)) {
return TRANS_NOT_ALLOWED;
}
if (disableChannelOrderCheck) {
return returnvalue::OK;
@ -606,7 +614,7 @@ ReturnValue_t PayloadPcduHandler::checkModeCommand(Mode_t commandedMode, Submode
(not droOnForSubmode(dhbSubmode) or not x8OnForSubmode(dhbSubmode))) {
return TRANS_NOT_ALLOWED;
}
if (txOnForSubmode(commandedSubmode) and
if (mpaOnForSubmode(commandedSubmode) and
(not droOnForSubmode(dhbSubmode) or not x8OnForSubmode(dhbSubmode) or
not txOnForSubmode(dhbSubmode))) {
return TRANS_NOT_ALLOWED;
@ -628,13 +636,9 @@ bool PayloadPcduHandler::droOnForSubmode(uint8_t submode) {
return submode & (1 << plpcdu::DRO_ON);
}
bool PayloadPcduHandler::x8OnForSubmode(uint8_t submode) {
return submode & (1 << plpcdu::X8_ON);
}
bool PayloadPcduHandler::x8OnForSubmode(uint8_t submode) { return submode & (1 << plpcdu::X8_ON); }
bool PayloadPcduHandler::txOnForSubmode(uint8_t submode) {
return submode & (1 << plpcdu::TX_ON);
}
bool PayloadPcduHandler::txOnForSubmode(uint8_t submode) { return submode & (1 << plpcdu::TX_ON); }
bool PayloadPcduHandler::mpaOnForSubmode(uint8_t submode) {
return submode & (1 << plpcdu::MPA_ON);