v1.16.0 #323

Merged
muellerr merged 223 commits from develop into main 2022-11-18 14:23:24 +01:00
10 changed files with 40 additions and 43 deletions
Showing only changes of commit 66c6f08447 - Show all commits

View File

@ -340,8 +340,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
SpiCookie* spiCookie = SpiCookie* spiCookie =
new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE, new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE,
spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
auto mgmLis3Handler0 = new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, auto mgmLis3Handler0 = new MgmLIS3MDLHandler(
spiCookie, spi::LIS3_TRANSITION_DELAY); objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER); fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER);
mgmLis3Handler0->setCustomFdir(fdir); mgmLis3Handler0->setCustomFdir(fdir);
assemblyChildren.push_back(*mgmLis3Handler0); assemblyChildren.push_back(*mgmLis3Handler0);
@ -371,8 +371,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
spiCookie = spiCookie =
new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE, new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE,
spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
auto* mgmLis3Handler2 = new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, auto* mgmLis3Handler2 = new MgmLIS3MDLHandler(
spiCookie, spi::LIS3_TRANSITION_DELAY); objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER); fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER);
mgmLis3Handler2->setCustomFdir(fdir); mgmLis3Handler2->setCustomFdir(fdir);
assemblyChildren.push_back(*mgmLis3Handler2); assemblyChildren.push_back(*mgmLis3Handler2);
@ -386,8 +386,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
spiCookie = spiCookie =
new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, RM3100::MAX_BUFFER_SIZE, new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, RM3100::MAX_BUFFER_SIZE,
spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
auto* mgmRm3100Handler3 = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, auto* mgmRm3100Handler3 =
spiCookie, spi::RM3100_TRANSITION_DELAY); new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie,
spi::RM3100_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER); fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER);
mgmRm3100Handler3->setCustomFdir(fdir); mgmRm3100Handler3->setCustomFdir(fdir);
assemblyChildren.push_back(*mgmRm3100Handler3); assemblyChildren.push_back(*mgmRm3100Handler3);
@ -447,8 +448,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
// Gyro 3 Side B // Gyro 3 Side B
spiCookie = new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, L3GD20H::MAX_BUFFER_SIZE, spiCookie = new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, L3GD20H::MAX_BUFFER_SIZE,
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
auto gyroL3gHandler3 = new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF, auto gyroL3gHandler3 = new GyroHandlerL3GD20H(
spiCookie, spi::L3G_TRANSITION_DELAY); objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY);
fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER); fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER);
gyroL3gHandler3->setCustomFdir(fdir); gyroL3gHandler3->setCustomFdir(fdir);
assemblyChildren.push_back(*gyroL3gHandler3); assemblyChildren.push_back(*gyroL3gHandler3);
@ -477,9 +478,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
static_cast<void>(acsAss); static_cast<void>(acsAss);
for (auto& assChild : assemblyChildren) { for (auto& assChild : assemblyChildren) {
ReturnValue_t result = assChild.get().connectModeTreeParent(*acsAss); ReturnValue_t result = assChild.get().connectModeTreeParent(*acsAss);
if(result != returnvalue::OK) { if (result != returnvalue::OK) {
sif::error << "Connecting assembly for ACS board component " << sif::error << "Connecting assembly for ACS board component " << assChild.get().getObjectId()
assChild.get().getObjectId() << " failed" << std::endl; << " failed" << std::endl;
} }
} }
gpsCtrl->connectModeTreeParent(*acsAss); gpsCtrl->connectModeTreeParent(*acsAss);
@ -693,13 +694,13 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF,
} }
RwHelper rwHelper(rwIds); RwHelper rwHelper(rwIds);
auto* rwAss = new RwAssembly(objects::RW_ASS, pwrSwitcher, auto* rwAss =
pcdu::Switches::PDU2_CH2_RW_5V, rwHelper); new RwAssembly(objects::RW_ASS, pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rwHelper);
for (uint8_t idx = 0; idx < rws.size(); idx++) { for (uint8_t idx = 0; idx < rws.size(); idx++) {
ReturnValue_t result = rws[idx]->connectModeTreeParent(*rwAss); ReturnValue_t result = rws[idx]->connectModeTreeParent(*rwAss);
if(result != returnvalue::OK) { if (result != returnvalue::OK) {
sif::error << "Connecting RW " << static_cast<int>(idx) << " to RW assembly failed" sif::error << "Connecting RW " << static_cast<int>(idx) << " to RW assembly failed"
<< std::endl; << std::endl;
} }
} }
#endif /* OBSW_ADD_RW == 1 */ #endif /* OBSW_ADD_RW == 1 */

