p60 print command
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2021-09-20 11:47:19 +02:00
parent 487b6fd5ca
commit cbb7fdfa99
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
7 changed files with 109 additions and 15 deletions

View File

@ -75,7 +75,7 @@ ReturnValue_t GomspaceDeviceHandler::buildCommandFromCommand(
}
break;
}
case(GOMSPACE::PRINT_HK_TABLE): {
case(GOMSPACE::PRINT_SWITCH_V_I): {
result = printStatus(deviceCommand);
break;
}
@ -99,7 +99,7 @@ void GomspaceDeviceHandler::fillCommandAndReplyMap(){
this->insertInCommandAndReplyMap(GOMSPACE::PARAM_GET, 3);
this->insertInCommandAndReplyMap(GOMSPACE::REQUEST_HK_TABLE, 3);
this->insertInCommandMap(GOMSPACE::GNDWDT_RESET);
this->insertInCommandMap(GOMSPACE::PRINT_HK_TABLE);
this->insertInCommandMap(GOMSPACE::PRINT_SWITCH_V_I);
}
ReturnValue_t GomspaceDeviceHandler::scanForReply(const uint8_t *start,

View File

@ -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;
}

View File

@ -26,6 +26,14 @@ protected:
virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) override;
/**
* This command handles printing the HK table to the console. This is useful for debugging
* purposes
* @return
*/
ReturnValue_t printStatus(DeviceCommandId_t cmd) override;
void printHkTable();
private:
P60Dock::HkTableDataset p60dockHkTableDataset;

View File

@ -335,7 +335,7 @@ ReturnValue_t PDU1Handler::initializeLocalDataPool(
ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) {
switch(cmd) {
case(GOMSPACE::PRINT_HK_TABLE): {
case(GOMSPACE::PRINT_SWITCH_V_I): {
PoolReadGuard pg(&pdu1HkTableDataset);
ReturnValue_t readResult = pg.getReadResult();
if(readResult != HasReturnvaluesIF::RETURN_OK) {

View File

@ -312,7 +312,7 @@ ReturnValue_t PDU2Handler::initializeLocalDataPool(
ReturnValue_t PDU2Handler::printStatus(DeviceCommandId_t cmd) {
switch(cmd) {
case(GOMSPACE::PRINT_HK_TABLE): {
case(GOMSPACE::PRINT_SWITCH_V_I): {
PoolReadGuard pg(&pdu2HkTableDataset);
ReturnValue_t readResult = pg.getReadResult();
if(readResult != HasReturnvaluesIF::RETURN_OK) {

View File

@ -34,7 +34,7 @@ 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_HK_TABLE = 32;
static const DeviceCommandId_t PRINT_SWITCH_V_I = 32;
}
@ -379,6 +379,9 @@ static const uint16_t HK_TABLE_REPLY_SIZE = 407;
/**
* @brief This class defines a dataset for the hk table of the P60 Dock.
* @details
* The GS port and X3 are not required for EIVE. X3 is another slot on the P60 dock and
* GS is required for a module from Gomspace which is not used.
*/
class HkTableDataset:
public StaticLocalDataSet<HK_TABLE_ENTRIES> {

2
tmtc

@ -1 +1 @@
Subproject commit f3a2e755fdc73ee791ea32dc6f2dfce43af70e60
Subproject commit 53bf65083889af10f77c3899972b1153ea835f3c