Merge remote-tracking branch 'origin/develop' into refactoring_bugfixes_power_switching
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2023-03-14 13:56:54 +01:00
commit 882fb02600
39 changed files with 329 additions and 142 deletions

View File

@ -19,12 +19,19 @@ will consitute of a breaking change warranting a new major release:
## Added ## Added
- Added `EXECUTE_SHELL_CMD` action command for `CoreController` to execute arbitrary Linux commands. - Added `EXECUTE_SHELL_CMD` action command for `CoreController` to execute arbitrary Linux commands.
- Add `PcduHandlerDummy` component.
## Fixed ## Fixed
- Pointing control of the `AcsController` was still expecting submodes instead of modes. - Pointing control of the `AcsController` was still expecting submodes instead of modes.
- Limitation of RW speeds was done before converting them to the correct unit scale. - Limitation of RW speeds was done before converting them to the correct unit scale.
- The Syrlinks task now has a proper name instead of `MAIN_SPI`. - The Syrlinks task now has a proper name instead of `MAIN_SPI`.
- Make whole EIVE system initial transition work for the EM. This was also made possible by
always scheduling most EIVE components instead of tying the scheduling to preprocessor defines.
## Changed
- Set `OBSW_ADD_TCS_CTRL` to 1. Always add TCS controller now for both EM and FM.
## Changed ## Changed

View File