View File

@ -64,6 +64,6 @@ void ObjectFactory::produce(void* args) {
createMiscComponents(); createMiscComponents();
createThermalController(); createThermalController();
createAcsController(); createAcsController(true);
satsystem::initAcsSubsystem(objects::NO_OBJECT); satsystem::initAcsSubsystem(objects::NO_OBJECT);
} }

View File

@ -1,6 +1,7 @@
#include "ObjectFactory.h" #include "ObjectFactory.h"
#include <fsfw/power/PowerSwitchIF.h> #include <fsfw/power/PowerSwitchIF.h>
#include <fsfw/subsystem/Subsystem.h>
#include <fsfw_hal/common/gpio/GpioCookie.h> #include <fsfw_hal/common/gpio/GpioCookie.h>
#include <fsfw_hal/common/gpio/GpioIF.h> #include <fsfw_hal/common/gpio/GpioIF.h>
#include <fsfw_hal/common/gpio/gpioDefinitions.h> #include <fsfw_hal/common/gpio/gpioDefinitions.h>
@ -22,6 +23,7 @@
#include "devConf.h" #include "devConf.h"
#include "devices/addresses.h" #include "devices/addresses.h"
#include "devices/gpioIds.h" #include "devices/gpioIds.h"
#include "mission/system/tree/acsModeTree.h"
void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF,
PowerSwitchIF* pwrSwitcher, std::string spiDev) { PowerSwitchIF* pwrSwitcher, std::string spiDev) {
@ -168,9 +170,9 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo
for (auto& sus : susHandlers) { for (auto& sus : susHandlers) {
if (sus != nullptr) { if (sus != nullptr) {
ReturnValue_t result = sus->connectModeTreeParent(*susAss); ReturnValue_t result = sus->connectModeTreeParent(*susAss);
if(result != returnvalue::OK) { if (result != returnvalue::OK) {
sif::error << "Connecting SUS " << sus->getObjectId() << sif::error << "Connecting SUS " << sus->getObjectId() << " to SUS assembly failed"
" to SUS assembly failed" << std::endl; << std::endl;
} }
#if OBSW_TEST_SUS == 1 #if OBSW_TEST_SUS == 1
sus->setStartUpImmediately(); sus->setStartUpImmediately();
@ -299,9 +301,9 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
new Max31865EiveHandler(rtdInfos[idx].first, objects::SPI_RTD_COM_IF, rtdLowLevelCookie); new Max31865EiveHandler(rtdInfos[idx].first, objects::SPI_RTD_COM_IF, rtdLowLevelCookie);
rtds[idx]->setDeviceInfo(idx, rtdInfos[idx].second); rtds[idx]->setDeviceInfo(idx, rtdInfos[idx].second);
ReturnValue_t result = rtds[idx]->connectModeTreeParent(*tcsBoardAss); ReturnValue_t result = rtds[idx]->connectModeTreeParent(*tcsBoardAss);
if(result != returnvalue::OK) { if (result != returnvalue::OK) {
sif::error << "Connecting RTD " << static_cast<int>(idx) << " to RTD Assembly failed" sif::error << "Connecting RTD " << static_cast<int>(idx) << " to RTD Assembly failed"
<< std::endl; << std::endl;
} }
rtdFdir = new RtdFdir(rtdInfos[idx].first); rtdFdir = new RtdFdir(rtdInfos[idx].first);
rtds[idx]->setCustomFdir(rtdFdir); rtds[idx]->setCustomFdir(rtdFdir);
@ -321,8 +323,12 @@ void ObjectFactory::createThermalController() {
new ThermalController(objects::THERMAL_CONTROLLER); new ThermalController(objects::THERMAL_CONTROLLER);
} }
AcsController* ObjectFactory::createAcsController() { AcsController* ObjectFactory::createAcsController(bool connectSubsystem) {
return new AcsController(objects::ACS_CONTROLLER); auto acsCtrl = new AcsController(objects::ACS_CONTROLLER);
if (connectSubsystem) {
acsCtrl->connectModeTreeParent(satsystem::ACS_SUBSYSTEM);
}
return acsCtrl;
} }
void ObjectFactory::gpioChecker(ReturnValue_t result, std::string output) { void ObjectFactory::gpioChecker(ReturnValue_t result, std::string output) {

View File

@ -20,6 +20,6 @@ void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* p
void gpioChecker(ReturnValue_t result, std::string output); void gpioChecker(ReturnValue_t result, std::string output);
void createThermalController(); void createThermalController();
AcsController* createAcsController(); AcsController* createAcsController(bool connectSubsystem);
} // namespace ObjectFactory } // namespace ObjectFactory

View File

@ -18,9 +18,7 @@
GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId, GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId,
bool debugHyperionGps) bool debugHyperionGps)
: ExtendedControllerBase(objectId), : ExtendedControllerBase(objectId), gpsSet(this), debugHyperionGps(debugHyperionGps) {
gpsSet(this),
debugHyperionGps(debugHyperionGps) {
timeUpdateCd.resetTimer(); timeUpdateCd.resetTimer();
} }

View File

@ -274,6 +274,4 @@ void AcsBoardAssembly::refreshHelperModes() {
} }
} }
ReturnValue_t AcsBoardAssembly::initialize() { ReturnValue_t AcsBoardAssembly::initialize() { return AssemblyBase::initialize(); }
return AssemblyBase::initialize();
}

