From 1a0f9164efe241aa7ee933f1589e5973926adf8a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 14 Mar 2022 14:46:26 +0100 Subject: [PATCH] Add Latchup print commands --- bsp_q7s/core/CoreController.cpp | 8 +-- bsp_q7s/core/CoreController.h | 2 +- bsp_q7s/core/CoreDefinitions.h | 13 ++-- bsp_q7s/xadc/Xadc.h | 1 + mission/devices/GomspaceDeviceHandler.cpp | 5 +- mission/devices/P60DockHandler.cpp | 67 +++++++++++++++---- mission/devices/P60DockHandler.h | 4 +- mission/devices/PDU1Handler.cpp | 50 ++++++++++++-- mission/devices/PDU1Handler.h | 5 +- mission/devices/PDU2Handler.cpp | 60 ++++++++++++++--- mission/devices/PDU2Handler.h | 5 +- .../devicedefinitions/GomspaceDefinitions.h | 2 + tmtc | 2 +- 13 files changed, 174 insertions(+), 50 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index ab557013..b0b7213c 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -72,10 +72,10 @@ ReturnValue_t CoreController::initializeLocalDataPool(localpool::DataPool &local } LocalPoolDataSetBase *CoreController::getDataSetHandle(sid_t sid) { - if (sid.ownerSetId == core::HK_SET_ID) { - return &hkSet; - } - return nullptr; + if (sid.ownerSetId == core::HK_SET_ID) { + return &hkSet; + } + return nullptr; } ReturnValue_t CoreController::initialize() { diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index e890ae51..e31378ef 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -6,10 +6,10 @@ #include +#include "CoreDefinitions.h" #include "bsp_q7s/memory/SdCardManager.h" #include "events/subsystemIdRanges.h" #include "fsfw/controller/ExtendedControllerBase.h" -#include "CoreDefinitions.h" class Timer; class SdCardManager; diff --git a/bsp_q7s/core/CoreDefinitions.h b/bsp_q7s/core/CoreDefinitions.h index 6439af71..91896301 100644 --- a/bsp_q7s/core/CoreDefinitions.h +++ b/bsp_q7s/core/CoreDefinitions.h @@ -8,18 +8,13 @@ namespace core { static const uint8_t HK_SET_ENTRIES = 3; static const uint32_t HK_SET_ID = 5; -enum PoolIds { - TEMPERATURE, - PS_VOLTAGE, - PL_VOLTAGE -}; +enum PoolIds { TEMPERATURE, PS_VOLTAGE, PL_VOLTAGE }; /** * @brief Set storing OBC internal housekeeping data */ class HkSet : public StaticLocalDataSet { public: - HkSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, HK_SET_ID) {} HkSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, HK_SET_ID)) {} @@ -32,13 +27,13 @@ class HkSet : public StaticLocalDataSet { lp_var_t plVoltage = lp_var_t(sid.objectId, PoolIds::PL_VOLTAGE, this); void printSet() { - sif::info << "HkSet::printSet: On-chip temperature: " << this->temperature - << " °C" << std::endl; + sif::info << "HkSet::printSet: On-chip temperature: " << this->temperature << " °C" + << std::endl; sif::info << "HkSet::printSet: PS voltage: " << this->psVoltage << " mV" << std::endl; sif::info << "HkSet::printSet: PL voltage: " << this->plVoltage << " mV" << std::endl; } }; -} +} // namespace core #endif /* BSP_Q7S_CORE_COREDEFINITIONS_H_ */ diff --git a/bsp_q7s/xadc/Xadc.h b/bsp_q7s/xadc/Xadc.h index f8c6e7b6..92ec2c0c 100644 --- a/bsp_q7s/xadc/Xadc.h +++ b/bsp_q7s/xadc/Xadc.h @@ -2,6 +2,7 @@ #define BSP_Q7S_XADC_XADC_H_ #include + #include "fsfw/returnvalues/HasReturnvaluesIF.h" namespace xadc { diff --git a/mission/devices/GomspaceDeviceHandler.cpp b/mission/devices/GomspaceDeviceHandler.cpp index c69d8d30..25bde5db 100644 --- a/mission/devices/GomspaceDeviceHandler.cpp +++ b/mission/devices/GomspaceDeviceHandler.cpp @@ -1,6 +1,7 @@ #include "GomspaceDeviceHandler.h" #include + #include "devicedefinitions/GomSpacePackets.h" #include "devicedefinitions/powerDefinitions.h" @@ -73,7 +74,8 @@ ReturnValue_t GomspaceDeviceHandler::buildCommandFromCommand(DeviceCommandId_t d } break; } - case (GOMSPACE::PRINT_SWITCH_V_I): { + case (GOMSPACE::PRINT_SWITCH_V_I): + case (GOMSPACE::PRINT_LATCHUPS): { result = printStatus(deviceCommand); break; } @@ -98,6 +100,7 @@ void GomspaceDeviceHandler::fillCommandAndReplyMap() { this->insertInCommandAndReplyMap(GOMSPACE::REQUEST_HK_TABLE, 3); this->insertInCommandMap(GOMSPACE::GNDWDT_RESET); this->insertInCommandMap(GOMSPACE::PRINT_SWITCH_V_I); + this->insertInCommandMap(GOMSPACE::PRINT_LATCHUPS); } ReturnValue_t GomspaceDeviceHandler::scanForReply(const uint8_t* start, size_t remainingSize, diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index a89debc6..e9df1a1b 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -444,45 +444,56 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &local } ReturnValue_t P60DockHandler::printStatus(DeviceCommandId_t cmd) { + ReturnValue_t result = RETURN_OK; switch (cmd) { case (GOMSPACE::PRINT_SWITCH_V_I): { PoolReadGuard pg(&p60dockHkTableDataset); - ReturnValue_t readResult = pg.getReadResult(); - if (readResult != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "Reading PDU1 HK table failed!" << std::endl; - return HasReturnvaluesIF::RETURN_FAILED; + result = pg.getReadResult(); + if (result != HasReturnvaluesIF::RETURN_OK) { + break; + } + printHkTableSwitchIV(); + return HasReturnvaluesIF::RETURN_OK; + } + case (GOMSPACE::PRINT_LATCHUPS): { + PoolReadGuard pg(&p60dockHkTableDataset); + result = pg.getReadResult(); + printHkTableLatchups(); + if (result != HasReturnvaluesIF::RETURN_OK) { + break; } - printHkTable(); return HasReturnvaluesIF::RETURN_OK; } default: { return HasReturnvaluesIF::RETURN_FAILED; } } + sif::warning << "Reading P60 Dock HK table failed" << std::endl; + return HasReturnvaluesIF::RETURN_FAILED; } -void P60DockHandler::printHkTable() { +void P60DockHandler::printHkTableSwitchIV() { sif::info << "P60 Dock Info: SwitchState, Currents [mA], Voltages [mV]" << std::endl; - sif::info << std::setw(30) << std::left << "ACU VCC" << std::dec << "| " + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACU VCC" << std::dec << "| " << unsigned(p60dockHkTableDataset.outputEnableStateAcuVcc.value) << ", " << std::setw(4) << std::right << p60dockHkTableDataset.currentAcuVcc.value << ", " << std::setw(5) << p60dockHkTableDataset.voltageAcuVcc.value << std::endl; - sif::info << std::setw(30) << std::left << "ACU VBAT" << std::dec << "| " + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACU VBAT" << std::dec << "| " << unsigned(p60dockHkTableDataset.outputEnableStateAcuVbat.value) << ", " << std::setw(4) << std::right << p60dockHkTableDataset.currentAcuVbat.value << ", " << std::setw(5) << p60dockHkTableDataset.voltageAcuVbat.value << std::endl; - sif::info << std::setw(30) << std::left << "PDU1 VCC" << std::dec << "| " + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU1 VCC" << std::dec << "| " << unsigned(p60dockHkTableDataset.outputEnableStatePdu1Vcc.value) << ", " << std::setw(4) << std::right << p60dockHkTableDataset.currentPdu1Vcc.value << ", " << std::setw(5) << p60dockHkTableDataset.voltagePdu1Vcc.value << std::endl; - sif::info << std::setw(30) << std::left << "PDU1 VBAT" << std::dec << "| " + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU1 VBAT" << std::dec << "| " << unsigned(p60dockHkTableDataset.outputEnableStatePdu1Vbat.value) << ", " << std::setw(4) << std::right << p60dockHkTableDataset.currentPdu1Vbat.value << ", " << std::setw(5) << p60dockHkTableDataset.voltagePdu1Vbat.value << std::endl; - sif::info << std::setw(30) << std::left << "PDU2 VCC" << std::dec << "| " + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU2 VCC" << std::dec << "| " << unsigned(p60dockHkTableDataset.outputEnableStatePdu2Vcc.value) << ", " << std::setw(4) << std::right << p60dockHkTableDataset.currentPdu2Vcc.value << ", " << std::setw(5) << p60dockHkTableDataset.voltagePdu2Vcc.value << std::endl; @@ -491,16 +502,44 @@ void P60DockHandler::printHkTable() { << std::setw(4) << std::right << p60dockHkTableDataset.currentPdu2Vbat.value << ", " << std::setw(5) << p60dockHkTableDataset.voltagePdu2Vbat.value << std::endl; - sif::info << std::setw(30) << std::left << "Stack VBAT" << std::dec << "| " + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack VBAT" << std::dec << "| " << unsigned(p60dockHkTableDataset.outputEnableStateStackVbat.value) << ", " << std::setw(4) << std::right << p60dockHkTableDataset.currentStackVbat.value << ", " << std::setw(5) << p60dockHkTableDataset.voltageStackVbat.value << std::endl; - sif::info << std::setw(30) << std::left << "Stack 3V3" << std::dec << "| " + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack 3V3" << std::dec << "| " << unsigned(p60dockHkTableDataset.outputEnableStateStack3V3.value) << ", " << std::setw(4) << std::right << p60dockHkTableDataset.currentStack3V3.value << ", " << std::setw(5) << p60dockHkTableDataset.voltageStack3V3.value << std::endl; - sif::info << std::setw(30) << std::left << "Stack 5V" << std::dec << "| " + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack 5V" << std::dec << "| " << unsigned(p60dockHkTableDataset.outputEnableStateStack5V.value) << ", " << std::setw(4) << std::right << p60dockHkTableDataset.currentStack5V.value << ", " << std::setw(5) << p60dockHkTableDataset.voltageStack5V.value << std::endl; } + +void P60DockHandler::printHkTableLatchups() { + sif::info << "P60 Latchup Information" << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACU VCC" << std::dec << "| " + << std::setw(4) << std::right << p60dockHkTableDataset.latchupsAcuVcc << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACU VBAT" << std::dec << "| " + << std::setw(4) << std::right << p60dockHkTableDataset.latchupsAcuVbat << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU1 VCC" << std::dec << "| " + << std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu1Vcc << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU1 VBAT" << std::dec << "| " + << std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu1Vbat << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU2 VCC" << std::dec << "| " + << std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu2Vcc << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU2 VBAT" << std::dec << "| " + << std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu2Vbat << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack 3V3" << std::dec << "| " + << std::setw(4) << std::right << p60dockHkTableDataset.latchupsStack3V3 << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack 5V" << std::dec << "| " + << std::setw(4) << std::right << p60dockHkTableDataset.latchupsStack5V << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "GS 3V3" << std::dec << "| " + << std::setw(4) << std::right << p60dockHkTableDataset.latchupsGS3V3 << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "GS 5V" << std::dec << "| " + << std::setw(4) << std::right << p60dockHkTableDataset.latchupsGS5V << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "X3 VBAT" << std::dec << "| " + << std::setw(4) << std::right << p60dockHkTableDataset.latchupsX3IdleVbat << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "X3 VCC" << std::dec << "| " + << std::setw(4) << std::right << p60dockHkTableDataset.latchupsX3IdleVcc << std::endl; +} diff --git a/mission/devices/P60DockHandler.h b/mission/devices/P60DockHandler.h index 937ef122..38ca391a 100644 --- a/mission/devices/P60DockHandler.h +++ b/mission/devices/P60DockHandler.h @@ -32,10 +32,12 @@ class P60DockHandler : public GomspaceDeviceHandler { */ ReturnValue_t printStatus(DeviceCommandId_t cmd) override; - void printHkTable(); + void printHkTableSwitchIV(); + void printHkTableLatchups(); private: P60Dock::HkTableDataset p60dockHkTableDataset; + static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 16; /** * @brief Function extracts the hk table information from the received csp packet and stores diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index 2c733306..691880f1 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -419,24 +419,37 @@ ReturnValue_t PDU1Handler::initializeLocalDataPool(localpool::DataPool &localDat } ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) { + ReturnValue_t result = RETURN_OK; switch (cmd) { case (GOMSPACE::PRINT_SWITCH_V_I): { PoolReadGuard pg(&pdu1HkTableDataset); - ReturnValue_t readResult = pg.getReadResult(); - if (readResult != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "Reading PDU1 HK table failed!" << std::endl; - return HasReturnvaluesIF::RETURN_FAILED; + result = pg.getReadResult(); + if (result != HasReturnvaluesIF::RETURN_OK) { + break; } - printHkTable(); - return HasReturnvaluesIF::RETURN_OK; + printHkTableSwitchVI(); + break; + } + case (GOMSPACE::PRINT_LATCHUPS): { + PoolReadGuard pg(&pdu1HkTableDataset); + result = pg.getReadResult(); + if (result != HasReturnvaluesIF::RETURN_OK) { + break; + } + printHkTableLatchups(); + break; } default: { return HasReturnvaluesIF::RETURN_FAILED; } } + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Reading PDU1 HK table failed!" << std::endl; + } + return result; } -void PDU1Handler::printHkTable() { +void PDU1Handler::printHkTableSwitchVI() { sif::info << "PDU1 Info: SwitchState, Currents [mA], Voltages [mV]" << std::endl; sif::info << std::setw(30) << std::left << "TCS Board" << std::dec << "| " << unsigned(pdu1HkTableDataset.outEnabledTCSBoard3V3.value) << ", " << std::setw(4) @@ -477,3 +490,26 @@ void PDU1Handler::printHkTable() { << std::setw(4) << pdu1HkTableDataset.voltageOutChannel8.value << std::right << std::endl; } + +void PDU1Handler::printHkTableLatchups() { + sif::info << "PDU1 Latchup Information" << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "TCS Board" << std::dec << "| " + << std::setw(4) << std::right << pdu1HkTableDataset.latchupsTcsBoard3V3 << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Syrlinks" << std::dec << "| " + << std::setw(4) << std::right << pdu1HkTableDataset.latchupsSyrlinks << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Star Tracker" << std::dec << "| " + << std::setw(4) << std::right << pdu1HkTableDataset.latchupsStarTracker << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "MGT" << std::dec << "| " + << std::setw(4) << std::right << pdu1HkTableDataset.latchupsMgt << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "SuS Nominal" << std::dec << "| " + << std::setw(4) << std::right << pdu1HkTableDataset.latchupsSusNominal << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Solar Cell Experiment" << std::dec + << "| " << std::setw(4) << std::right << pdu1HkTableDataset.latchupsSolarCellExp + << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PLOC" << std::dec << "| " + << std::setw(4) << std::right << pdu1HkTableDataset.latchupsPloc << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACS A Side" << std::dec << "| " + << std::setw(4) << std::right << pdu1HkTableDataset.latchupsAcsBoardSideA << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Channel 8" << std::dec << "| " + << std::setw(4) << std::right << pdu1HkTableDataset.latchupsChannel8 << std::endl; +} diff --git a/mission/devices/PDU1Handler.h b/mission/devices/PDU1Handler.h index c140648b..f16edb21 100644 --- a/mission/devices/PDU1Handler.h +++ b/mission/devices/PDU1Handler.h @@ -40,12 +40,15 @@ class PDU1Handler : public GomspaceDeviceHandler { ReturnValue_t setParamCallback(SetParamMessageUnpacker& unpacker, bool afterExectuion) override; private: + static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 16; + /** Dataset for the housekeeping table of the PDU1 */ PDU1::PDU1HkTableDataset pdu1HkTableDataset; GOMSPACE::ChannelSwitchHook channelSwitchHook = nullptr; void* hookArgs = nullptr; - void printHkTable(); + void printHkTableSwitchVI(); + void printHkTableLatchups(); void parseHkTableReply(const uint8_t* packet); }; diff --git a/mission/devices/PDU2Handler.cpp b/mission/devices/PDU2Handler.cpp index 86c80327..2167bb2a 100644 --- a/mission/devices/PDU2Handler.cpp +++ b/mission/devices/PDU2Handler.cpp @@ -371,24 +371,37 @@ ReturnValue_t PDU2Handler::initializeLocalDataPool(localpool::DataPool &localDat } ReturnValue_t PDU2Handler::printStatus(DeviceCommandId_t cmd) { + ReturnValue_t result = RETURN_OK; switch (cmd) { case (GOMSPACE::PRINT_SWITCH_V_I): { PoolReadGuard pg(&pdu2HkTableDataset); - ReturnValue_t readResult = pg.getReadResult(); - if (readResult != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "Reading PDU1 HK table failed!" << std::endl; - return HasReturnvaluesIF::RETURN_FAILED; + result = pg.getReadResult(); + if (result != HasReturnvaluesIF::RETURN_OK) { + break; } - printHkTable(); - return HasReturnvaluesIF::RETURN_OK; + printHkTableSwitchVI(); + break; + } + case (GOMSPACE::PRINT_LATCHUPS): { + PoolReadGuard pg(&pdu2HkTableDataset); + result = pg.getReadResult(); + if (result != HasReturnvaluesIF::RETURN_OK) { + break; + } + printHkTableLatchups(); + break; } default: { return HasReturnvaluesIF::RETURN_FAILED; } } + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Reading PDU1 HK table failed!" << std::endl; + } + return result; } -void PDU2Handler::printHkTable() { +void PDU2Handler::printHkTableSwitchVI() { sif::info << "PDU2 Info: SwitchState, Currents [mA], Voltages [mV]" << std::endl; sif::info << std::setw(30) << std::left << "Q7S" << std::dec << "| " << unsigned(pdu2HkTableDataset.outEnabledQ7S.value) << ", " << std::setw(4) @@ -402,11 +415,11 @@ void PDU2Handler::printHkTable() { << unsigned(pdu2HkTableDataset.outEnabledReactionWheels.value) << ", " << std::setw(4) << std::right << pdu2HkTableDataset.currentOutReactionWheels.value << ", " << std::setw(4) << pdu2HkTableDataset.voltageOutReactionWheels.value << std::endl; - sif::info << std::setw(30) << std::left << "TCS Board 8V heater input" << std::dec << "| " + sif::info << std::setw(30) << std::left << "TCS Board Heater Input" << std::dec << "| " << unsigned(pdu2HkTableDataset.outEnabledTCSBoardHeaterIn.value) << ", " << std::setw(4) << std::right << pdu2HkTableDataset.currentOutTCSBoardHeaterIn.value << ", " << std::setw(4) << pdu2HkTableDataset.voltageOutTCSBoardHeaterIn.value << std::endl; - sif::info << std::setw(30) << std::left << "Redundant SUS group" << std::dec << "| " + sif::info << std::setw(30) << std::left << "SuS Redundant" << std::dec << "| " << unsigned(pdu2HkTableDataset.outEnabledSUSRedundant.value) << ", " << std::setw(4) << std::right << pdu2HkTableDataset.currentOutSUSRedundant.value << ", " << std::setw(4) << pdu2HkTableDataset.voltageOutSUSRedundant.value << std::endl; @@ -422,13 +435,40 @@ void PDU2Handler::printHkTable() { << unsigned(pdu2HkTableDataset.outEnabledAcsBoardSideB.value) << ", " << std::setw(4) << std::right << pdu2HkTableDataset.currentOutACSBoardSideB.value << ", " << std::setw(4) << pdu2HkTableDataset.voltageOutACSBoardSideB.value << std::endl; - sif::info << std::setw(30) << std::left << "Payload Camera enable state" << std::dec << "| " + sif::info << std::setw(30) << std::left << "Payload Camera" << std::dec << "| " << unsigned(pdu2HkTableDataset.outEnabledPayloadCamera.value) << ", " << std::setw(4) << std::right << pdu2HkTableDataset.currentOutPayloadCamera.value << ", " << std::setw(4) << pdu2HkTableDataset.voltageOutPayloadCamera.value << std::right << std::endl; } +void PDU2Handler::printHkTableLatchups() { + sif::info << "PDU2 Latchup Information" << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Q7S" << std::dec << "| " + << std::setw(4) << std::right << pdu2HkTableDataset.latchupsQ7S << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Payload PCDU Channel 1" << std::dec + << "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsPayloadPcduCh1 + << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Reaction Wheels" << std::dec + << "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsRw << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "TCS Board Heater Input" << std::dec + << "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsTcsBoardHeaterIn + << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "SuS Nominal" << std::dec << "| " + << std::setw(4) << std::right << pdu2HkTableDataset.latchupsSusRedundant << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Deployment mechanism" << std::dec + << "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsDeplMenchanism + << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Payload PCDU Channel 6" << std::dec + << "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsPayloadPcduCh6 + << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACS Board Side B" << std::dec + << "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsAcsBoardSideB + << std::endl; + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Payload Camera" << std::dec << "| " + << std::setw(4) << std::right << pdu2HkTableDataset.latchupsPayloadCamera << std::endl; +} + ReturnValue_t PDU2Handler::setParamCallback(SetParamMessageUnpacker &unpacker, bool afterExecution) { using namespace PDU2; diff --git a/mission/devices/PDU2Handler.h b/mission/devices/PDU2Handler.h index f2323615..ca639568 100644 --- a/mission/devices/PDU2Handler.h +++ b/mission/devices/PDU2Handler.h @@ -38,12 +38,15 @@ class PDU2Handler : public GomspaceDeviceHandler { ReturnValue_t setParamCallback(SetParamMessageUnpacker& unpacker, bool afterExecution) override; private: + static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 24; + /** Dataset for the housekeeping table of the PDU2 */ PDU2::PDU2HkTableDataset pdu2HkTableDataset; GOMSPACE::ChannelSwitchHook channelSwitchHook = nullptr; void* hookArgs = nullptr; - void printHkTable(); + void printHkTableSwitchVI(); + void printHkTableLatchups(); void parseHkTableReply(const uint8_t* packet); }; diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index 0b3b0a19..a5bde614 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -34,8 +34,10 @@ static const DeviceCommandId_t GNDWDT_RESET = 9; //!< [EXPORT] : [COMMAND] static const DeviceCommandId_t PARAM_GET = 0; //!< [EXPORT] : [COMMAND] static const DeviceCommandId_t PARAM_SET = 255; //!< [EXPORT] : [COMMAND] static const DeviceCommandId_t REQUEST_HK_TABLE = 16; //!< [EXPORT] : [COMMAND] + //!< [EXPORT] : [COMMAND] Print switch states, voltages and currents to the console static const DeviceCommandId_t PRINT_SWITCH_V_I = 32; +static const DeviceCommandId_t PRINT_LATCHUPS = 33; } // namespace GOMSPACE diff --git a/tmtc b/tmtc index 60e938a8..2251c8cb 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 60e938a896c63f6dcef5167dbf7e48d2e14dac92 +Subproject commit 2251c8cbf441e31e35c1ae6703d47ef2046f9b17