@ -110,7 +110,7 @@ set(OBSW_TC_FROM_PDEC
1 1
CACHE STRING "Poll telecommand from PDEC IP core") CACHE STRING "Poll telecommand from PDEC IP core")
set(OBSW_ADD_TCS_CTRL set(OBSW_ADD_TCS_CTRL
${INIT_VAL} 1
CACHE STRING "Add TCS controllers") CACHE STRING "Add TCS controllers")
set(OBSW_ADD_HEATERS set(OBSW_ADD_HEATERS
${INIT_VAL} ${INIT_VAL}

View File

@ -68,6 +68,9 @@
#include "mission/tmtc/tmFilters.h" #include "mission/tmtc/tmFilters.h"
#include "mission/utility/GlobalConfigHandler.h" #include "mission/utility/GlobalConfigHandler.h"
#include "tmtc/pusIds.h" #include "tmtc/pusIds.h"
using gpio::Direction;
using gpio::Levels;
#if OBSW_TEST_LIBGPIOD == 1 #if OBSW_TEST_LIBGPIOD == 1
#include "linux/boardtest/LibgpiodTest.h" #include "linux/boardtest/LibgpiodTest.h"
#endif #endif
@ -254,106 +257,110 @@ ReturnValue_t ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF,
return returnvalue::OK; return returnvalue::OK;
} }
void ObjectFactory::createAcsBoardComponents(SpiComIF& spiComIF, LinuxLibgpioIF* gpioComIF, void ObjectFactory::createAcsBoardGpios(GpioCookie& cookie) {
SerialComIF* uartComIF, PowerSwitchIF& pwrSwitcher) {
using namespace gpio;
GpioCookie* gpioCookieAcsBoard = new GpioCookie();
std::stringstream consumer; std::stringstream consumer;
GpiodRegularByLineName* gpio = nullptr; GpiodRegularByLineName* gpio = nullptr;
consumer << "0x" << std::hex << objects::GYRO_0_ADIS_HANDLER; consumer << "0x" << std::hex << objects::GYRO_0_ADIS_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, consumer.str(), Direction::OUT,
Levels::HIGH); Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio); cookie.addGpio(gpioIds::GYRO_0_ADIS_CS, gpio);
consumer.str(""); consumer.str("");
consumer << "0x" << std::hex << objects::GYRO_1_L3G_HANDLER; consumer << "0x" << std::hex << objects::GYRO_1_L3G_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_1_L3G_CS, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_1_L3G_CS, consumer.str(), Direction::OUT,
Levels::HIGH); Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_1_L3G_CS, gpio); cookie.addGpio(gpioIds::GYRO_1_L3G_CS, gpio);
consumer.str(""); consumer.str("");
consumer << "0x" << std::hex << objects::GYRO_2_ADIS_HANDLER; consumer << "0x" << std::hex << objects::GYRO_2_ADIS_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ADIS_CS, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ADIS_CS, consumer.str(), Direction::OUT,
Levels::HIGH); Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_2_ADIS_CS, gpio); cookie.addGpio(gpioIds::GYRO_2_ADIS_CS, gpio);
consumer.str(""); consumer.str("");
consumer << "0x" << std::hex << objects::GYRO_3_L3G_HANDLER; consumer << "0x" << std::hex << objects::GYRO_3_L3G_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_3_L3G_CS, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_3_L3G_CS, consumer.str(), Direction::OUT,
Levels::HIGH); Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_3_L3G_CS, gpio); cookie.addGpio(gpioIds::GYRO_3_L3G_CS, gpio);
consumer.str(""); consumer.str("");
consumer << "0x" << std::hex << objects::MGM_0_LIS3_HANDLER; consumer << "0x" << std::hex << objects::MGM_0_LIS3_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_0_CS, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_0_CS, consumer.str(), Direction::OUT,
Levels::HIGH); Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::MGM_0_LIS3_CS, gpio); cookie.addGpio(gpioIds::MGM_0_LIS3_CS, gpio);
consumer.str(""); consumer.str("");
consumer << "0x" << std::hex << objects::MGM_1_RM3100_HANDLER; consumer << "0x" << std::hex << objects::MGM_1_RM3100_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, consumer.str(), Direction::OUT,
Levels::HIGH); Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::MGM_1_RM3100_CS, gpio); cookie.addGpio(gpioIds::MGM_1_RM3100_CS, gpio);
consumer.str(""); consumer.str("");
consumer << "0x" << std::hex << objects::MGM_2_LIS3_HANDLER; consumer << "0x" << std::hex << objects::MGM_2_LIS3_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_2_CS, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_2_CS, consumer.str(), Direction::OUT,
Levels::HIGH); Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::MGM_2_LIS3_CS, gpio); cookie.addGpio(gpioIds::MGM_2_LIS3_CS, gpio);
consumer.str(""); consumer.str("");
consumer << "0x" << std::hex << objects::MGM_3_RM3100_HANDLER; consumer << "0x" << std::hex << objects::MGM_3_RM3100_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_3_CS, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_3_CS, consumer.str(), Direction::OUT,
Levels::HIGH); Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::MGM_3_RM3100_CS, gpio); cookie.addGpio(gpioIds::MGM_3_RM3100_CS, gpio);
consumer.str(""); consumer.str("");
consumer << "0x" << std::hex << objects::GPS_CONTROLLER; consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
// GNSS reset pins are active low // GNSS reset pins are active low
gpio = new GpiodRegularByLineName(q7s::gpioNames::RESET_GNSS_0, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::RESET_GNSS_0, consumer.str(), Direction::OUT,
Levels::HIGH); Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_0_NRESET, gpio); cookie.addGpio(gpioIds::GNSS_0_NRESET, gpio);
consumer.str(""); consumer.str("");
consumer << "0x" << std::hex << objects::GPS_CONTROLLER; consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::RESET_GNSS_1, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::RESET_GNSS_1, consumer.str(), Direction::OUT,
Levels::HIGH); Levels::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_NRESET, gpio); cookie.addGpio(gpioIds::GNSS_1_NRESET, gpio);
consumer.str(""); consumer.str("");
consumer << "0x" << std::hex << objects::GYRO_0_ADIS_HANDLER; consumer << "0x" << std::hex << objects::GYRO_0_ADIS_HANDLER;
// Enable pins must be pulled low for regular operations // Enable pins must be pulled low for regular operations
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, consumer.str(), Direction::OUT,
Levels::LOW); Levels::LOW);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ENABLE, gpio); cookie.addGpio(gpioIds::GYRO_0_ENABLE, gpio);
consumer.str(""); consumer.str("");
consumer << "0x" << std::hex << objects::GYRO_2_ADIS_HANDLER; consumer << "0x" << std::hex << objects::GYRO_2_ADIS_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ENABLE, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ENABLE, consumer.str(), Direction::OUT,
Levels::LOW); Levels::LOW);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_2_ENABLE, gpio); cookie.addGpio(gpioIds::GYRO_2_ENABLE, gpio);
// Enable pins for GNSS // Enable pins for GNSS
consumer.str(""); consumer.str("");
consumer << "0x" << std::hex << objects::GPS_CONTROLLER; consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_0_ENABLE, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_0_ENABLE, consumer.str(), Direction::OUT,
Levels::LOW); Levels::LOW);
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_0_ENABLE, gpio); cookie.addGpio(gpioIds::GNSS_0_ENABLE, gpio);
consumer.str(""); consumer.str("");
consumer << "0x" << std::hex << objects::GPS_CONTROLLER; consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_1_ENABLE, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_1_ENABLE, consumer.str(), Direction::OUT,
Levels::LOW); Levels::LOW);
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_ENABLE, gpio); cookie.addGpio(gpioIds::GNSS_1_ENABLE, gpio);
// Select pin. 0 for GPS side A, 1 for GPS side B // Select pin. 0 for GPS side A, 1 for GPS side B
consumer.str(""); consumer.str("");
consumer << "0x" << std::hex << objects::GPS_CONTROLLER; consumer << "0x" << std::hex << objects::GPS_CONTROLLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_SELECT, consumer.str(), Direction::OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_SELECT, consumer.str(), Direction::OUT,
Levels::LOW); Levels::LOW);
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_SELECT, gpio); cookie.addGpio(gpioIds::GNSS_SELECT, gpio);
}
void ObjectFactory::createAcsBoardComponents(SpiComIF& spiComIF, LinuxLibgpioIF* gpioComIF,
SerialComIF* uartComIF, PowerSwitchIF& pwrSwitcher) {
using namespace gpio;
GpioCookie* gpioCookieAcsBoard = new GpioCookie();
createAcsBoardGpios(*gpioCookieAcsBoard);
gpioChecker(gpioComIF->addGpios(gpioCookieAcsBoard), "ACS Board"); gpioChecker(gpioComIF->addGpios(gpioCookieAcsBoard), "ACS Board");
AcsBoardFdir* fdir = nullptr; AcsBoardFdir* fdir = nullptr;
static_cast<void>(fdir); static_cast<void>(fdir);
@ -606,7 +613,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit
std::stringstream consumer; std::stringstream consumer;
auto* camSwitcher = auto* camSwitcher =
new CamSwitcher(objects::CAM_SWITCHER, pwrSwitch, pcdu::PDU2_CH8_PAYLOAD_CAMERA); new CamSwitcher(objects::CAM_SWITCHER, pwrSwitch, pcdu::PDU2_CH8_PAYLOAD_CAMERA);
camSwitcher->connectModeTreeParent(satsystem::pl::SUBSYSTEM); camSwitcher->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
#if OBSW_ADD_PLOC_MPSOC == 1 #if OBSW_ADD_PLOC_MPSOC == 1
consumer << "0x" << std::hex << objects::PLOC_MPSOC_HANDLER; consumer << "0x" << std::hex << objects::PLOC_MPSOC_HANDLER;
auto gpioConfigMPSoC = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_MPSOC_UART, auto gpioConfigMPSoC = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_MPSOC_UART,
@ -622,7 +629,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit
auto* mpsocHandler = new PlocMPSoCHandler( auto* mpsocHandler = new PlocMPSoCHandler(
objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocCookie, plocMpsocHelper, objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocCookie, plocMpsocHelper,
Gpio(gpioIds::ENABLE_MPSOC_UART, gpioComIF), objects::PLOC_SUPERVISOR_HANDLER); Gpio(gpioIds::ENABLE_MPSOC_UART, gpioComIF), objects::PLOC_SUPERVISOR_HANDLER);
mpsocHandler->connectModeTreeParent(satsystem::pl::SUBSYSTEM); mpsocHandler->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
#endif /* OBSW_ADD_PLOC_MPSOC == 1 */ #endif /* OBSW_ADD_PLOC_MPSOC == 1 */
#if OBSW_ADD_PLOC_SUPERVISOR == 1 #if OBSW_ADD_PLOC_SUPERVISOR == 1
consumer << "0x" << std::hex << objects::PLOC_SUPERVISOR_HANDLER; consumer << "0x" << std::hex << objects::PLOC_SUPERVISOR_HANDLER;
@ -639,7 +646,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit
auto* supvHandler = new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, supervisorCookie, auto* supvHandler = new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, supervisorCookie,
Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF), Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF),
pcdu::PDU1_CH6_PLOC_12V, *supvHelper); pcdu::PDU1_CH6_PLOC_12V, *supvHelper);
supvHandler->connectModeTreeParent(satsystem::pl::SUBSYSTEM); supvHandler->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
static_cast<void>(consumer); static_cast<void>(consumer);
} }
@ -894,7 +901,7 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF*
plPcduHandler->setToGoToNormalModeImmediately(true); plPcduHandler->setToGoToNormalModeImmediately(true);
plPcduHandler->enablePeriodicPrintout(true, 10); plPcduHandler->enablePeriodicPrintout(true, 10);
#endif #endif
plPcduHandler->connectModeTreeParent(satsystem::pl::SUBSYSTEM); plPcduHandler->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
} }
void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) { void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {

View File

@ -55,6 +55,7 @@ void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
PowerSwitchIF* pwrSwitcher, Stack5VHandler& stackHandler); PowerSwitchIF* pwrSwitcher, Stack5VHandler& stackHandler);
void createTmpComponents(); void createTmpComponents();
ReturnValue_t createRadSensorComponent(LinuxLibgpioIF* gpioComIF, Stack5VHandler& handler); ReturnValue_t createRadSensorComponent(LinuxLibgpioIF* gpioComIF, Stack5VHandler& handler);
void createAcsBoardGpios(GpioCookie& cookie);
void createAcsBoardComponents(SpiComIF& spiComIF, LinuxLibgpioIF* gpioComIF, SerialComIF* uartComIF, void createAcsBoardComponents(SpiComIF& spiComIF, LinuxLibgpioIF* gpioComIF, SerialComIF* uartComIF,
PowerSwitchIF& pwrSwitcher); PowerSwitchIF& pwrSwitcher);
void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable, void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable,

