From 261b4a808d8e62ce128ebc4529b8f02cc8471ab4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 3 Mar 2022 15:43:21 +0100 Subject: [PATCH] completed switcher switch case --- mission/devices/PCDUHandler.cpp | 61 +++++++++++++++++++ mission/devices/PDU2Handler.cpp | 2 +- .../devicedefinitions/GomspaceDefinitions.h | 2 +- 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index 9fc78c04..1553afe8 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -234,16 +234,77 @@ void PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) const pdu = ObjectManager::instance()->get(objects::PDU1_HANDLER); break; } + case pcduSwitches::PDU1_CH4_SUS_NOMINAL_3V3: { + memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SUS_NOMINAL; + pdu = ObjectManager::instance()->get(objects::PDU1_HANDLER); + break; + } + case pcduSwitches::PDU1_CH5_SOLAR_CELL_EXP_5V: { + memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SOLAR_CELL_EXP; + pdu = ObjectManager::instance()->get(objects::PDU1_HANDLER); + break; + } + case pcduSwitches::PDU1_CH6_PLOC_12V: { + memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_PLOC; + pdu = ObjectManager::instance()->get(objects::PDU1_HANDLER); + break; + } + case pcduSwitches::PDU1_CH7_ACS_A_SIDE_3V3: { + memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_A; + pdu = ObjectManager::instance()->get(objects::PDU1_HANDLER); + break; + } + case pcduSwitches::PDU1_CH8_UNOCCUPIED: { + memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_CHANNEL8; + pdu = ObjectManager::instance()->get(objects::PDU1_HANDLER); + break; + } + // That does not really make sense but let's keep it here for completeness reasons.. + case pcduSwitches::PDU2_CH0_Q7S: { + memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_Q7S; + pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); + break; + } + case pcduSwitches::PDU2_CH1_PL_PCDU_BATT_0_14V8: { + memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH1; + pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); + break; + } + case pcduSwitches::PDU2_CH2_RW_5V: { + memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_RW; + pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); + break; + } case pcduSwitches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V: { memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_TCS_BOARD_HEATER_IN; pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); break; } + case pcduSwitches::PDU2_CH4_SUS_REDUNDANT_3V3: { + memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_SUS_REDUNDANT; + pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); + break; + } case pcduSwitches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V: { memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_DEPLOYMENT_MECHANISM; pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); break; } + case pcduSwitches::PDU2_CH6_PL_PCDU_BATT_1_14V8: { + memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6; + pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); + break; + } + case pcduSwitches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3: { + memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_B; + pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); + break; + } + case pcduSwitches::PDU2_CH8_PAYLOAD_CAMERA: { + memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_CAMERA; + pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); + break; + } default: { sif::error << "PCDUHandler::sendSwitchCommand: Invalid switch number " << std::endl; diff --git a/mission/devices/PDU2Handler.cpp b/mission/devices/PDU2Handler.cpp index 776cae58..5b394a91 100644 --- a/mission/devices/PDU2Handler.cpp +++ b/mission/devices/PDU2Handler.cpp @@ -460,7 +460,7 @@ ReturnValue_t PDU2Handler::setParamCallback(SetParamMessageUnpacker &unpacker, channelSwitchHook(pdu, 5, unpacker.getParameter()[0], hookArgs); break; } - case (CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6PLOC): { + case (CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6): { channelSwitchHook(pdu, 6, unpacker.getParameter()[0], hookArgs); break; } diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index 995d9a7a..0b3b0a19 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -848,7 +848,7 @@ static const uint16_t CONFIG_ADDRESS_OUT_EN_RW = 0x4A; static const uint16_t CONFIG_ADDRESS_OUT_EN_TCS_BOARD_HEATER_IN = 0x4B; static const uint16_t CONFIG_ADDRESS_OUT_EN_SUS_REDUNDANT = 0x4C; static const uint16_t CONFIG_ADDRESS_OUT_EN_DEPLOYMENT_MECHANISM = 0x4D; -static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6PLOC = 0x4E; +static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6 = 0x4E; static const uint16_t CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_B = 0x4F; static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_CAMERA = 0x50;