connect parent
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2023-04-03 18:02:45 +02:00
parent e3677f89fe
commit 1610bdecf9
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
8 changed files with 37 additions and 14 deletions

View File

@ -518,9 +518,10 @@ void ObjectFactory::createAcsBoardComponents(SpiComIF& spiComIF, LinuxLibgpioIF*
new GpsHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps);
gpsCtrl->setResetPinTriggerFunction(gps::triggerGpioResetPin, &RESET_ARGS_GNSS);
new HealthDevice(objects::GPS_0_HEALTH_DEV, objects::ACS_BOARD_ASS);
new HealthDevice(objects::GPS_1_HEALTH_DEV, objects::ACS_BOARD_ASS);
ObjectFactory::createAcsBoardAssy(pwrSwitcher, assemblyChildren, gpsCtrl, gpioComIF);
auto* healthDevGps0 = new HealthDevice(objects::GPS_0_HEALTH_DEV, objects::ACS_BOARD_ASS);
auto* healthDevGps1 = new HealthDevice(objects::GPS_1_HEALTH_DEV, objects::ACS_BOARD_ASS);
ObjectFactory::createAcsBoardAssy(pwrSwitcher, assemblyChildren, *healthDevGps0, *healthDevGps1,
gpsCtrl, gpioComIF);
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */
}

View File