View File

@ -337,9 +337,7 @@ void scheduling::initTasks() {
"PL_TASK", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); "PL_TASK", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
plTask->addComponent(objects::CAM_SWITCHER); plTask->addComponent(objects::CAM_SWITCHER);
scheduling::addMpsocSupvHandlers(plTask); scheduling::addMpsocSupvHandlers(plTask);
#if OBSW_ADD_SCEX_DEVICE == 1
scheduling::scheduleScexDev(plTask); scheduling::scheduleScexDev(plTask);
#endif
#if OBSW_ADD_SCEX_DEVICE == 1 #if OBSW_ADD_SCEX_DEVICE == 1
PeriodicTaskIF* scexReaderTask; PeriodicTaskIF* scexReaderTask;
@ -501,7 +499,6 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction
} }
#endif #endif
#if OBSW_ADD_GOMSPACE_PCDU == 1
FixedTimeslotTaskIF* gomSpacePstTask = factory.createFixedTimeslotTask( FixedTimeslotTaskIF* gomSpacePstTask = factory.createFixedTimeslotTask(
"GS_PST_TASK", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc); "GS_PST_TASK", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc);
result = pst::pstGompaceCan(gomSpacePstTask); result = pst::pstGompaceCan(gomSpacePstTask);
@ -511,7 +508,6 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction
} }
} }
taskVec.push_back(gomSpacePstTask); taskVec.push_back(gomSpacePstTask);
#endif
} }
void scheduling::createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, void scheduling::createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc,

View File

@ -1,6 +1,9 @@
#include <bsp_q7s/callbacks/q7sGpioCallbacks.h> #include <bsp_q7s/callbacks/q7sGpioCallbacks.h>
#include <dummies/ComCookieDummy.h>
#include <dummies/PcduHandlerDummy.h>
#include <fsfw/health/HealthTableIF.h> #include <fsfw/health/HealthTableIF.h>
#include <fsfw/power/DummyPowerSwitcher.h> #include <fsfw/power/DummyPowerSwitcher.h>
#include <fsfw_hal/common/gpio/GpioCookie.h>
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h> #include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
#include <mission/system/tree/system.h> #include <mission/system/tree/system.h>
#include <mission/utility/DummySdCardManager.h> #include <mission/utility/DummySdCardManager.h>
@ -23,8 +26,12 @@ void ObjectFactory::produce(void* args) {
HealthTableIF* healthTable = nullptr; HealthTableIF* healthTable = nullptr;
PusTmFunnel* pusFunnel = nullptr; PusTmFunnel* pusFunnel = nullptr;
CfdpTmFunnel* cfdpFunnel = nullptr; CfdpTmFunnel* cfdpFunnel = nullptr;
StorageManagerIF* ipcStore = nullptr;
StorageManagerIF* tmStore = nullptr;
PersistentTmStores stores;
ObjectFactory::produceGenericObjects(&healthTable, &pusFunnel, &cfdpFunnel, ObjectFactory::produceGenericObjects(&healthTable, &pusFunnel, &cfdpFunnel,
*SdCardManager::instance()); *SdCardManager::instance(), &ipcStore, &tmStore, stores);
LinuxLibgpioIF* gpioComIF = nullptr; LinuxLibgpioIF* gpioComIF = nullptr;
SerialComIF* uartComIF = nullptr; SerialComIF* uartComIF = nullptr;
@ -51,7 +58,8 @@ void ObjectFactory::produce(void* args) {
PowerSwitchIF* pwrSwitcher = nullptr; PowerSwitchIF* pwrSwitcher = nullptr;
#if OBSW_ADD_GOMSPACE_PCDU == 0 #if OBSW_ADD_GOMSPACE_PCDU == 0
pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0); auto* comCookieDummy = new ComCookieDummy();
pwrSwitcher = new PcduHandlerDummy(objects::PCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
#else #else
createPcduComponents(gpioComIF, &pwrSwitcher); createPcduComponents(gpioComIF, &pwrSwitcher);
#endif #endif
@ -77,6 +85,11 @@ void ObjectFactory::produce(void* args) {
#if OBSW_ADD_ACS_BOARD == 1 #if OBSW_ADD_ACS_BOARD == 1
createAcsBoardComponents(gpioComIF, uartComIF, *pwrSwitcher); createAcsBoardComponents(gpioComIF, uartComIF, *pwrSwitcher);
#else
// Still add all GPIOs for EM.
GpioCookie* acsBoardGpios = new GpioCookie();
createAcsBoardGpios(*acsBoardGpios);
gpioChecker(gpioComIF->addGpios(acsBoardGpios), "ACS Board");
#endif #endif
#if OBSW_ADD_MGT == 1 #if OBSW_ADD_MGT == 1
@ -98,11 +111,16 @@ void ObjectFactory::produce(void* args) {
#if OBSW_ADD_STAR_TRACKER == 1 #if OBSW_ADD_STAR_TRACKER == 1
createStrComponents(pwrSwitcher); createStrComponents(pwrSwitcher);
#endif /* OBSW_ADD_STAR_TRACKER == 1 */ #endif /* OBSW_ADD_STAR_TRACKER == 1 */
#if OBSW_ADD_CCSDS_IP_CORES == 1 #if OBSW_ADD_CCSDS_IP_CORES == 1
CcsdsIpCoreHandler* ipCoreHandler = nullptr; CcsdsIpCoreHandler* ipCoreHandler = nullptr;
createCcsdsComponents(gpioComIF, &ipCoreHandler); CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel,
&ipCoreHandler);
createCcsdsComponents(ccsdsArgs);
#if OBSW_TM_TO_PTME == 1 #if OBSW_TM_TO_PTME == 1
ObjectFactory::addTmtcIpCoresToFunnels(*ipCoreHandler, *pusFunnel, *cfdpFunnel); if (ccsdsArgs.liveDestination != nullptr) {
pusFunnel->addLiveDestination("VC0 LIVE TM", *ccsdsArgs.liveDestination, 0);
}
#endif #endif
#endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */
/* Test Task */ /* Test Task */

View File

@ -77,6 +77,7 @@ void ObjectFactory::produce(void* args) {
#if OBSW_ADD_STAR_TRACKER == 1 #if OBSW_ADD_STAR_TRACKER == 1
createStrComponents(pwrSwitcher); createStrComponents(pwrSwitcher);
#endif /* OBSW_ADD_STAR_TRACKER == 1 */ #endif /* OBSW_ADD_STAR_TRACKER == 1 */
#if OBSW_ADD_CCSDS_IP_CORES == 1 #if OBSW_ADD_CCSDS_IP_CORES == 1
CcsdsIpCoreHandler* ipCoreHandler = nullptr; CcsdsIpCoreHandler* ipCoreHandler = nullptr;
CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel, CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel,

View File

@ -7,9 +7,9 @@ AcuDummy::AcuDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
AcuDummy::~AcuDummy() {} AcuDummy::~AcuDummy() {}
void AcuDummy::doStartUp() {} void AcuDummy::doStartUp() { setMode(MODE_NORMAL); }
void AcuDummy::doShutDown() {} void AcuDummy::doShutDown() { setMode(MODE_OFF); }
ReturnValue_t AcuDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } ReturnValue_t AcuDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; }
@ -37,6 +37,7 @@ uint32_t AcuDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return
ReturnValue_t AcuDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, ReturnValue_t AcuDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) { LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(ACU::pool::ACU_TEMPERATURES, new PoolEntry<float>(3)); localDataPoolMap.emplace(ACU::pool::ACU_TEMPERATURES,
new PoolEntry<float>({10.0, 10.0, 10.0}, true));
return returnvalue::OK; return returnvalue::OK;
} }