View File

@ -1,7 +1,7 @@
#include "RwAssembly.h" #include "RwAssembly.h"
RwAssembly::RwAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, RwAssembly::RwAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power::Switch_t switcher,
power::Switch_t switcher, RwHelper helper) RwHelper helper)
: AssemblyBase(objectId), helper(helper), switcher(pwrSwitcher, switcher) { : AssemblyBase(objectId), helper(helper), switcher(pwrSwitcher, switcher) {
ModeListEntry entry; ModeListEntry entry;
for (uint8_t idx = 0; idx < NUMBER_RWS; idx++) { for (uint8_t idx = 0; idx < NUMBER_RWS; idx++) {
@ -167,9 +167,7 @@ bool RwAssembly::isUseable(object_id_t object, Mode_t mode) {
return false; return false;
} }
ReturnValue_t RwAssembly::initialize() { ReturnValue_t RwAssembly::initialize() { return SubsystemBase::initialize(); }
return SubsystemBase::initialize();
}
void RwAssembly::handleModeTransitionFailed(ReturnValue_t result) { void RwAssembly::handleModeTransitionFailed(ReturnValue_t result) {
if (targetMode == MODE_OFF) { if (targetMode == MODE_OFF) {

View File

@ -12,8 +12,8 @@ struct RwHelper {
class RwAssembly : public AssemblyBase { class RwAssembly : public AssemblyBase {
public: public:
RwAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, RwAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power::Switch_t switcher,
power::Switch_t switcher, RwHelper helper); RwHelper helper);
private: private:
static constexpr uint8_t NUMBER_RWS = 4; static constexpr uint8_t NUMBER_RWS = 4;

View File

@ -120,9 +120,7 @@ ReturnValue_t SusAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_t wan
return returnvalue::OK; return returnvalue::OK;
} }
ReturnValue_t SusAssembly::initialize() { ReturnValue_t SusAssembly::initialize() { return AssemblyBase::initialize(); }
return AssemblyBase::initialize();
}
bool SusAssembly::isUseable(object_id_t object, Mode_t mode) { bool SusAssembly::isUseable(object_id_t object, Mode_t mode) {
if (healthHelper.healthTable->isFaulty(object)) { if (healthHelper.healthTable->isFaulty(object)) {

View File

@ -89,9 +89,7 @@ ReturnValue_t TcsBoardAssembly::isModeCombinationValid(Mode_t mode, Submode_t su
return HasModesIF::INVALID_MODE; return HasModesIF::INVALID_MODE;
} }
ReturnValue_t TcsBoardAssembly::initialize() { ReturnValue_t TcsBoardAssembly::initialize() { return AssemblyBase::initialize(); }
return AssemblyBase::initialize();
}
void TcsBoardAssembly::startTransition(Mode_t mode, Submode_t submode) { void TcsBoardAssembly::startTransition(Mode_t mode, Submode_t submode) {
if (mode != MODE_OFF) { if (mode != MODE_OFF) {