|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
#include <fsfw/datapool/PoolReadGuard.h>
|
|
|
|
|
#include "P60DockHandler.h"
|
|
|
|
|
#include "OBSWConfig.h"
|
|
|
|
|
|
|
|
|
@ -27,15 +28,24 @@ void P60DockHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *
|
|
|
|
|
|
|
|
|
|
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_P60DOCK == 1
|
|
|
|
|
p60dockHkTableDataset.read();
|
|
|
|
|
sif::info << "P60 Dock: ACU VCC switch: " << static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateAcuVcc.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: PDU1 VCC switch: " << static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu1Vcc.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: PDU2 VCC switch: " << static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu2Vcc.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: ACU VBAT switch: " << static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateAcuVbat.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: PDU1 VBAT switch: " << static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu1Vbat.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: PDU2 VBAT switch: " << static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu2Vbat.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: Stack VBAT switch: " << static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateStackVbat.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: Stack 3V3 switch: " << static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateStack3V3.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: Stack 5V switch: " << static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateStack5V.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: ACU VCC switch: " <<
|
|
|
|
|
static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateAcuVcc.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: PDU1 VCC switch: " <<
|
|
|
|
|
static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu1Vcc.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: PDU2 VCC switch: " <<
|
|
|
|
|
static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu2Vcc.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: ACU VBAT switch: " <<
|
|
|
|
|
static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateAcuVbat.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: PDU1 VBAT switch: " <<
|
|
|
|
|
static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu1Vbat.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: PDU2 VBAT switch: " <<
|
|
|
|
|
static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu2Vbat.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: Stack VBAT switch: " <<
|
|
|
|
|
static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateStackVbat.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: Stack 3V3 switch: " <<
|
|
|
|
|
static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateStack3V3.value) << std::endl;
|
|
|
|
|
sif::info << "P60 Dock: Stack 5V switch: " <<
|
|
|
|
|
static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateStack5V.value) << std::endl;
|
|
|
|
|
|
|
|
|
|
float temperatureC = p60dockHkTableDataset.temperature1.value * 0.1;
|
|
|
|
|
sif::info << "P60 Dock: Temperature 1: " << temperatureC << " °C" << std::endl;
|
|
|
|
@ -395,3 +405,76 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(
|
|
|
|
|
|
|
|
|
|
return HasReturnvaluesIF::RETURN_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ReturnValue_t P60DockHandler::printStatus(DeviceCommandId_t cmd) {
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
printHkTable();
|
|
|
|
|
return HasReturnvaluesIF::RETURN_OK;
|
|
|
|
|
}
|
|
|
|
|
default: {
|
|
|
|
|
return HasReturnvaluesIF::RETURN_FAILED;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void P60DockHandler::printHkTable() {
|
|
|
|
|
sif::info << "P60 Dock Info: SwitchState, Voltages [mV], Currents [mA]" << std::endl;
|
|
|
|
|
|
|
|
|
|
sif::info << std::setw(30) << 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 << "| " <<
|
|
|
|
|
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 << "| " <<
|
|
|
|
|
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 << "| " <<
|
|
|
|
|
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 << "| " <<
|
|
|
|
|
unsigned(p60dockHkTableDataset.outputEnableStatePdu2Vcc.value) << ", " <<
|
|
|
|
|
std::setw(4) << std::right <<
|
|
|
|
|
p60dockHkTableDataset.currentPdu2Vcc.value << ", " << std::setw(5) <<
|
|
|
|
|
p60dockHkTableDataset.voltagePdu2Vcc.value << std::endl;
|
|
|
|
|
sif::info << std::setw(30) << std::left << "PDU2 VBAT" << std::dec << "| " <<
|
|
|
|
|
unsigned(p60dockHkTableDataset.outputEnableStatePdu2Vbat.value) << ", " <<
|
|
|
|
|
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 << "| " <<
|
|
|
|
|
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 << "| " <<
|
|
|
|
|
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 << "| " <<
|
|
|
|
|
unsigned(p60dockHkTableDataset.outputEnableStateStack5V.value) << ", " <<
|
|
|
|
|
std::setw(4) << std::right <<
|
|
|
|
|
p60dockHkTableDataset.currentStack5V.value << ", " << std::setw(5) <<
|
|
|
|
|
p60dockHkTableDataset.voltageStack5V.value << std::endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|