View File

@ -7,9 +7,9 @@ BpxDummy::BpxDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
BpxDummy::~BpxDummy() {} BpxDummy::~BpxDummy() {}
void BpxDummy::doStartUp() {} void BpxDummy::doStartUp() { setMode(MODE_NORMAL); }
void BpxDummy::doShutDown() {} void BpxDummy::doShutDown() { setMode(MODE_OFF); }
ReturnValue_t BpxDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } ReturnValue_t BpxDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; }

View File

@ -34,10 +34,10 @@ class BpxDummy : public DeviceHandlerBase {
PoolEntry<uint16_t> dischargeCurrent = PoolEntry<uint16_t>({0}); PoolEntry<uint16_t> dischargeCurrent = PoolEntry<uint16_t>({0});
PoolEntry<uint16_t> heaterCurrent = PoolEntry<uint16_t>({0}); PoolEntry<uint16_t> heaterCurrent = PoolEntry<uint16_t>({0});
PoolEntry<uint16_t> battVolt = PoolEntry<uint16_t>({0}); PoolEntry<uint16_t> battVolt = PoolEntry<uint16_t>({0});
PoolEntry<int16_t> battTemp1 = PoolEntry<int16_t>({0}); PoolEntry<int16_t> battTemp1 = PoolEntry<int16_t>({10}, true);
PoolEntry<int16_t> battTemp2 = PoolEntry<int16_t>({0}); PoolEntry<int16_t> battTemp2 = PoolEntry<int16_t>({10}, true);
PoolEntry<int16_t> battTemp3 = PoolEntry<int16_t>({0}); PoolEntry<int16_t> battTemp3 = PoolEntry<int16_t>({10}, true);
PoolEntry<int16_t> battTemp4 = PoolEntry<int16_t>({0}); PoolEntry<int16_t> battTemp4 = PoolEntry<int16_t>({10}, true);
PoolEntry<uint32_t> rebootCounter = PoolEntry<uint32_t>({0}); PoolEntry<uint32_t> rebootCounter = PoolEntry<uint32_t>({0});
PoolEntry<uint8_t> bootCause = PoolEntry<uint8_t>({0}); PoolEntry<uint8_t> bootCause = PoolEntry<uint8_t>({0});
PoolEntry<uint8_t> battheatMode = PoolEntry<uint8_t>({0}); PoolEntry<uint8_t> battheatMode = PoolEntry<uint8_t>({0});

View File

@ -7,6 +7,7 @@ target_sources(
ComCookieDummy.cpp ComCookieDummy.cpp
RwDummy.cpp RwDummy.cpp
Max31865Dummy.cpp Max31865Dummy.cpp
PcduHandlerDummy.cpp
StarTrackerDummy.cpp StarTrackerDummy.cpp
SyrlinksDummy.cpp SyrlinksDummy.cpp
ImtqDummy.cpp ImtqDummy.cpp

View File

@ -7,9 +7,9 @@ GyroAdisDummy::GyroAdisDummy(object_id_t objectId, object_id_t comif, CookieIF *
GyroAdisDummy::~GyroAdisDummy() {} GyroAdisDummy::~GyroAdisDummy() {}
void GyroAdisDummy::doStartUp() {} void GyroAdisDummy::doStartUp() { setMode(MODE_NORMAL); }
void GyroAdisDummy::doShutDown() {} void GyroAdisDummy::doShutDown() { setMode(MODE_OFF); }
ReturnValue_t GyroAdisDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { ReturnValue_t GyroAdisDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND; return NOTHING_TO_SEND;

View File

@ -7,9 +7,9 @@ GyroL3GD20Dummy::GyroL3GD20Dummy(object_id_t objectId, object_id_t comif, Cookie
GyroL3GD20Dummy::~GyroL3GD20Dummy() {} GyroL3GD20Dummy::~GyroL3GD20Dummy() {}
void GyroL3GD20Dummy::doStartUp() {} void GyroL3GD20Dummy::doStartUp() { setMode(MODE_NORMAL); }
void GyroL3GD20Dummy::doShutDown() {} void GyroL3GD20Dummy::doShutDown() { setMode(MODE_OFF); }
ReturnValue_t GyroL3GD20Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { ReturnValue_t GyroL3GD20Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND; return NOTHING_TO_SEND;

View File

@ -7,9 +7,9 @@ ImtqDummy::ImtqDummy(object_id_t objectId, object_id_t comif, CookieIF *comCooki
ImtqDummy::~ImtqDummy() = default; ImtqDummy::~ImtqDummy() = default;
void ImtqDummy::doStartUp() {} void ImtqDummy::doStartUp() { setMode(MODE_NORMAL); }
void ImtqDummy::doShutDown() {} void ImtqDummy::doShutDown() { setMode(_MODE_POWER_DOWN); }
ReturnValue_t ImtqDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } ReturnValue_t ImtqDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; }

View File

@ -7,9 +7,9 @@ MgmLIS3MDLDummy::MgmLIS3MDLDummy(object_id_t objectId, object_id_t comif, Cookie
MgmLIS3MDLDummy::~MgmLIS3MDLDummy() {} MgmLIS3MDLDummy::~MgmLIS3MDLDummy() {}
void MgmLIS3MDLDummy::doStartUp() {} void MgmLIS3MDLDummy::doStartUp() { setMode(MODE_NORMAL); }
void MgmLIS3MDLDummy::doShutDown() {} void MgmLIS3MDLDummy::doShutDown() { setMode(MODE_OFF); }
ReturnValue_t MgmLIS3MDLDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { ReturnValue_t MgmLIS3MDLDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND; return NOTHING_TO_SEND;

View File

@ -7,18 +7,22 @@ MgmRm3100Dummy::MgmRm3100Dummy(object_id_t objectId, object_id_t comif, CookieIF
MgmRm3100Dummy::~MgmRm3100Dummy() = default; MgmRm3100Dummy::~MgmRm3100Dummy() = default;
void MgmRm3100Dummy::doStartUp() {} void MgmRm3100Dummy::doStartUp() { setMode(MODE_NORMAL); }
void MgmRm3100Dummy::doShutDown() {} void MgmRm3100Dummy::doShutDown() { setMode(MODE_OFF); }
ReturnValue_t MgmRm3100Dummy::buildNormalDeviceCommand(DeviceCommandId_t* id) { return OK; } ReturnValue_t MgmRm3100Dummy::buildNormalDeviceCommand(DeviceCommandId_t* id) {
return NOTHING_TO_SEND;
}
ReturnValue_t MgmRm3100Dummy::buildTransitionDeviceCommand(DeviceCommandId_t* id) { return OK; } ReturnValue_t MgmRm3100Dummy::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
return NOTHING_TO_SEND;
}
ReturnValue_t MgmRm3100Dummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, ReturnValue_t MgmRm3100Dummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t* commandData, const uint8_t* commandData,
size_t commandDataLen) { size_t commandDataLen) {
return OK; return NOTHING_TO_SEND;
} }
ReturnValue_t MgmRm3100Dummy::scanForReply(const uint8_t* start, size_t len, ReturnValue_t MgmRm3100Dummy::scanForReply(const uint8_t* start, size_t len,

View File

@ -7,9 +7,9 @@ P60DockDummy::P60DockDummy(object_id_t objectId, object_id_t comif, CookieIF *co
P60DockDummy::~P60DockDummy() {} P60DockDummy::~P60DockDummy() {}
void P60DockDummy::doStartUp() {} void P60DockDummy::doStartUp() { setMode(MODE_NORMAL); }
void P60DockDummy::doShutDown() {} void P60DockDummy::doShutDown() { setMode(MODE_OFF); }
ReturnValue_t P60DockDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { ReturnValue_t P60DockDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND; return NOTHING_TO_SEND;
@ -40,7 +40,9 @@ uint32_t P60DockDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { re
ReturnValue_t P60DockDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, ReturnValue_t P60DockDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) { LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_1, new PoolEntry<float>({0})); localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_1,
localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_2, new PoolEntry<float>({0})); new PoolEntry<float>({10.0}, true));
localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_2,
new PoolEntry<float>({10.0}, true));
return returnvalue::OK; return returnvalue::OK;
} }

View File

@ -0,0 +1,62 @@
#include "PcduHandlerDummy.h"
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
PcduHandlerDummy::PcduHandlerDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie), dummySwitcher(objectId, 18, 18, false) {}
PcduHandlerDummy::~PcduHandlerDummy() {}
void PcduHandlerDummy::doStartUp() { setMode(MODE_NORMAL); }
void PcduHandlerDummy::doShutDown() { setMode(MODE_OFF); }
ReturnValue_t PcduHandlerDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t PcduHandlerDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
}
ReturnValue_t PcduHandlerDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t *commandData,
size_t commandDataLen) {
return returnvalue::OK;
}
ReturnValue_t PcduHandlerDummy::scanForReply(const uint8_t *start, size_t len,
DeviceCommandId_t *foundId, size_t *foundLen) {
return returnvalue::OK;
}
ReturnValue_t PcduHandlerDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
return returnvalue::OK;
}
void PcduHandlerDummy::fillCommandAndReplyMap() {}
uint32_t PcduHandlerDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; }
ReturnValue_t PcduHandlerDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
return returnvalue::OK;
}
ReturnValue_t PcduHandlerDummy::sendSwitchCommand(power::Switch_t switchNr, ReturnValue_t onOff) {
return dummySwitcher.sendSwitchCommand(switchNr, onOff);
}
ReturnValue_t PcduHandlerDummy::sendFuseOnCommand(uint8_t fuseNr) {
return dummySwitcher.sendFuseOnCommand(fuseNr);
}
ReturnValue_t PcduHandlerDummy::getSwitchState(power::Switch_t switchNr) const {
return dummySwitcher.getSwitchState(switchNr);
}
ReturnValue_t PcduHandlerDummy::getFuseState(uint8_t fuseNr) const {
return dummySwitcher.getFuseState(fuseNr);
}
uint32_t PcduHandlerDummy::getSwitchDelayMs(void) const { return dummySwitcher.getSwitchDelayMs(); }

