|
|
|
@ -77,25 +77,9 @@ ReturnValue_t PCDUHandler::initialize() {
|
|
|
|
|
|
|
|
|
|
void PCDUHandler::initializeSwitchStates() {
|
|
|
|
|
using namespace pcduSwitches;
|
|
|
|
|
switchStates[Switches::PDU2_CH0_Q7S] = pcduSwitches::INIT_STATE_Q7S;
|
|
|
|
|
switchStates[Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8] = pcduSwitches::INIT_STATE_PAYLOAD_PCDU_CH1;
|
|
|
|
|
switchStates[Switches::PDU2_CH2_RW_5V] = pcduSwitches::INIT_STATE_RW;
|
|
|
|
|
switchStates[Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V] =
|
|
|
|
|
pcduSwitches::INIT_STATE_TCS_BOARD_8V_HEATER_IN;
|
|
|
|
|
switchStates[Switches::PDU2_CH4_SUS_REDUNDANT_3V3] = pcduSwitches::INIT_STATE_SUS_REDUNDANT;
|
|
|
|
|
switchStates[Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V] =
|
|
|
|
|
pcduSwitches::INIT_STATE_DEPLOYMENT_MECHANISM;
|
|
|
|
|
switchStates[Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8] = pcduSwitches::INIT_STATE_PAYLOAD_PCDU_CH6;
|
|
|
|
|
switchStates[Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3] = pcduSwitches::INIT_STATE_ACS_BOARD_SIDE_B;
|
|
|
|
|
switchStates[Switches::PDU2_CH8_PAYLOAD_CAMERA] = pcduSwitches::INIT_STATE_PAYLOAD_CAMERA;
|
|
|
|
|
switchStates[Switches::PDU1_CH0_TCS_BOARD_3V3] = pcduSwitches::INIT_STATE_TCS_BOARD_3V3;
|
|
|
|
|
switchStates[Switches::PDU1_CH1_SYRLINKS_12V] = pcduSwitches::INIT_STATE_SYRLINKS;
|
|
|
|
|
switchStates[Switches::PDU1_CH2_STAR_TRACKER_5V] = pcduSwitches::INIT_STATE_STAR_TRACKER;
|
|
|
|
|
switchStates[Switches::PDU1_CH3_MGT_5V] = pcduSwitches::INIT_STATE_MGT;
|
|
|
|
|
switchStates[Switches::PDU1_CH4_SUS_NOMINAL_3V3] = pcduSwitches::INIT_STATE_SUS_NOMINAL;
|
|
|
|
|
switchStates[Switches::PDU1_CH5_SOLAR_CELL_EXP_5V] = pcduSwitches::INIT_STATE_SOLAR_CELL_EXP;
|
|
|
|
|
switchStates[Switches::PDU1_CH6_PLOC_12V] = pcduSwitches::INIT_STATE_PLOC;
|
|
|
|
|
switchStates[Switches::PDU1_CH7_ACS_A_SIDE_3V3] = pcduSwitches::INIT_STATE_ACS_BOARD_SIDE_A;
|
|
|
|
|
for (uint8_t idx = 0; idx < Switches::NUMBER_OF_SWITCHES; idx++) {
|
|
|
|
|
switchStates[idx] = INIT_SWITCH_STATES[idx];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PCDUHandler::readCommandQueue() {
|
|
|
|
@ -178,6 +162,9 @@ void PCDUHandler::updatePdu2SwitchStates() {
|
|
|
|
|
pdu2HkTableDataset.outEnabledAcsBoardSideB.value);
|
|
|
|
|
checkAndUpdateSwitch(Switches::PDU2_CH8_PAYLOAD_CAMERA,
|
|
|
|
|
pdu2HkTableDataset.outEnabledPayloadCamera.value);
|
|
|
|
|
if (firstSwitchInfo) {
|
|
|
|
|
firstSwitchInfo = false;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
sif::debug << "PCDUHandler::updatePdu2SwitchStates: Failed to read PDU2 Hk Dataset"
|
|
|
|
|
<< std::endl;
|
|
|
|
@ -205,6 +192,9 @@ void PCDUHandler::updatePdu1SwitchStates() {
|
|
|
|
|
pdu1HkTableDataset.outEnabledAcsBoardSideA.value);
|
|
|
|
|
checkAndUpdateSwitch(Switches::PDU1_CH8_UNOCCUPIED,
|
|
|
|
|
pdu1HkTableDataset.outEnabledChannel8.value);
|
|
|
|
|
if (firstSwitchInfo) {
|
|
|
|
|
firstSwitchInfo = false;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
sif::debug << "PCDUHandler::updatePdu1SwitchStates: Failed to read dataset" << std::endl;
|
|
|
|
|
}
|
|
|
|
@ -381,6 +371,7 @@ object_id_t PCDUHandler::getObjectId() const { return SystemObject::getObjectId(
|
|
|
|
|
|
|
|
|
|
ReturnValue_t PCDUHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
|
|
|
|
LocalDataPoolManager& poolManager) {
|
|
|
|
|
using namespace pcduSwitches;
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>({0}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1,
|
|
|
|
|
new PoolEntry<int16_t>({0}));
|
|
|
|
@ -419,28 +410,34 @@ ReturnValue_t PCDUHandler::initializeLocalDataPool(localpool::DataPool& localDat
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU2_CONV_EN_3, new PoolEntry<uint8_t>({0}));
|
|
|
|
|
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_Q7S,
|
|
|
|
|
new PoolEntry<uint8_t>({pcduSwitches::INIT_STATE_Q7S}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1,
|
|
|
|
|
new PoolEntry<uint8_t>({pcduSwitches::INIT_STATE_PAYLOAD_PCDU_CH1}));
|
|
|
|
|
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH0_Q7S]}));
|
|
|
|
|
localDataPoolMap.emplace(
|
|
|
|
|
P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1,
|
|
|
|
|
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8]}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_RW,
|
|
|
|
|
new PoolEntry<uint8_t>({pcduSwitches::INIT_STATE_RW}));
|
|
|
|
|
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH2_RW_5V]}));
|
|
|
|
|
#if BOARD_TE0720 == 1
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>({1}));
|
|
|
|
|
#else
|
|
|
|
|
localDataPoolMap.emplace(
|
|
|
|
|
P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN,
|
|
|
|
|
new PoolEntry<uint8_t>({pcduSwitches::INIT_STATE_TCS_BOARD_8V_HEATER_IN}));
|
|
|
|
|
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V]}));
|
|
|
|
|
#endif
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_SUS_REDUNDANT,
|
|
|
|
|
new PoolEntry<uint8_t>({pcduSwitches::INIT_STATE_SUS_REDUNDANT}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM,
|
|
|
|
|
new PoolEntry<uint8_t>({pcduSwitches::INIT_STATE_DEPLOYMENT_MECHANISM}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6,
|
|
|
|
|
new PoolEntry<uint8_t>({pcduSwitches::INIT_STATE_PAYLOAD_PCDU_CH6}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B,
|
|
|
|
|
new PoolEntry<uint8_t>({pcduSwitches::INIT_STATE_ACS_BOARD_SIDE_B}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_CAMERA,
|
|
|
|
|
new PoolEntry<uint8_t>({pcduSwitches::INIT_STATE_PAYLOAD_CAMERA}));
|
|
|
|
|
localDataPoolMap.emplace(
|
|
|
|
|
P60System::PDU2_OUT_EN_SUS_REDUNDANT,
|
|
|
|
|
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH4_SUS_REDUNDANT_3V3]}));
|
|
|
|
|
localDataPoolMap.emplace(
|
|
|
|
|
P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM,
|
|
|
|
|
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V]}));
|
|
|
|
|
localDataPoolMap.emplace(
|
|
|
|
|
P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6,
|
|
|
|
|
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8]}));
|
|
|
|
|
localDataPoolMap.emplace(
|
|
|
|
|
P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B,
|
|
|
|
|
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3]}));
|
|
|
|
|
localDataPoolMap.emplace(
|
|
|
|
|
P60System::PDU2_OUT_EN_PAYLOAD_CAMERA,
|
|
|
|
|
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH8_PAYLOAD_CAMERA]}));
|
|
|
|
|
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU2_BOOTCNT, new PoolEntry<uint32_t>({0}));
|
|
|
|
@ -502,16 +499,32 @@ ReturnValue_t PCDUHandler::initializeLocalDataPool(localpool::DataPool& localDat
|
|
|
|
|
new PoolEntry<int16_t>({0}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry<int16_t>({0}));
|
|
|
|
|
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, new PoolEntry<int16_t>({0}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_SYRLINKS, new PoolEntry<int16_t>({0}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_STAR_TRACKER, new PoolEntry<int16_t>({0}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_MGT, new PoolEntry<int16_t>({0}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_SUS_NOMINAL, new PoolEntry<int16_t>({0}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, new PoolEntry<int16_t>({0}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_PLOC, new PoolEntry<int16_t>({0}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A,
|
|
|
|
|
new PoolEntry<int16_t>({0}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_CHANNEL8, new PoolEntry<int16_t>({0}));
|
|
|
|
|
localDataPoolMap.emplace(
|
|
|
|
|
P60System::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3,
|
|
|
|
|
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH0_TCS_BOARD_3V3]}));
|
|
|
|
|
localDataPoolMap.emplace(
|
|
|
|
|
P60System::PDU1_VOLTAGE_OUT_SYRLINKS,
|
|
|
|
|
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH1_SYRLINKS_12V]}));
|
|
|
|
|
localDataPoolMap.emplace(
|
|
|
|
|
P60System::PDU1_VOLTAGE_OUT_STAR_TRACKER,
|
|
|
|
|
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH2_STAR_TRACKER_5V]}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_MGT,
|
|
|
|
|
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH3_MGT_5V]}));
|
|
|
|
|
localDataPoolMap.emplace(
|
|
|
|
|
P60System::PDU1_VOLTAGE_OUT_SUS_NOMINAL,
|
|
|
|
|
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH4_SUS_NOMINAL_3V3]}));
|
|
|
|
|
localDataPoolMap.emplace(
|
|
|
|
|
P60System::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP,
|
|
|
|
|
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH5_SOLAR_CELL_EXP_5V]}));
|
|
|
|
|
localDataPoolMap.emplace(
|
|
|
|
|
P60System::PDU1_VOLTAGE_OUT_PLOC,
|
|
|
|
|
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH6_PLOC_12V]}));
|
|
|
|
|
localDataPoolMap.emplace(
|
|
|
|
|
P60System::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A,
|
|
|
|
|
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH7_ACS_A_SIDE_3V3]}));
|
|
|
|
|
localDataPoolMap.emplace(
|
|
|
|
|
P60System::PDU1_VOLTAGE_OUT_CHANNEL8,
|
|
|
|
|
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH8_UNOCCUPIED]}));
|
|
|
|
|
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU1_VCC, new PoolEntry<int16_t>({0}));
|
|
|
|
|
localDataPoolMap.emplace(P60System::PDU1_VBAT, new PoolEntry<int16_t>({0}));
|
|
|
|
@ -603,8 +616,17 @@ LocalPoolDataSetBase* PCDUHandler::getDataSetHandle(sid_t sid) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PCDUHandler::checkAndUpdateSwitch(pcduSwitches::Switches switchIdx, uint8_t setValue) {
|
|
|
|
|
using namespace pcduSwitches;
|
|
|
|
|
if (switchStates[switchIdx] != setValue) {
|
|
|
|
|
triggerEvent(power::SWITCH_HAS_CHANGED, setValue, switchIdx);
|
|
|
|
|
if (firstSwitchInfo) {
|
|
|
|
|
ReturnValue_t state = PowerSwitchIF::SWITCH_OFF;
|
|
|
|
|
if (INIT_SWITCH_STATES[switchIdx] == ON) {
|
|
|
|
|
state = PowerSwitchIF::SWITCH_ON;
|
|
|
|
|
}
|
|
|
|
|
sendSwitchCommand(switchIdx, state);
|
|
|
|
|
} else {
|
|
|
|
|
triggerEvent(power::SWITCH_HAS_CHANGED, setValue, switchIdx);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
switchStates[switchIdx] = setValue;
|
|
|
|
|
}
|
|
|
|
|