@ -99,10 +99,11 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio
new GyroAdisDummy(objects::GYRO_2_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
assemblyDhbs[7] =
new GyroL3GD20Dummy(objects::GYRO_3_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
new HealthDevice(objects::GPS_0_HEALTH_DEV, objects::ACS_BOARD_ASS);
new HealthDevice(objects::GPS_1_HEALTH_DEV, objects::ACS_BOARD_ASS);
auto* gps0HealthDev = new HealthDevice(objects::GPS_0_HEALTH_DEV, objects::ACS_BOARD_ASS);
auto* gps1HealthDev = new HealthDevice(objects::GPS_1_HEALTH_DEV, objects::ACS_BOARD_ASS);
auto* gpsCtrl = new GpsCtrlDummy(objects::GPS_CONTROLLER);
ObjectFactory::createAcsBoardAssy(pwrSwitcher, assemblyDhbs, gpsCtrl, gpioIF);
ObjectFactory::createAcsBoardAssy(pwrSwitcher, assemblyDhbs, *gps0HealthDev, *gps1HealthDev,
gpsCtrl, gpioIF);
}
if (cfg.addSusDummies) {

2
fsfw

@ -1 +1 @@
Subproject commit e2e87b149d91c51196c76d6b84243fce1c77a28a
Subproject commit 1e3c89b672e17700a9b50a312d9df29c54977685

View File

@ -343,6 +343,7 @@ void ObjectFactory::createSusAssy(PowerSwitchIF& pwrSwitcher,
void ObjectFactory::createAcsBoardAssy(PowerSwitchIF& pwrSwitcher,
std::array<DeviceHandlerBase*, 8> assemblyDhbs,
HealthDevice& gps0HealthDev, HealthDevice& gps1HealthDev,
ExtendedControllerBase* gpsCtrl, GpioIF* gpioComIF) {
AcsBoardHelper acsBoardHelper = AcsBoardHelper(
objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER,
@ -359,6 +360,8 @@ void ObjectFactory::createAcsBoardAssy(PowerSwitchIF& pwrSwitcher,
}
}
gpsCtrl->connectModeTreeParent(*acsAss);
gps0HealthDev.setParentQueue(acsAss->getCommandQueue());
gps1HealthDev.setParentQueue(acsAss->getCommandQueue());
acsAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);
}

View File

@ -2,6 +2,7 @@
#define MISSION_CORE_GENERICFACTORY_H_
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
#include <fsfw/devicehandlers/HealthDevice.h>
#include <mission/memory/SdCardMountedIF.h>
#include <mission/persistentTmStoreDefs.h>
#include <mission/tcs/Max31865Definitions.h>
@ -53,6 +54,7 @@ void createRwAssy(PowerSwitchIF& pwrSwitcher, power::Switch_t theSwitch,
std::array<DeviceHandlerBase*, 4> rws, std::array<object_id_t, 4> rwIds);
void createSusAssy(PowerSwitchIF& pwrSwitcher, std::array<DeviceHandlerBase*, 12> suses);
void createAcsBoardAssy(PowerSwitchIF& pwrSwitcher, std::array<DeviceHandlerBase*, 8> assemblyDhbs,
HealthDevice& gps0HealthDev, HealthDevice& gps1HealthDev,
ExtendedControllerBase* gpsCtrl, GpioIF* gpioComIF);
TcsBoardAssembly* createTcsBoardAssy(PowerSwitchIF& pwrSwitcher);

View File

@ -78,7 +78,7 @@ ReturnValue_t AcsBoardAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_
if ((helper.gyro0SideAMode != wantedMode and helper.gyro1SideAMode != wantedMode) or
(helper.mgm0SideAMode != wantedMode and helper.mgm1SideAMode != wantedMode) or
(helper.gpsMode != MODE_ON) or
(healthHelper.healthTable->getHealth(helper.healthDevGps0) == FAULTY)) {
gps0HealthDevFaulty()) {
return NOT_ENOUGH_CHILDREN_IN_CORRECT_STATE;
}
return returnvalue::OK;
@ -86,7 +86,7 @@ ReturnValue_t AcsBoardAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_
if ((helper.gyro2SideBMode != wantedMode and helper.gyro3SideBMode != wantedMode) or
(helper.mgm2SideBMode != wantedMode and helper.mgm3SideBMode != wantedMode) or
(helper.gpsMode != MODE_ON) or
(healthHelper.healthTable->getHealth(helper.healthDevGps1) == FAULTY)) {
gps1HealthDevFaulty()) {
return NOT_ENOUGH_CHILDREN_IN_CORRECT_STATE;
}
return returnvalue::OK;
@ -296,15 +296,13 @@ void AcsBoardAssembly::handleChildrenLostMode(ReturnValue_t result) {
// Special handling to account for GPS devices being faulty. If the GPS device on the other
// side is marked faulty, directly to to dual side.
if (submode == Submodes::A_SIDE) {
if (healthHelper.healthTable->getHealth(helper.healthDevGps1) == FAULTY or
healthHelper.healthTable->getHealth(helper.healthDevGps1) == PERMANENT_FAULTY) {
if (gps0HealthDevFaulty()) {
triggerEvent(DIRECT_TRANSITION_TO_DUAL_OTHER_GPS_FAULTY, submode, 0);
startTransition(mode, Submodes::DUAL_MODE);
return;
}
} else if (submode == Submodes::B_SIDE) {
if (healthHelper.healthTable->getHealth(helper.healthDevGps0) == FAULTY or
healthHelper.healthTable->getHealth(helper.healthDevGps0) == PERMANENT_FAULTY) {
if (gps1HealthDevFaulty()) {
triggerEvent(DIRECT_TRANSITION_TO_DUAL_OTHER_GPS_FAULTY, submode, 0);
startTransition(mode, Submodes::DUAL_MODE);
return;
@ -312,3 +310,19 @@ void AcsBoardAssembly::handleChildrenLostMode(ReturnValue_t result) {
}
DualLaneAssemblyBase::handleChildrenLostMode(result);
}
bool AcsBoardAssembly::gps0HealthDevFaulty() const {
auto health = healthHelper.healthTable->getHealth(helper.healthDevGps0);
if (health == FAULTY or health == PERMANENT_FAULTY) {
return true;
}
return false;
}
bool AcsBoardAssembly::gps1HealthDevFaulty() const {
auto health = healthHelper.healthTable->getHealth(helper.healthDevGps1);
if (health == FAULTY or health == PERMANENT_FAULTY) {
return true;
}
return false;
}

View File

@ -133,6 +133,8 @@ class AcsBoardAssembly : public DualLaneAssemblyBase {
ReturnValue_t handleNormalOrOnModeCmd(Mode_t mode, Submode_t submode);
ReturnValue_t checkAndHandleHealthStates(Mode_t deviceMode, Submode_t deviceSubmode);
void refreshHelperModes();
bool gps0HealthDevFaulty() const;
bool gps1HealthDevFaulty() const;
};
#endif /* MISSION_SYSTEM_ACSBOARDASSEMBLY_H_ */

2
tmtc

@ -1 +1 @@
Subproject commit b72dad49a9c05a37c094a22d5fdaa15643b5ca7f
Subproject commit f899d169b2a6f7454b2f425dfa2713acf029e016