View File

@ -0,0 +1,39 @@
#pragma once
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
#include <fsfw/power/DummyPowerSwitcher.h>
class PcduHandlerDummy : public DeviceHandlerBase, public PowerSwitchIF {
public:
static const DeviceCommandId_t SIMPLE_COMMAND = 1;
static const DeviceCommandId_t PERIODIC_REPLY = 2;
static const uint8_t SIMPLE_COMMAND_DATA = 1;
static const uint8_t PERIODIC_REPLY_DATA = 2;
PcduHandlerDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
virtual ~PcduHandlerDummy();
protected:
DummyPowerSwitcher dummySwitcher;
void doStartUp() override;
void doShutDown() override;
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override;
ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData,
size_t commandDataLen) override;
ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId,
size_t *foundLen) override;
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override;
void fillCommandAndReplyMap() override;
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) override;
ReturnValue_t sendSwitchCommand(power::Switch_t switchNr, ReturnValue_t onOff) override;
ReturnValue_t sendFuseOnCommand(uint8_t fuseNr) override;
ReturnValue_t getSwitchState(power::Switch_t switchNr) const override;
ReturnValue_t getFuseState(uint8_t fuseNr) const override;
uint32_t getSwitchDelayMs(void) const override;
};

View File

@ -8,9 +8,9 @@ PduDummy::PduDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
PduDummy::~PduDummy() {} PduDummy::~PduDummy() {}
void PduDummy::doStartUp() {} void PduDummy::doStartUp() { setMode(MODE_NORMAL); }
void PduDummy::doShutDown() {} void PduDummy::doShutDown() { setMode(MODE_OFF); }
ReturnValue_t PduDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } ReturnValue_t PduDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; }
@ -38,7 +38,7 @@ uint32_t PduDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return
ReturnValue_t PduDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, ReturnValue_t PduDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) { LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(PDU::pool::PDU_TEMPERATURE, new PoolEntry<float>({0})); localDataPoolMap.emplace(PDU::pool::PDU_TEMPERATURE, new PoolEntry<float>({10.0}, true));
localDataPoolMap.emplace(PDU::pool::PDU_VOLTAGES, &pduVoltages); localDataPoolMap.emplace(PDU::pool::PDU_VOLTAGES, &pduVoltages);
localDataPoolMap.emplace(PDU::pool::PDU_CURRENTS, &pduCurrents); localDataPoolMap.emplace(PDU::pool::PDU_CURRENTS, &pduCurrents);
return returnvalue::OK; return returnvalue::OK;

View File

@ -7,9 +7,9 @@ PlPcduDummy::PlPcduDummy(object_id_t objectId, object_id_t comif, CookieIF *comC
PlPcduDummy::~PlPcduDummy() {} PlPcduDummy::~PlPcduDummy() {}
void PlPcduDummy::doStartUp() {} void PlPcduDummy::doStartUp() { setMode(MODE_NORMAL); }
void PlPcduDummy::doShutDown() {} void PlPcduDummy::doShutDown() { setMode(MODE_OFF); }
ReturnValue_t PlPcduDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { ReturnValue_t PlPcduDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND; return NOTHING_TO_SEND;
@ -40,6 +40,6 @@ uint32_t PlPcduDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { ret
ReturnValue_t PlPcduDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, ReturnValue_t PlPcduDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) { LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::TEMP, new PoolEntry<float>({0.0})); localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::TEMP, new PoolEntry<float>({0.0}, true));
return returnvalue::OK; return returnvalue::OK;
} }

