continued ACS board assembly
This commit is contained in:
parent
4eb948c5ef
commit
0904cadde5
@ -1,5 +1,6 @@
|
|||||||
#include "ObjectFactory.h"
|
#include "ObjectFactory.h"
|
||||||
|
|
||||||
|
#include <fsfw/ipc/QueueFactory.h>
|
||||||
#include <linux/obc/AxiPtmeConfig.h>
|
#include <linux/obc/AxiPtmeConfig.h>
|
||||||
#include <linux/obc/PapbVcInterface.h>
|
#include <linux/obc/PapbVcInterface.h>
|
||||||
#include <linux/obc/PdecHandler.h>
|
#include <linux/obc/PdecHandler.h>
|
||||||
@ -590,11 +591,10 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
#if OBSW_TEST_ACS == 1
|
#if OBSW_TEST_ACS == 1
|
||||||
mgmLis3Handler->setStartUpImmediately();
|
mgmLis3Handler->setStartUpImmediately();
|
||||||
mgmLis3Handler->setToGoToNormalMode(true);
|
mgmLis3Handler->setToGoToNormalMode(true);
|
||||||
|
#endif
|
||||||
#if OBSW_DEBUG_ACS == 1
|
#if OBSW_DEBUG_ACS == 1
|
||||||
mgmLis3Handler->enablePeriodicPrintouts(true, 10);
|
mgmLis3Handler->enablePeriodicPrintouts(true, 10);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
spiCookie =
|
spiCookie =
|
||||||
new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev,
|
new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev,
|
||||||
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||||
@ -604,11 +604,10 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
#if OBSW_TEST_ACS == 1
|
#if OBSW_TEST_ACS == 1
|
||||||
mgmRm3100Handler->setStartUpImmediately();
|
mgmRm3100Handler->setStartUpImmediately();
|
||||||
mgmRm3100Handler->setToGoToNormalMode(true);
|
mgmRm3100Handler->setToGoToNormalMode(true);
|
||||||
|
#endif
|
||||||
#if OBSW_DEBUG_ACS == 1
|
#if OBSW_DEBUG_ACS == 1
|
||||||
mgmRm3100Handler->enablePeriodicPrintouts(true, 10);
|
mgmRm3100Handler->enablePeriodicPrintouts(true, 10);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
spiCookie =
|
spiCookie =
|
||||||
new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev,
|
new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev,
|
||||||
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
||||||
@ -618,11 +617,10 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
#if OBSW_TEST_ACS == 1
|
#if OBSW_TEST_ACS == 1
|
||||||
mgmLis3Handler->setStartUpImmediately();
|
mgmLis3Handler->setStartUpImmediately();
|
||||||
mgmLis3Handler->setToGoToNormalMode(true);
|
mgmLis3Handler->setToGoToNormalMode(true);
|
||||||
|
#endif
|
||||||
#if OBSW_DEBUG_ACS == 1
|
#if OBSW_DEBUG_ACS == 1
|
||||||
mgmLis3Handler->enablePeriodicPrintouts(true, 10);
|
mgmLis3Handler->enablePeriodicPrintouts(true, 10);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
spiCookie =
|
spiCookie =
|
||||||
new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, spiDev,
|
new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, spiDev,
|
||||||
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
||||||
@ -631,11 +629,10 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
#if OBSW_TEST_ACS == 1
|
#if OBSW_TEST_ACS == 1
|
||||||
mgmRm3100Handler->setStartUpImmediately();
|
mgmRm3100Handler->setStartUpImmediately();
|
||||||
mgmRm3100Handler->setToGoToNormalMode(true);
|
mgmRm3100Handler->setToGoToNormalMode(true);
|
||||||
|
#endif
|
||||||
#if OBSW_DEBUG_ACS == 1
|
#if OBSW_DEBUG_ACS == 1
|
||||||
mgmRm3100Handler->enablePeriodicPrintouts(true, 10);
|
mgmRm3100Handler->enablePeriodicPrintouts(true, 10);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
// Commented until ACS board V2 in in clean room again
|
// Commented until ACS board V2 in in clean room again
|
||||||
// Gyro 0 Side A
|
// Gyro 0 Side A
|
||||||
spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev,
|
spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev,
|
||||||
@ -647,9 +644,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
#if OBSW_TEST_ACS == 1
|
#if OBSW_TEST_ACS == 1
|
||||||
adisHandler->setStartUpImmediately();
|
adisHandler->setStartUpImmediately();
|
||||||
adisHandler->setToGoToNormalModeImmediately();
|
adisHandler->setToGoToNormalModeImmediately();
|
||||||
|
#endif
|
||||||
#if OBSW_DEBUG_ACS == 1
|
#if OBSW_DEBUG_ACS == 1
|
||||||
adisHandler->enablePeriodicPrintouts(true, 10);
|
adisHandler->enablePeriodicPrintouts(true, 10);
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Gyro 1 Side A
|
// Gyro 1 Side A
|
||||||
@ -662,9 +659,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
#if OBSW_TEST_ACS == 1
|
#if OBSW_TEST_ACS == 1
|
||||||
gyroL3gHandler->setStartUpImmediately();
|
gyroL3gHandler->setStartUpImmediately();
|
||||||
gyroL3gHandler->setToGoToNormalMode(true);
|
gyroL3gHandler->setToGoToNormalMode(true);
|
||||||
|
#endif
|
||||||
#if OBSW_DEBUG_ACS == 1
|
#if OBSW_DEBUG_ACS == 1
|
||||||
gyroL3gHandler->enablePeriodicPrintouts(true, 10);
|
gyroL3gHandler->enablePeriodicPrintouts(true, 10);
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
// Gyro 2 Side B
|
// Gyro 2 Side B
|
||||||
spiCookie = new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, spiDev,
|
spiCookie = new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, spiDev,
|
||||||
@ -685,9 +682,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
#if OBSW_TEST_ACS == 1
|
#if OBSW_TEST_ACS == 1
|
||||||
gyroL3gHandler->setStartUpImmediately();
|
gyroL3gHandler->setStartUpImmediately();
|
||||||
gyroL3gHandler->setToGoToNormalMode(true);
|
gyroL3gHandler->setToGoToNormalMode(true);
|
||||||
|
#endif
|
||||||
#if OBSW_DEBUG_ACS == 1
|
#if OBSW_DEBUG_ACS == 1
|
||||||
gyroL3gHandler->enablePeriodicPrintouts(true, 10);
|
gyroL3gHandler->enablePeriodicPrintouts(true, 10);
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool debugGps = false;
|
bool debugGps = false;
|
||||||
@ -711,6 +708,16 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
auto acsAss = new AcsBoardAssembly(objects::ACS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher,
|
auto acsAss = new AcsBoardAssembly(objects::ACS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher,
|
||||||
acsBoardHelper, gpioComIF);
|
acsBoardHelper, gpioComIF);
|
||||||
static_cast<void>(acsAss);
|
static_cast<void>(acsAss);
|
||||||
|
|
||||||
|
#if OBSW_TEST_ACS_BAORD_ASS == 1
|
||||||
|
CommandMessage msg;
|
||||||
|
ModeMessage::setModeMessage(&msg, ModeMessage::CMD_MODE_COMMAND, DeviceHandlerIF::MODE_NORMAL,
|
||||||
|
AcsBoardAssembly::A_SIDE);
|
||||||
|
ReturnValue_t result = MessageQueueSenderIF::sendMessage(acsAss->getCommandQueue(), &msg);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::warning << "Sending mode command failed" << std::endl;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */
|
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
|||||||
Subproject commit 4e6c1cb72ad623208ea8e08349f6ab39bfa45ed0
|
Subproject commit 45f0d7fd453eafddbc8a364e6c61a90b5f577c85
|
@ -107,6 +107,7 @@
|
|||||||
0x5400CAFE;DUMMY_INTERFACE
|
0x5400CAFE;DUMMY_INTERFACE
|
||||||
0x54123456;LIBGPIOD_TEST
|
0x54123456;LIBGPIOD_TEST
|
||||||
0x54694269;TEST_TASK
|
0x54694269;TEST_TASK
|
||||||
|
0x73000001;ACS_BOARD_ASS
|
||||||
0x73000100;TM_FUNNEL
|
0x73000100;TM_FUNNEL
|
||||||
0x73500000;CCSDS_IP_CORE_BRIDGE
|
0x73500000;CCSDS_IP_CORE_BRIDGE
|
||||||
0xFFFFFFFF;NO_OBJECT
|
0xFFFFFFFF;NO_OBJECT
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @brief Auto-generated event translation file. Contains 141 translations.
|
* @brief Auto-generated event translation file. Contains 141 translations.
|
||||||
* @details
|
* @details
|
||||||
* Generated on: 2022-03-01 18:04:34
|
* Generated on: 2022-03-04 16:42:09
|
||||||
*/
|
*/
|
||||||
#include "translateEvents.h"
|
#include "translateEvents.h"
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* @brief Auto-generated object translation file.
|
* @brief Auto-generated object translation file.
|
||||||
* @details
|
* @details
|
||||||
* Contains 112 translations.
|
* Contains 113 translations.
|
||||||
* Generated on: 2022-03-01 18:04:38
|
* Generated on: 2022-03-04 16:42:21
|
||||||
*/
|
*/
|
||||||
#include "translateObjects.h"
|
#include "translateObjects.h"
|
||||||
|
|
||||||
@ -115,6 +115,7 @@ const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER";
|
|||||||
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
|
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
|
||||||
const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST";
|
const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST";
|
||||||
const char *TEST_TASK_STRING = "TEST_TASK";
|
const char *TEST_TASK_STRING = "TEST_TASK";
|
||||||
|
const char *ACS_BOARD_ASS_STRING = "ACS_BOARD_ASS";
|
||||||
const char *TM_FUNNEL_STRING = "TM_FUNNEL";
|
const char *TM_FUNNEL_STRING = "TM_FUNNEL";
|
||||||
const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE";
|
const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE";
|
||||||
const char *NO_OBJECT_STRING = "NO_OBJECT";
|
const char *NO_OBJECT_STRING = "NO_OBJECT";
|
||||||
@ -339,6 +340,8 @@ const char *translateObject(object_id_t object) {
|
|||||||
return LIBGPIOD_TEST_STRING;
|
return LIBGPIOD_TEST_STRING;
|
||||||
case 0x54694269:
|
case 0x54694269:
|
||||||
return TEST_TASK_STRING;
|
return TEST_TASK_STRING;
|
||||||
|
case 0x73000001:
|
||||||
|
return ACS_BOARD_ASS_STRING;
|
||||||
case 0x73000100:
|
case 0x73000100:
|
||||||
return TM_FUNNEL_STRING;
|
return TM_FUNNEL_STRING;
|
||||||
case 0x73500000:
|
case 0x73500000:
|
||||||
|
@ -84,6 +84,7 @@ debugging. */
|
|||||||
#define OBSW_ADD_UART_TEST_CODE 0
|
#define OBSW_ADD_UART_TEST_CODE 0
|
||||||
|
|
||||||
#define OBSW_TEST_ACS 0
|
#define OBSW_TEST_ACS 0
|
||||||
|
#define OBSW_TEST_ACS_BAORD_ASS 0
|
||||||
#define OBSW_DEBUG_ACS 0
|
#define OBSW_DEBUG_ACS 0
|
||||||
#define OBSW_TEST_SUS 0
|
#define OBSW_TEST_SUS 0
|
||||||
#define OBSW_DEBUG_SUS 0
|
#define OBSW_DEBUG_SUS 0
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @brief Auto-generated event translation file. Contains 141 translations.
|
* @brief Auto-generated event translation file. Contains 141 translations.
|
||||||
* @details
|
* @details
|
||||||
* Generated on: 2022-03-01 18:04:34
|
* Generated on: 2022-03-04 16:42:09
|
||||||
*/
|
*/
|
||||||
#include "translateEvents.h"
|
#include "translateEvents.h"
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* @brief Auto-generated object translation file.
|
* @brief Auto-generated object translation file.
|
||||||
* @details
|
* @details
|
||||||
* Contains 112 translations.
|
* Contains 113 translations.
|
||||||
* Generated on: 2022-03-01 18:04:38
|
* Generated on: 2022-03-04 16:42:21
|
||||||
*/
|
*/
|
||||||
#include "translateObjects.h"
|
#include "translateObjects.h"
|
||||||
|
|
||||||
@ -115,6 +115,7 @@ const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER";
|
|||||||
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
|
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
|
||||||
const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST";
|
const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST";
|
||||||
const char *TEST_TASK_STRING = "TEST_TASK";
|
const char *TEST_TASK_STRING = "TEST_TASK";
|
||||||
|
const char *ACS_BOARD_ASS_STRING = "ACS_BOARD_ASS";
|
||||||
const char *TM_FUNNEL_STRING = "TM_FUNNEL";
|
const char *TM_FUNNEL_STRING = "TM_FUNNEL";
|
||||||
const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE";
|
const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE";
|
||||||
const char *NO_OBJECT_STRING = "NO_OBJECT";
|
const char *NO_OBJECT_STRING = "NO_OBJECT";
|
||||||
@ -339,6 +340,8 @@ const char *translateObject(object_id_t object) {
|
|||||||
return LIBGPIOD_TEST_STRING;
|
return LIBGPIOD_TEST_STRING;
|
||||||
case 0x54694269:
|
case 0x54694269:
|
||||||
return TEST_TASK_STRING;
|
return TEST_TASK_STRING;
|
||||||
|
case 0x73000001:
|
||||||
|
return ACS_BOARD_ASS_STRING;
|
||||||
case 0x73000100:
|
case 0x73000100:
|
||||||
return TM_FUNNEL_STRING;
|
return TM_FUNNEL_STRING;
|
||||||
case 0x73500000:
|
case 0x73500000:
|
||||||
|
@ -26,7 +26,6 @@ ReturnValue_t PCDUHandler::performOperation(uint8_t counter) {
|
|||||||
readCommandQueue();
|
readCommandQueue();
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +115,7 @@ void PCDUHandler::readCommandQueue() {
|
|||||||
|
|
||||||
MessageQueueId_t PCDUHandler::getCommandQueue() const { return commandQueue->getId(); }
|
MessageQueueId_t PCDUHandler::getCommandQueue() const { return commandQueue->getId(); }
|
||||||
|
|
||||||
void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId) {
|
void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId, bool* clearMessage) {
|
||||||
if (sid == sid_t(objects::PDU2_HANDLER, PDU2::HK_TABLE_DATA_SET_ID)) {
|
if (sid == sid_t(objects::PDU2_HANDLER, PDU2::HK_TABLE_DATA_SET_ID)) {
|
||||||
updateHkTableDataset(storeId, &pdu2HkTableDataset, &timeStampPdu2HkDataset);
|
updateHkTableDataset(storeId, &pdu2HkTableDataset, &timeStampPdu2HkDataset);
|
||||||
updatePdu2SwitchStates();
|
updatePdu2SwitchStates();
|
||||||
@ -204,7 +203,6 @@ void PCDUHandler::updatePdu1SwitchStates() {
|
|||||||
} else {
|
} else {
|
||||||
sif::debug << "PCDUHandler::updatePdu1SwitchStates: Failed to read dataset" << std::endl;
|
sif::debug << "PCDUHandler::updatePdu1SwitchStates: Failed to read dataset" << std::endl;
|
||||||
}
|
}
|
||||||
pdu1HkTableDataset.commit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalDataPoolManager* PCDUHandler::getHkManagerHandle() { return &poolManager; }
|
LocalDataPoolManager* PCDUHandler::getHkManagerHandle() { return &poolManager; }
|
||||||
|
@ -27,7 +27,8 @@ class PCDUHandler : public PowerSwitchIF,
|
|||||||
virtual ReturnValue_t initialize() override;
|
virtual ReturnValue_t initialize() override;
|
||||||
virtual ReturnValue_t performOperation(uint8_t counter) override;
|
virtual ReturnValue_t performOperation(uint8_t counter) override;
|
||||||
virtual void handleChangedDataset(sid_t sid,
|
virtual void handleChangedDataset(sid_t sid,
|
||||||
store_address_t storeId = storeId::INVALID_STORE_ADDRESS);
|
store_address_t storeId = storeId::INVALID_STORE_ADDRESS,
|
||||||
|
bool* clearMessage = nullptr) override;
|
||||||
|
|
||||||
virtual void sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) const override;
|
virtual void sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) const override;
|
||||||
virtual void sendFuseOnCommand(uint8_t fuseNr) const override;
|
virtual void sendFuseOnCommand(uint8_t fuseNr) const override;
|
||||||
|
@ -27,42 +27,54 @@ AcsBoardAssembly::AcsBoardAssembly(object_id_t objectId, object_id_t parentId,
|
|||||||
initModeTableEntry(helper.gpsId, entry);
|
initModeTableEntry(helper.gpsId, entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AcsBoardAssembly::handleChildrenTransition() {
|
||||||
|
if (state == States::SWITCHING_POWER) {
|
||||||
|
powerStateMachine(targetMode, targetSubmode);
|
||||||
|
} else {
|
||||||
|
AssemblyBase::handleChildrenTransition();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ReturnValue_t AcsBoardAssembly::commandChildren(Mode_t mode, Submode_t submode) {
|
ReturnValue_t AcsBoardAssembly::commandChildren(Mode_t mode, Submode_t submode) {
|
||||||
ReturnValue_t result = RETURN_OK;
|
ReturnValue_t result = RETURN_OK;
|
||||||
refreshHelperModes();
|
refreshHelperModes();
|
||||||
powerStateMachine(mode, submode);
|
powerStateMachine(mode, submode);
|
||||||
if (mode == DeviceHandlerIF::MODE_NORMAL or mode == MODE_ON) {
|
if (state == States::MODE_COMMANDING) {
|
||||||
if (state == States::MODE_COMMANDING) {
|
if (mode == DeviceHandlerIF::MODE_NORMAL or mode == MODE_ON) {
|
||||||
handleNormalOrOnModeCmd(mode, submode);
|
handleNormalOrOnModeCmd(mode, submode);
|
||||||
|
} else {
|
||||||
|
modeTable[ModeTableIdx::GYRO_0_A].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::GYRO_0_A].setSubmode(SUBMODE_NONE);
|
||||||
|
modeTable[ModeTableIdx::GYRO_1_A].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::GYRO_1_A].setSubmode(SUBMODE_NONE);
|
||||||
|
modeTable[ModeTableIdx::GYRO_2_B].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::GYRO_2_B].setSubmode(SUBMODE_NONE);
|
||||||
|
modeTable[ModeTableIdx::GYRO_3_B].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::GYRO_3_B].setSubmode(SUBMODE_NONE);
|
||||||
|
modeTable[ModeTableIdx::MGM_0_A].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::MGM_0_A].setSubmode(SUBMODE_NONE);
|
||||||
|
modeTable[ModeTableIdx::MGM_1_A].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::MGM_1_A].setSubmode(SUBMODE_NONE);
|
||||||
|
modeTable[ModeTableIdx::MGM_2_B].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::MGM_2_B].setSubmode(SUBMODE_NONE);
|
||||||
|
modeTable[ModeTableIdx::MGM_3_B].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::MGM_3_B].setSubmode(SUBMODE_NONE);
|
||||||
|
modeTable[ModeTableIdx::GPS].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::GPS].setSubmode(SUBMODE_NONE);
|
||||||
}
|
}
|
||||||
} else {
|
HybridIterator<ModeListEntry> tableIter(modeTable.begin(), modeTable.end());
|
||||||
modeTable[ModeTableIdx::GYRO_0_A].setMode(MODE_OFF);
|
executeTable(tableIter);
|
||||||
modeTable[ModeTableIdx::GYRO_0_A].setSubmode(SUBMODE_NONE);
|
|
||||||
modeTable[ModeTableIdx::GYRO_1_A].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::GYRO_1_A].setSubmode(SUBMODE_NONE);
|
|
||||||
modeTable[ModeTableIdx::GYRO_2_B].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::GYRO_2_B].setSubmode(SUBMODE_NONE);
|
|
||||||
modeTable[ModeTableIdx::GYRO_3_B].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::GYRO_3_B].setSubmode(SUBMODE_NONE);
|
|
||||||
modeTable[ModeTableIdx::MGM_0_A].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::MGM_0_A].setSubmode(SUBMODE_NONE);
|
|
||||||
modeTable[ModeTableIdx::MGM_1_A].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::MGM_1_A].setSubmode(SUBMODE_NONE);
|
|
||||||
modeTable[ModeTableIdx::MGM_2_B].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::MGM_2_B].setSubmode(SUBMODE_NONE);
|
|
||||||
modeTable[ModeTableIdx::MGM_3_B].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::MGM_3_B].setSubmode(SUBMODE_NONE);
|
|
||||||
modeTable[ModeTableIdx::GPS].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::GPS].setSubmode(SUBMODE_NONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HybridIterator<ModeListEntry> tableIter(modeTable.begin(), modeTable.end());
|
|
||||||
executeTable(tableIter);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t AcsBoardAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) {
|
ReturnValue_t AcsBoardAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) {
|
||||||
refreshHelperModes();
|
refreshHelperModes();
|
||||||
|
if (state == States::SWITCHING_POWER) {
|
||||||
|
// Wrong mode
|
||||||
|
sif::error << "Wrong mode, currently swichting power" << std::endl;
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
if (submode == A_SIDE) {
|
if (submode == A_SIDE) {
|
||||||
if ((helper.gyro0SideAMode != wantedMode and helper.gyro1SideAMode != wantedMode) or
|
if ((helper.gyro0SideAMode != wantedMode and helper.gyro1SideAMode != wantedMode) or
|
||||||
(helper.mgm0SideAMode != wantedMode and helper.mgm1SideAMode != wantedMode) or
|
(helper.mgm0SideAMode != wantedMode and helper.mgm1SideAMode != wantedMode) or
|
||||||
@ -211,7 +223,7 @@ void AcsBoardAssembly::powerStateMachine(Mode_t mode, Submode_t submode) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (this->submode) {
|
switch (submode) {
|
||||||
case (A_SIDE): {
|
case (A_SIDE): {
|
||||||
if (switchStateA == PowerSwitchIF::SWITCH_ON and
|
if (switchStateA == PowerSwitchIF::SWITCH_ON and
|
||||||
switchStateB == PowerSwitchIF::SWITCH_OFF) {
|
switchStateB == PowerSwitchIF::SWITCH_OFF) {
|
||||||
@ -239,37 +251,37 @@ void AcsBoardAssembly::powerStateMachine(Mode_t mode, Submode_t submode) {
|
|||||||
if (state == States::IDLE) {
|
if (state == States::IDLE) {
|
||||||
if (mode == MODE_OFF) {
|
if (mode == MODE_OFF) {
|
||||||
if (switchStateA != PowerSwitchIF::SWITCH_OFF) {
|
if (switchStateA != PowerSwitchIF::SWITCH_OFF) {
|
||||||
pwrSwitcher->sendSwitchCommand(SWITCH_A, false);
|
pwrSwitcher->sendSwitchCommand(SWITCH_A, PowerSwitchIF::SWITCH_ON);
|
||||||
}
|
}
|
||||||
if (switchStateB != PowerSwitchIF::SWITCH_OFF) {
|
if (switchStateB != PowerSwitchIF::SWITCH_OFF) {
|
||||||
pwrSwitcher->sendSwitchCommand(SWITCH_B, false);
|
pwrSwitcher->sendSwitchCommand(SWITCH_B, PowerSwitchIF::SWITCH_OFF);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (submode) {
|
switch (submode) {
|
||||||
case (A_SIDE): {
|
case (A_SIDE): {
|
||||||
if (switchStateA != PowerSwitchIF::SWITCH_ON) {
|
if (switchStateA != PowerSwitchIF::SWITCH_ON) {
|
||||||
pwrSwitcher->sendSwitchCommand(SWITCH_A, true);
|
pwrSwitcher->sendSwitchCommand(SWITCH_A, PowerSwitchIF::SWITCH_ON);
|
||||||
}
|
}
|
||||||
if (switchStateB != PowerSwitchIF::SWITCH_OFF) {
|
if (switchStateB != PowerSwitchIF::SWITCH_OFF) {
|
||||||
pwrSwitcher->sendSwitchCommand(SWITCH_B, false);
|
pwrSwitcher->sendSwitchCommand(SWITCH_B, PowerSwitchIF::SWITCH_OFF);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (B_SIDE): {
|
case (B_SIDE): {
|
||||||
if (switchStateA != PowerSwitchIF::SWITCH_OFF) {
|
if (switchStateA != PowerSwitchIF::SWITCH_OFF) {
|
||||||
pwrSwitcher->sendSwitchCommand(SWITCH_A, false);
|
pwrSwitcher->sendSwitchCommand(SWITCH_A, PowerSwitchIF::SWITCH_OFF);
|
||||||
}
|
}
|
||||||
if (switchStateB != PowerSwitchIF::SWITCH_ON) {
|
if (switchStateB != PowerSwitchIF::SWITCH_ON) {
|
||||||
pwrSwitcher->sendSwitchCommand(SWITCH_B, true);
|
pwrSwitcher->sendSwitchCommand(SWITCH_B, PowerSwitchIF::SWITCH_OFF);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (DUAL_MODE): {
|
case (DUAL_MODE): {
|
||||||
if (switchStateA != PowerSwitchIF::SWITCH_ON) {
|
if (switchStateA != PowerSwitchIF::SWITCH_ON) {
|
||||||
pwrSwitcher->sendSwitchCommand(SWITCH_A, true);
|
pwrSwitcher->sendSwitchCommand(SWITCH_A, PowerSwitchIF::SWITCH_ON);
|
||||||
}
|
}
|
||||||
if (switchStateB != PowerSwitchIF::SWITCH_ON) {
|
if (switchStateB != PowerSwitchIF::SWITCH_ON) {
|
||||||
pwrSwitcher->sendSwitchCommand(SWITCH_B, true);
|
pwrSwitcher->sendSwitchCommand(SWITCH_B, PowerSwitchIF::SWITCH_ON);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -315,7 +327,11 @@ ReturnValue_t AcsBoardAssembly::initialize() {
|
|||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return result;
|
result = registerChild(helper.gpsId);
|
||||||
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return AssemblyBase::initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t AcsBoardAssembly::isModeCombinationValid(Mode_t mode, Submode_t submode) {
|
ReturnValue_t AcsBoardAssembly::isModeCombinationValid(Mode_t mode, Submode_t submode) {
|
||||||
|
@ -17,7 +17,8 @@ struct AcsBoardHelper {
|
|||||||
gyro0AdisIdSideA(gyro0Id),
|
gyro0AdisIdSideA(gyro0Id),
|
||||||
gyro1L3gIdSideA(gyro1Id),
|
gyro1L3gIdSideA(gyro1Id),
|
||||||
gyro2AdisIdSideB(gyro2Id),
|
gyro2AdisIdSideB(gyro2Id),
|
||||||
gyro3L3gIdSideB(gyro3Id) {}
|
gyro3L3gIdSideB(gyro3Id),
|
||||||
|
gpsId(gpsId) {}
|
||||||
|
|
||||||
object_id_t mgm0Lis3IdSideA = objects::NO_OBJECT;
|
object_id_t mgm0Lis3IdSideA = objects::NO_OBJECT;
|
||||||
object_id_t mgm1Rm3100IdSideA = objects::NO_OBJECT;
|
object_id_t mgm1Rm3100IdSideA = objects::NO_OBJECT;
|
||||||
@ -102,6 +103,7 @@ class AcsBoardAssembly : public AssemblyBase {
|
|||||||
ReturnValue_t commandChildren(Mode_t mode, Submode_t submode) override;
|
ReturnValue_t commandChildren(Mode_t mode, Submode_t submode) override;
|
||||||
ReturnValue_t checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) override;
|
ReturnValue_t checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) override;
|
||||||
ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode) override;
|
ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode) override;
|
||||||
|
void handleChildrenTransition() override;
|
||||||
void handleModeReached() override;
|
void handleModeReached() override;
|
||||||
void handleModeTransitionFailed(ReturnValue_t result) override;
|
void handleModeTransitionFailed(ReturnValue_t result) override;
|
||||||
void handleChildrenLostMode(ReturnValue_t result) override;
|
void handleChildrenLostMode(ReturnValue_t result) override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user