View File

@ -5,9 +5,9 @@ PlocMpsocDummy::PlocMpsocDummy(object_id_t objectId, object_id_t comif, CookieIF
PlocMpsocDummy::~PlocMpsocDummy() {} PlocMpsocDummy::~PlocMpsocDummy() {}
void PlocMpsocDummy::doStartUp() {} void PlocMpsocDummy::doStartUp() { setMode(MODE_ON); }
void PlocMpsocDummy::doShutDown() {} void PlocMpsocDummy::doShutDown() { setMode(MODE_OFF); }
ReturnValue_t PlocMpsocDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { ReturnValue_t PlocMpsocDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND; return NOTHING_TO_SEND;

View File

@ -6,9 +6,9 @@ PlocSupervisorDummy::PlocSupervisorDummy(object_id_t objectId, object_id_t comif
PlocSupervisorDummy::~PlocSupervisorDummy() {} PlocSupervisorDummy::~PlocSupervisorDummy() {}
void PlocSupervisorDummy::doStartUp() {} void PlocSupervisorDummy::doStartUp() { setMode(MODE_ON); }
void PlocSupervisorDummy::doShutDown() {} void PlocSupervisorDummy::doShutDown() { setMode(_MODE_POWER_DOWN); }
ReturnValue_t PlocSupervisorDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { ReturnValue_t PlocSupervisorDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND; return NOTHING_TO_SEND;

View File

@ -5,9 +5,9 @@ ScexDummy::ScexDummy(object_id_t objectId, object_id_t comif, CookieIF *comCooki
ScexDummy::~ScexDummy() {} ScexDummy::~ScexDummy() {}
void ScexDummy::doStartUp() {} void ScexDummy::doStartUp() { setMode(MODE_ON); }
void ScexDummy::doShutDown() {} void ScexDummy::doShutDown() { setMode(MODE_OFF); }
ReturnValue_t ScexDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } ReturnValue_t ScexDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; }

View File

@ -5,9 +5,9 @@ SusDummy::SusDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
SusDummy::~SusDummy() {} SusDummy::~SusDummy() {}
void SusDummy::doStartUp() {} void SusDummy::doStartUp() { setMode(MODE_NORMAL); }
void SusDummy::doShutDown() {} void SusDummy::doShutDown() { setMode(MODE_OFF); }
ReturnValue_t SusDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } ReturnValue_t SusDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; }

View File

@ -6,8 +6,10 @@ using namespace returnvalue;
Tmp1075Dummy::Tmp1075Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) Tmp1075Dummy::Tmp1075Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie), set(this) {} : DeviceHandlerBase(objectId, comif, comCookie), set(this) {}
void Tmp1075Dummy::doStartUp() { setMode(MODE_ON); }
void Tmp1075Dummy::doShutDown() { setMode(_MODE_POWER_DOWN); } void Tmp1075Dummy::doStartUp() { setMode(MODE_NORMAL); }
void Tmp1075Dummy::doShutDown() { setMode(MODE_OFF); }
ReturnValue_t Tmp1075Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { ReturnValue_t Tmp1075Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND; return NOTHING_TO_SEND;
} }

View File

@ -26,6 +26,8 @@
#include <dummies/SyrlinksDummy.h> #include <dummies/SyrlinksDummy.h>
#include <fsfw_hal/common/gpio/GpioIF.h> #include <fsfw_hal/common/gpio/GpioIF.h>
#include <mission/system/objects/CamSwitcher.h> #include <mission/system/objects/CamSwitcher.h>
#include <mission/system/objects/ImtqAssembly.h>
#include <mission/system/objects/StrAssembly.h>
#include <mission/system/objects/TcsBoardAssembly.h> #include <mission/system/objects/TcsBoardAssembly.h>
#include "TemperatureSensorInserter.h" #include "TemperatureSensorInserter.h"
@ -56,17 +58,21 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio
rws[3] = new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy); rws[3] = new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy);
ObjectFactory::createRwAssy(pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds); ObjectFactory::createRwAssy(pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds);
new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER); new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER);
auto* strAssy = new StrAssembly(objects::STR_ASSY);
strAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);
auto* strDummy = auto* strDummy =
new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy); new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy);
strDummy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); strDummy->connectModeTreeParent(*strAssy);
if (cfg.addSyrlinksDummies) { if (cfg.addSyrlinksDummies) {
auto* syrlinksDummy = auto* syrlinksDummy =
new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
syrlinksDummy->connectModeTreeParent(satsystem::com::SUBSYSTEM); syrlinksDummy->connectModeTreeParent(satsystem::com::SUBSYSTEM);
} }
auto* imtqAssy = new ImtqAssembly(objects::IMTQ_ASSY);
imtqAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);
auto* imtqDummy = new ImtqDummy(objects::IMTQ_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); auto* imtqDummy = new ImtqDummy(objects::IMTQ_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
imtqDummy->enableThermalModule(ThermalStateCfg()); imtqDummy->enableThermalModule(ThermalStateCfg());
imtqDummy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); imtqDummy->connectModeTreeParent(*imtqAssy);
if (cfg.addPowerDummies) { if (cfg.addPowerDummies) {
new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new PduDummy(objects::PDU1_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); new PduDummy(objects::PDU1_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
@ -203,19 +209,20 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio
tmp.second->connectModeTreeParent(satsystem::tcs::SUBSYSTEM); tmp.second->connectModeTreeParent(satsystem::tcs::SUBSYSTEM);
} }
} }
auto* camSwitcher = new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::NO_SWITCH); auto* camSwitcher =
camSwitcher->connectModeTreeParent(satsystem::pl::SUBSYSTEM); new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, pcdu::Switches::PDU2_CH8_PAYLOAD_CAMERA);
camSwitcher->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
auto* scexDummy = new ScexDummy(objects::SCEX, objects::DUMMY_COM_IF, comCookieDummy); auto* scexDummy = new ScexDummy(objects::SCEX, objects::DUMMY_COM_IF, comCookieDummy);
scexDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); scexDummy->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
auto* plPcduDummy = auto* plPcduDummy =
new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
plPcduDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); plPcduDummy->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
if (cfg.addPlocDummies) { if (cfg.addPlocDummies) {
auto* plocMpsocDummy = auto* plocMpsocDummy =
new PlocMpsocDummy(objects::PLOC_MPSOC_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); new PlocMpsocDummy(objects::PLOC_MPSOC_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
plocMpsocDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); plocMpsocDummy->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
auto* plocSupervisorDummy = new PlocSupervisorDummy(objects::PLOC_SUPERVISOR_HANDLER, auto* plocSupervisorDummy = new PlocSupervisorDummy(objects::PLOC_SUPERVISOR_HANDLER,
objects::DUMMY_COM_IF, comCookieDummy); objects::DUMMY_COM_IF, comCookieDummy);
plocSupervisorDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); plocSupervisorDummy->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
} }
} }

View File

@ -325,7 +325,7 @@ void ObjectFactory::createScexComponents(std::string uartDev, PowerSwitchIF* pwr
if (switchId) { if (switchId) {
scexHandler->setPowerSwitcher(*pwrSwitcher, switchId.value()); scexHandler->setPowerSwitcher(*pwrSwitcher, switchId.value());
} }
scexHandler->connectModeTreeParent(satsystem::pl::SUBSYSTEM); scexHandler->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
} }
AcsController* ObjectFactory::createAcsController(bool connectSubsystem) { AcsController* ObjectFactory::createAcsController(bool connectSubsystem) {

View File

@ -27,7 +27,6 @@ void scheduling::scheduleScexReader(TaskFactory& factory, PeriodicTaskIF*& scexR
} }
void scheduling::addMpsocSupvHandlers(PeriodicTaskIF* plTask) { void scheduling::addMpsocSupvHandlers(PeriodicTaskIF* plTask) {
#if OBSW_ADD_PLOC_SUPERVISOR == 1
plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::PERFORM_OPERATION); plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::PERFORM_OPERATION);
plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::SEND_WRITE); plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::SEND_WRITE);
plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::GET_WRITE); plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::GET_WRITE);
@ -35,9 +34,7 @@ void scheduling::addMpsocSupvHandlers(PeriodicTaskIF* plTask) {
plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::GET_READ); plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::GET_READ);
plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::SEND_READ); plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::SEND_READ);
plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::GET_READ); plTask->addComponent(objects::PLOC_SUPERVISOR_HANDLER, DeviceHandlerIF::GET_READ);
#endif
#if OBSW_ADD_PLOC_MPSOC == 1
plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::PERFORM_OPERATION); plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::PERFORM_OPERATION);
plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::SEND_WRITE); plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::SEND_WRITE);
plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::GET_WRITE); plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::GET_WRITE);
@ -45,7 +42,6 @@ void scheduling::addMpsocSupvHandlers(PeriodicTaskIF* plTask) {
plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::GET_READ); plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::GET_READ);
plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::SEND_READ); plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::SEND_READ);
plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::GET_READ); plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::GET_READ);
#endif
} }
void scheduling::scheduleScexDev(PeriodicTaskIF*& scexDevHandler) { void scheduling::scheduleScexDev(PeriodicTaskIF*& scexDevHandler) {

View File

@ -9,4 +9,5 @@ add_subdirectory(csp)
add_subdirectory(cfdp) add_subdirectory(cfdp)
add_subdirectory(config) add_subdirectory(config)
target_sources(${LIB_EIVE_MISSION} PRIVATE acsDefs.cpp trace.cpp) target_sources(${LIB_EIVE_MISSION} PRIVATE acsDefs.cpp payloadDefs.cpp
trace.cpp)

View File

@ -40,37 +40,38 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) {
// Length of a communication cycle // Length of a communication cycle
uint32_t length = thisSequence->getPeriodMs(); uint32_t length = thisSequence->getPeriodMs();
static_cast<void>(length); static_cast<void>(length);
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.2, thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.2,
DeviceHandlerIF::PERFORM_OPERATION); DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.2, DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.2, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.3, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.3, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.3, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.3, DeviceHandlerIF::GET_READ);
#endif
// These are actually part of another bus, but this works, so keep it like this for now // These are actually part of another bus, but this works, so keep it like this for now
#if OBSW_ADD_TMP_DEVICES == 1
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4,
DeviceHandlerIF::PERFORM_OPERATION); DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.45, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.45, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4,
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.5,
DeviceHandlerIF::PERFORM_OPERATION); DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.5, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.5, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.55, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.55, DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4,
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.6,
DeviceHandlerIF::PERFORM_OPERATION); DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.6,
DeviceHandlerIF::SEND_WRITE); DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.6,
DeviceHandlerIF::GET_WRITE); DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.65,
DeviceHandlerIF::SEND_READ); DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.65,
DeviceHandlerIF::GET_READ);
// damaged // damaged
/* /*
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4,
@ -83,16 +84,16 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) {
DeviceHandlerIF::SEND_READ); DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, DeviceHandlerIF::GET_READ);
*/ */
thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.8,
DeviceHandlerIF::PERFORM_OPERATION); DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.8,
DeviceHandlerIF::SEND_WRITE); DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.8,
DeviceHandlerIF::GET_WRITE); DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.85,
DeviceHandlerIF::SEND_READ); DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.85,
#endif DeviceHandlerIF::GET_READ);
static_cast<void>(length); static_cast<void>(length);
return thisSequence->checkSequence(); return thisSequence->checkSequence();
} }
@ -551,7 +552,6 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg
thisSequence->addSlot(objects::SPI_RTD_COM_IF, length * config::spiSched::SCHED_BLOCK_RTD_PERIOD, thisSequence->addSlot(objects::SPI_RTD_COM_IF, length * config::spiSched::SCHED_BLOCK_RTD_PERIOD,
0); 0);
#if OBSW_ADD_PL_PCDU == 1
thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD,
DeviceHandlerIF::PERFORM_OPERATION); DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD,
@ -562,7 +562,6 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg
DeviceHandlerIF::SEND_READ); DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD,
DeviceHandlerIF::GET_READ); DeviceHandlerIF::GET_READ);
#endif
#if OBSW_ADD_RAD_SENSORS == 1 #if OBSW_ADD_RAD_SENSORS == 1
/* Radiation sensor */ /* Radiation sensor */

32
mission/payloadDefs.cpp Normal file
View File

@ -0,0 +1,32 @@
#include "payloadDefs.h"
const char* payload::getModeStr(Mode mode) {
static const char* modeStr = "UNKNOWN";
switch (mode) {
case (Mode::CAM_STREAM): {
modeStr = "CAM STREAM";
break;
}
case (Mode::EARTH_OBSV): {
modeStr = "EARTH OBSV";
break;
}
case (Mode::MPSOC_STREAM): {
modeStr = "MPSOC STREAM";
break;
}
case (Mode::OFF): {
modeStr = "OFF";
break;
}
case (Mode::SUPV_ONLY): {
modeStr = "SUPV ONLY";
break;
}
case (Mode::SCEX): {
modeStr = "SCEX";
break;
}
}
return modeStr;
}

24
mission/payloadDefs.h Normal file
View File

@ -0,0 +1,24 @@
#pragma once
#include <cstdint>
namespace payload {
enum Mode {
OFF = 0,
SUPV_ONLY = 10,
MPSOC_STREAM = 11,
CAM_STREAM = 12,
EARTH_OBSV = 13,
SCEX = 14
};
extern const char* getModeStr(Mode mode);
namespace ploc {
enum Modes { OFF = 0, SUPV_ONLY = 1, MPSOC_ON = 2 };
}
} // namespace payload

View File

@ -1,5 +1,13 @@
#include "PayloadSubsystem.h" #include "PayloadSubsystem.h"
#include "mission/payloadDefs.h"
PayloadSubsystem::PayloadSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, PayloadSubsystem::PayloadSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
uint32_t maxNumberOfTables) uint32_t maxNumberOfTables)
: Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {} : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {}
void PayloadSubsystem::announceMode(bool recursive) {
const char* modeStr = payload::getModeStr(static_cast<payload::Mode>(mode));
sif::info << "PAYLOAD subsystem is now in " << modeStr << " mode" << std::endl;
Subsystem::announceMode(recursive);
}

View File

@ -9,6 +9,7 @@ class PayloadSubsystem : public Subsystem {
uint32_t maxNumberOfTables); uint32_t maxNumberOfTables);
private: private:
void announceMode(bool recursive) override;
}; };
#endif /* MISSION_SYSTEM_PAYLOADSUBSYSTEM_H_ */ #endif /* MISSION_SYSTEM_PAYLOADSUBSYSTEM_H_ */

View File

@ -1,5 +1,4 @@
#ifndef MISSION_SYSTEM_DEFINITIONS_H_ #pragma once
#define MISSION_SYSTEM_DEFINITIONS_H_
#include <fsfw/modes/ModeMessage.h> #include <fsfw/modes/ModeMessage.h>
@ -15,24 +14,3 @@ namespace duallane {
enum Submodes : Submode_t { A_SIDE = 0, B_SIDE = 1, DUAL_MODE = 2 }; enum Submodes : Submode_t { A_SIDE = 0, B_SIDE = 1, DUAL_MODE = 2 };
} // namespace duallane } // namespace duallane
namespace payload {
enum Mode {
OFF = 0,
SUPV_ONLY = 10,
MPSOC_STREAM = 11,
CAM_STREAM = 12,
EARTH_OBSV = 13,
SCEX = 14
};
namespace ploc {
enum Modes { OFF = 0, SUPV_ONLY = 1, MPSOC_ON = 2 };
}
} // namespace payload
#endif /* MISSION_SYSTEM_DEFINITIONS_H_ */

View File

@ -7,6 +7,7 @@
#include "eive/objects.h" #include "eive/objects.h"
#include "mission/devices/devicedefinitions/payloadPcduDefinitions.h" #include "mission/devices/devicedefinitions/payloadPcduDefinitions.h"
#include "mission/payloadDefs.h"
#include "mission/system/objects/PayloadSubsystem.h" #include "mission/system/objects/PayloadSubsystem.h"
#include "mission/system/objects/definitions.h" #include "mission/system/objects/definitions.h"
#include "util.h" #include "util.h"
@ -20,7 +21,7 @@ void initEarthObsvSequence(Subsystem& ss, ModeListEntry& eh);
void initScexSequence(Subsystem& ss, ModeListEntry& eh); void initScexSequence(Subsystem& ss, ModeListEntry& eh);
} // namespace } // namespace
PayloadSubsystem satsystem::pl::SUBSYSTEM = PayloadSubsystem(objects::PL_SUBSYSTEM, 12, 24); PayloadSubsystem satsystem::payload::SUBSYSTEM = PayloadSubsystem(objects::PL_SUBSYSTEM, 12, 24);
const auto check = subsystem::checkInsert; const auto check = subsystem::checkInsert;
static const auto OFF = HasModesIF::MODE_OFF; static const auto OFF = HasModesIF::MODE_OFF;
@ -77,7 +78,7 @@ auto PL_TABLE_SCEX_TGT =
auto PL_TABLE_SCEX_TRANS_0 = auto PL_TABLE_SCEX_TRANS_0 =
std::make_pair((payload::Mode::SCEX << 24) | 2, FixedArrayList<ModeListEntry, 1>()); std::make_pair((payload::Mode::SCEX << 24) | 2, FixedArrayList<ModeListEntry, 1>());
Subsystem& satsystem::pl::init() { Subsystem& satsystem::payload::init() {
ModeListEntry entry; ModeListEntry entry;
initOffSequence(SUBSYSTEM, entry); initOffSequence(SUBSYSTEM, entry);
initPlMpsocStreamSequence(SUBSYSTEM, entry); initPlMpsocStreamSequence(SUBSYSTEM, entry);

View File

@ -5,12 +5,12 @@
namespace satsystem { namespace satsystem {
namespace pl { namespace payload {
extern PayloadSubsystem SUBSYSTEM; extern PayloadSubsystem SUBSYSTEM;
Subsystem& init(); Subsystem& init();
} // namespace pl } // namespace payload
} // namespace satsystem } // namespace satsystem

View File

@ -26,7 +26,7 @@ static const auto NML = DeviceHandlerIF::MODE_NORMAL;
void satsystem::init() { void satsystem::init() {
auto& acsSubsystem = acs::init(); auto& acsSubsystem = acs::init();
acsSubsystem.connectModeTreeParent(EIVE_SYSTEM); acsSubsystem.connectModeTreeParent(EIVE_SYSTEM);
auto& payloadSubsystem = pl::init(); auto& payloadSubsystem = payload::init();
payloadSubsystem.connectModeTreeParent(EIVE_SYSTEM); payloadSubsystem.connectModeTreeParent(EIVE_SYSTEM);
auto& tcsSubsystem = tcs::init(); auto& tcsSubsystem = tcs::init();
tcsSubsystem.connectModeTreeParent(EIVE_SYSTEM); tcsSubsystem.connectModeTreeParent(EIVE_SYSTEM);
@ -87,8 +87,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) {
iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TGT.second); iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TGT.second);
check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TGT.first, &EIVE_TABLE_SAFE_TGT.second)), ctxc); check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TGT.first, &EIVE_TABLE_SAFE_TGT.second)), ctxc);
// Build SAFE transition 0. Two transitions to reduce number of consecutive events and because // Build SAFE transition 0.
// consecutive commanding of TCS and ACS can lead to SPI issues.
iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_SAFE_TRANS_0.second); iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_SAFE_TRANS_0.second);
iht(objects::COM_SUBSYSTEM, com::RX_ONLY, 0, EIVE_TABLE_SAFE_TRANS_0.second); iht(objects::COM_SUBSYSTEM, com::RX_ONLY, 0, EIVE_TABLE_SAFE_TRANS_0.second);
iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TRANS_0.second); iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TRANS_0.second);