ACS Subsystem Init #228
@ -31,10 +31,7 @@ xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP;
|
||||
xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY;
|
||||
|
||||
CoreController::CoreController(object_id_t objectId)
|
||||
: ExtendedControllerBase(objectId, objects::NO_OBJECT, 5),
|
||||
opDivider5(5),
|
||||
opDivider10(10),
|
||||
hkSet(this) {
|
||||
: ExtendedControllerBase(objectId, 5), opDivider5(5), opDivider10(10), hkSet(this) {
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
try {
|
||||
result = initWatchdogFifo();
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include <mission/system/objects/AcsSubsystem.h>
|
||||
#include "ObjectFactory.h"
|
||||
|
||||
#include <mission/system/objects/AcsSubsystem.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "bsp_q7s/boardtest/Q7STestTask.h"
|
||||
#include "bsp_q7s/callbacks/gnssCallback.h"
|
||||
@ -35,7 +36,6 @@
|
||||
#include "linux/obc/PdecHandler.h"
|
||||
#include "linux/obc/Ptme.h"
|
||||
#include "linux/obc/PtmeConfig.h"
|
||||
|
||||
#include "mission/csp/CspCookie.h"
|
||||
#include "mission/system/fdir/AcsBoardFdir.h"
|
||||
#include "mission/system/fdir/GomspacePowerFdir.h"
|
||||
@ -46,7 +46,6 @@
|
||||
#include "mission/system/objects/SusAssembly.h"
|
||||
#include "mission/system/objects/TcsBoardAssembly.h"
|
||||
#include "mission/system/tree/acsModeTree.h"
|
||||
|
||||
#include "tmtc/pusIds.h"
|
||||
#if OBSW_TEST_LIBGPIOD == 1
|
||||
#include "linux/boardtest/LibgpiodTest.h"
|
||||
@ -234,7 +233,7 @@ void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) {
|
||||
}
|
||||
|
||||
void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
|
||||
PowerSwitchIF* pwrSwitcher, object_id_t acsSubsystemId) {
|
||||
PowerSwitchIF* pwrSwitcher) {
|
||||
using namespace gpio;
|
||||
GpioCookie* gpioCookieAcsBoard = new GpioCookie();
|
||||
std::vector<std::reference_wrapper<DeviceHandlerBase>> assemblyChildren;
|
||||
@ -475,11 +474,12 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER,
|
||||
objects::MGM_3_RM3100_HANDLER, objects::GYRO_0_ADIS_HANDLER, objects::GYRO_1_L3G_HANDLER,
|
||||
objects::GYRO_2_ADIS_HANDLER, objects::GYRO_3_L3G_HANDLER, objects::GPS_CONTROLLER);
|
||||
auto acsAss = new AcsBoardAssembly(objects::ACS_BOARD_ASS, acsSubsystemId, pwrSwitcher,
|
||||
acsBoardHelper, gpioComIF);
|
||||
auto acsAss =
|
||||
new AcsBoardAssembly(objects::ACS_BOARD_ASS, pwrSwitcher, acsBoardHelper, gpioComIF);
|
||||
acsAss->connectModeTreeParent(satsystem::ACS_SUBSYSTEM);
|
||||
static_cast<void>(acsAss);
|
||||
auto assQueueId = acsAss->getCommandQueue();
|
||||
for (auto& assChild: assemblyChildren) {
|
||||
for (auto& assChild : assemblyChildren) {
|
||||
assChild.get().setParentQueue(assQueueId);
|
||||
}
|
||||
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */
|
||||
|
@ -28,7 +28,7 @@ void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
||||
void createTmpComponents();
|
||||
void createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
|
||||
void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
|
||||
PowerSwitchIF* pwrSwitcher, object_id_t acsSubsystemId);
|
||||
PowerSwitchIF* pwrSwitcher);
|
||||
void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable);
|
||||
void createImtqComponents(PowerSwitchIF* pwrSwitcher, object_id_t subsystemId);
|
||||
void createBpxBatteryComponent();
|
||||
|
@ -31,7 +31,7 @@ void ObjectFactory::produce(void* args) {
|
||||
createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV);
|
||||
|
||||
#if OBSW_ADD_ACS_BOARD == 1
|
||||
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher, objects::ACS_SUBSYSTEM);
|
||||
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
|
||||
#endif
|
||||
createHeaterComponents(gpioComIF, pwrSwitcher, healthTable);
|
||||
createSolarArrayDeploymentComponents();
|
||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
||||
Subproject commit f78344b8fba94158f3703ee1caa070bf97a04d0a
|
||||
Subproject commit f824004897e29bf90c2b02578625ba3d51786fdf
|
@ -163,8 +163,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo
|
||||
objects::SUS_8_R_LOC_XBYBZB_PT_YB, objects::SUS_9_R_LOC_XBYBZB_PT_YF,
|
||||
objects::SUS_10_N_LOC_XMYBZF_PT_ZF, objects::SUS_11_R_LOC_XBYMZB_PT_ZB};
|
||||
SusAssHelper susAssHelper = SusAssHelper(susIds);
|
||||
auto susAss =
|
||||
new SusAssembly(objects::SUS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, susAssHelper);
|
||||
auto susAss = new SusAssembly(objects::SUS_BOARD_ASS, pwrSwitcher, susAssHelper);
|
||||
static_cast<void>(susAss);
|
||||
for (auto& sus : susHandlers) {
|
||||
if (sus != nullptr) {
|
||||
@ -281,9 +280,8 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
|
||||
RtdFdir* rtdFdir = nullptr;
|
||||
|
||||
TcsBoardHelper helper(rtdInfos);
|
||||
TcsBoardAssembly* tcsBoardAss =
|
||||
new TcsBoardAssembly(objects::TCS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher,
|
||||
pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper);
|
||||
TcsBoardAssembly* tcsBoardAss = new TcsBoardAssembly(
|
||||
objects::TCS_BOARD_ASS, pwrSwitcher, pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper);
|
||||
static_cast<void>(tcsBoardAss);
|
||||
// Create special low level reader communication interface
|
||||
new Max31865RtdReader(objects::SPI_RTD_COM_IF, comIF, gpioComIF);
|
||||
@ -312,10 +310,12 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
|
||||
}
|
||||
|
||||
void ObjectFactory::createThermalController() {
|
||||
new ThermalController(objects::THERMAL_CONTROLLER, objects::NO_OBJECT);
|
||||
new ThermalController(objects::THERMAL_CONTROLLER);
|
||||
}
|
||||
|
||||
void ObjectFactory::createAcsController() { new AcsController(objects::ACS_CONTROLLER); }
|
||||
AcsController* ObjectFactory::createAcsController() {
|
||||
return new AcsController(objects::ACS_CONTROLLER);
|
||||
}
|
||||
|
||||
void ObjectFactory::gpioChecker(ReturnValue_t result, std::string output) {
|
||||
if (result != returnvalue::OK) {
|
||||
|
@ -8,6 +8,7 @@
|
||||
class GpioIF;
|
||||
class SpiComIF;
|
||||
class PowerSwitchIF;
|
||||
class AcsController;
|
||||
|
||||
namespace ObjectFactory {
|
||||
|
||||
@ -19,6 +20,6 @@ void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* p
|
||||
void gpioChecker(ReturnValue_t result, std::string output);
|
||||
|
||||
void createThermalController();
|
||||
void createAcsController();
|
||||
AcsController* createAcsController();
|
||||
|
||||
} // namespace ObjectFactory
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <fsfw/datapool/PoolReadGuard.h>
|
||||
|
||||
AcsController::AcsController(object_id_t objectId)
|
||||
: ExtendedControllerBase(objectId, objects::NO_OBJECT), mgmData(this) {}
|
||||
: ExtendedControllerBase(objectId), mgmData(this) {}
|
||||
|
||||
ReturnValue_t AcsController::handleCommandMessage(CommandMessage *message) {
|
||||
return returnvalue::OK;
|
||||
|
@ -14,8 +14,8 @@
|
||||
#include <mission/devices/devicedefinitions/payloadPcduDefinitions.h>
|
||||
#include <objects/systemObjectList.h>
|
||||
|
||||
ThermalController::ThermalController(object_id_t objectId, object_id_t parentId)
|
||||
: ExtendedControllerBase(objectId, parentId),
|
||||
ThermalController::ThermalController(object_id_t objectId)
|
||||
: ExtendedControllerBase(objectId),
|
||||
sensorTemperatures(this),
|
||||
susTemperatures(this),
|
||||
deviceTemperatures(this),
|
||||
|
@ -12,7 +12,7 @@ class ThermalController : public ExtendedControllerBase {
|
||||
public:
|
||||
static const uint16_t INVALID_TEMPERATURE = 999;
|
||||
|
||||
ThermalController(object_id_t objectId, object_id_t parentId);
|
||||
ThermalController(object_id_t objectId);
|
||||
|
||||
ReturnValue_t initialize() override;
|
||||
|
||||
|
@ -6,11 +6,10 @@
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
|
||||
AcsBoardAssembly::AcsBoardAssembly(object_id_t objectId, object_id_t parentId,
|
||||
PowerSwitchIF* switcher, AcsBoardHelper helper, GpioIF* gpioIF)
|
||||
: DualLaneAssemblyBase(objectId, parentId, switcher, SWITCH_A, SWITCH_B,
|
||||
POWER_STATE_MACHINE_TIMEOUT, SIDE_SWITCH_TRANSITION_NOT_ALLOWED,
|
||||
TRANSITION_OTHER_SIDE_FAILED),
|
||||
AcsBoardAssembly::AcsBoardAssembly(object_id_t objectId, PowerSwitchIF* switcher,
|
||||
AcsBoardHelper helper, GpioIF* gpioIF)
|
||||
: DualLaneAssemblyBase(objectId, switcher, SWITCH_A, SWITCH_B, POWER_STATE_MACHINE_TIMEOUT,
|
||||
SIDE_SWITCH_TRANSITION_NOT_ALLOWED, TRANSITION_OTHER_SIDE_FAILED),
|
||||
helper(helper),
|
||||
gpioIF(gpioIF) {
|
||||
if (switcher == nullptr) {
|
||||
@ -276,41 +275,42 @@ void AcsBoardAssembly::refreshHelperModes() {
|
||||
}
|
||||
|
||||
ReturnValue_t AcsBoardAssembly::initialize() {
|
||||
ReturnValue_t result = registerChild(helper.gyro0AdisIdSideA);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = registerChild(helper.gyro1L3gIdSideA);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = registerChild(helper.gyro2AdisIdSideB);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = registerChild(helper.gyro3L3gIdSideB);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = registerChild(helper.mgm0Lis3IdSideA);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = registerChild(helper.mgm1Rm3100IdSideA);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = registerChild(helper.mgm2Lis3IdSideB);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = registerChild(helper.mgm3Rm3100IdSideB);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = registerChild(helper.gpsId);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
// TODO: Fix this
|
||||
// ReturnValue_t result = registerChild(helper.gyro0AdisIdSideA);
|
||||
// if (result != returnvalue::OK) {
|
||||
// return result;
|
||||
// }
|
||||
// result = registerChild(helper.gyro1L3gIdSideA);
|
||||
// if (result != returnvalue::OK) {
|
||||
// return result;
|
||||
// }
|
||||
// result = registerChild(helper.gyro2AdisIdSideB);
|
||||
// if (result != returnvalue::OK) {
|
||||
// return result;
|
||||
// }
|
||||
// result = registerChild(helper.gyro3L3gIdSideB);
|
||||
// if (result != returnvalue::OK) {
|
||||
// return result;
|
||||
// }
|
||||
// result = registerChild(helper.mgm0Lis3IdSideA);
|
||||
// if (result != returnvalue::OK) {
|
||||
// return result;
|
||||
// }
|
||||
// result = registerChild(helper.mgm1Rm3100IdSideA);
|
||||
// if (result != returnvalue::OK) {
|
||||
// return result;
|
||||
// }
|
||||
// result = registerChild(helper.mgm2Lis3IdSideB);
|
||||
// if (result != returnvalue::OK) {
|
||||
// return result;
|
||||
// }
|
||||
// result = registerChild(helper.mgm3Rm3100IdSideB);
|
||||
// if (result != returnvalue::OK) {
|
||||
// return result;
|
||||
// }
|
||||
// result = registerChild(helper.gpsId);
|
||||
// if (result != returnvalue::OK) {
|
||||
// return result;
|
||||
// }
|
||||
return AssemblyBase::initialize();
|
||||
}
|
||||
|
@ -94,8 +94,8 @@ class AcsBoardAssembly : public DualLaneAssemblyBase {
|
||||
|
||||
static constexpr uint8_t NUMBER_DEVICES_MODE_TABLE = 9;
|
||||
|
||||
AcsBoardAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher,
|
||||
AcsBoardHelper helper, GpioIF* gpioIF);
|
||||
AcsBoardAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, AcsBoardHelper helper,
|
||||
GpioIF* gpioIF);
|
||||
|
||||
/**
|
||||
* In dual mode, the A side or the B side GPS device can be used, but not both.
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "AcsSubsystem.h"
|
||||
|
||||
AcsSubsystem::AcsSubsystem(object_id_t setObjectId, object_id_t parent,
|
||||
uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables)
|
||||
: Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {}
|
||||
AcsSubsystem::AcsSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
|
||||
uint32_t maxNumberOfTables)
|
||||
: Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {}
|
||||
|
@ -5,8 +5,7 @@
|
||||
|
||||
class AcsSubsystem : public Subsystem {
|
||||
public:
|
||||
AcsSubsystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences,
|
||||
uint32_t maxNumberOfTables);
|
||||
AcsSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables);
|
||||
|
||||
private:
|
||||
};
|
||||
|
@ -1,14 +1,13 @@
|
||||
target_sources(${LIB_EIVE_MISSION} PRIVATE
|
||||
EiveSystem.cpp
|
||||
target_sources(
|
||||
${LIB_EIVE_MISSION}
|
||||
PRIVATE EiveSystem.cpp
|
||||
AcsSubsystem.cpp
|
||||
ComSubsystem.cpp
|
||||
PayloadSubsystem.cpp
|
||||
|
||||
AcsBoardAssembly.cpp
|
||||
SusAssembly.cpp
|
||||
RwAssembly.cpp
|
||||
DualLanePowerStateMachine.cpp
|
||||
PowerStateMachineBase.cpp
|
||||
DualLaneAssemblyBase.cpp
|
||||
TcsBoardAssembly.cpp
|
||||
)
|
||||
TcsBoardAssembly.cpp)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "ComSubsystem.h"
|
||||
|
||||
ComSubsystem::ComSubsystem(object_id_t setObjectId, object_id_t parent,
|
||||
uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables)
|
||||
: Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {}
|
||||
ComSubsystem::ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
|
||||
uint32_t maxNumberOfTables)
|
||||
: Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {}
|
||||
|
@ -5,8 +5,7 @@
|
||||
|
||||
class ComSubsystem : public Subsystem {
|
||||
public:
|
||||
ComSubsystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences,
|
||||
uint32_t maxNumberOfTables);
|
||||
ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables);
|
||||
|
||||
private:
|
||||
};
|
||||
|
@ -4,12 +4,11 @@
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
|
||||
DualLaneAssemblyBase::DualLaneAssemblyBase(object_id_t objectId, object_id_t parentId,
|
||||
PowerSwitchIF* pwrSwitcher, pcdu::Switches switch1,
|
||||
pcdu::Switches switch2, Event pwrTimeoutEvent,
|
||||
Event sideSwitchNotAllowedEvent,
|
||||
DualLaneAssemblyBase::DualLaneAssemblyBase(object_id_t objectId, PowerSwitchIF* pwrSwitcher,
|
||||
pcdu::Switches switch1, pcdu::Switches switch2,
|
||||
Event pwrTimeoutEvent, Event sideSwitchNotAllowedEvent,
|
||||
Event transitionOtherSideFailedEvent)
|
||||
: AssemblyBase(objectId, parentId, 20),
|
||||
: AssemblyBase(objectId, 20),
|
||||
pwrStateMachine(switch1, switch2, pwrSwitcher),
|
||||
pwrTimeoutEvent(pwrTimeoutEvent),
|
||||
sideSwitchNotAllowedEvent(sideSwitchNotAllowedEvent),
|
||||
|
@ -18,8 +18,8 @@ class DualLaneAssemblyBase : public AssemblyBase, public ConfirmsFailuresIF {
|
||||
static constexpr UniqueEventId_t POWER_STATE_MACHINE_TIMEOUT_ID = 2;
|
||||
static constexpr UniqueEventId_t SIDE_SWITCH_TRANSITION_NOT_ALLOWED_ID = 3;
|
||||
|
||||
DualLaneAssemblyBase(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher,
|
||||
pcdu::Switches switch1, pcdu::Switches switch2, Event pwrSwitchTimeoutEvent,
|
||||
DualLaneAssemblyBase(object_id_t objectId, PowerSwitchIF* pwrSwitcher, pcdu::Switches switch1,
|
||||
pcdu::Switches switch2, Event pwrSwitchTimeoutEvent,
|
||||
Event sideSwitchNotAllowedEvent, Event transitionOtherSideFailedEvent);
|
||||
|
||||
protected:
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "EiveSystem.h"
|
||||
|
||||
EiveSystem::EiveSystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences,
|
||||
EiveSystem::EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
|
||||
uint32_t maxNumberOfTables)
|
||||
: Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {}
|
||||
: Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {}
|
||||
|
@ -5,8 +5,7 @@
|
||||
|
||||
class EiveSystem : public Subsystem {
|
||||
public:
|
||||
EiveSystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences,
|
||||
uint32_t maxNumberOfTables);
|
||||
EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables);
|
||||
|
||||
private:
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "PayloadSubsystem.h"
|
||||
|
||||
PayloadSubsystem::PayloadSubsystem(object_id_t setObjectId, object_id_t parent,
|
||||
uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables)
|
||||
: Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {}
|
||||
PayloadSubsystem::PayloadSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
|
||||
uint32_t maxNumberOfTables)
|
||||
: Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {}
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
class PayloadSubsystem : public Subsystem {
|
||||
public:
|
||||
PayloadSubsystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences,
|
||||
PayloadSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
|
||||
uint32_t maxNumberOfTables);
|
||||
|
||||
private:
|
||||
|
@ -169,12 +169,13 @@ bool RwAssembly::isUseable(object_id_t object, Mode_t mode) {
|
||||
|
||||
ReturnValue_t RwAssembly::initialize() {
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
for (const auto& obj : helper.rwIds) {
|
||||
result = registerChild(obj);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
// TODO: Fix this
|
||||
// for (const auto& obj : helper.rwIds) {
|
||||
// result = registerChild(obj);
|
||||
// if (result != returnvalue::OK) {
|
||||
// return result;
|
||||
// }
|
||||
// }
|
||||
return SubsystemBase::initialize();
|
||||
}
|
||||
|
||||
|
@ -4,9 +4,8 @@
|
||||
#include <fsfw/power/PowerSwitchIF.h>
|
||||
#include <fsfw/serviceinterface.h>
|
||||
|
||||
SusAssembly::SusAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher,
|
||||
SusAssHelper helper)
|
||||
: DualLaneAssemblyBase(objectId, parentId, pwrSwitcher, SWITCH_NOM, SWITCH_RED,
|
||||
SusAssembly::SusAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, SusAssHelper helper)
|
||||
: DualLaneAssemblyBase(objectId, pwrSwitcher, SWITCH_NOM, SWITCH_RED,
|
||||
POWER_STATE_MACHINE_TIMEOUT, SIDE_SWITCH_TRANSITION_NOT_ALLOWED,
|
||||
TRANSITION_OTHER_SIDE_FAILED),
|
||||
helper(helper),
|
||||
@ -123,12 +122,13 @@ ReturnValue_t SusAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_t wan
|
||||
|
||||
ReturnValue_t SusAssembly::initialize() {
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
for (const auto& id : helper.susIds) {
|
||||
result = registerChild(id);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
// TODO: Fix this
|
||||
// for (const auto& id : helper.susIds) {
|
||||
// result = registerChild(id);
|
||||
// if (result != returnvalue::OK) {
|
||||
// return result;
|
||||
// }
|
||||
// }
|
||||
return AssemblyBase::initialize();
|
||||
}
|
||||
|
||||
|
@ -40,8 +40,7 @@ class SusAssembly : public DualLaneAssemblyBase {
|
||||
static constexpr Event SIDE_SWITCH_TRANSITION_NOT_ALLOWED =
|
||||
event::makeEvent(SUBSYSTEM_ID, 3, severity::LOW);
|
||||
|
||||
SusAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher,
|
||||
SusAssHelper helper);
|
||||
SusAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, SusAssHelper helper);
|
||||
|
||||
private:
|
||||
enum class States { IDLE, SWITCHING_POWER, MODE_COMMANDING } state = States::IDLE;
|
||||
|
@ -3,10 +3,9 @@
|
||||
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
||||
#include <fsfw/ipc/QueueFactory.h>
|
||||
|
||||
TcsBoardAssembly::TcsBoardAssembly(object_id_t objectId, object_id_t parentId,
|
||||
PowerSwitchIF* pwrSwitcher, power::Switch_t theSwitch,
|
||||
TcsBoardHelper helper)
|
||||
: AssemblyBase(objectId, parentId, 24), switcher(pwrSwitcher, theSwitch), helper(helper) {
|
||||
TcsBoardAssembly::TcsBoardAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher,
|
||||
power::Switch_t theSwitch, TcsBoardHelper helper)
|
||||
: AssemblyBase(objectId, 24), switcher(pwrSwitcher, theSwitch), helper(helper) {
|
||||
eventQueue = QueueFactory::instance()->createMessageQueue(24);
|
||||
ModeListEntry entry;
|
||||
for (uint8_t idx = 0; idx < NUMBER_RTDS; idx++) {
|
||||
@ -92,12 +91,13 @@ ReturnValue_t TcsBoardAssembly::isModeCombinationValid(Mode_t mode, Submode_t su
|
||||
|
||||
ReturnValue_t TcsBoardAssembly::initialize() {
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
for (const auto& obj : helper.rtdInfos) {
|
||||
result = registerChild(obj.first);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
// TODO: Fix this
|
||||
// for (const auto& obj : helper.rtdInfos) {
|
||||
// result = registerChild(obj.first);
|
||||
// if (result != returnvalue::OK) {
|
||||
// return result;
|
||||
// }
|
||||
// }
|
||||
return SubsystemBase::initialize();
|
||||
}
|
||||
|
||||
|
@ -20,8 +20,8 @@ class TcsBoardAssembly : public AssemblyBase, public ConfirmsFailuresIF {
|
||||
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::TCS_BOARD_ASS;
|
||||
static constexpr Event CHILDREN_LOST_MODE = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);
|
||||
|
||||
TcsBoardAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher,
|
||||
power::Switch_t switcher, TcsBoardHelper helper);
|
||||
TcsBoardAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power::Switch_t switcher,
|
||||
TcsBoardHelper helper);
|
||||
|
||||
ReturnValue_t initialize() override;
|
||||
|
||||
|
@ -1,3 +1 @@
|
||||
target_sources(${LIB_EIVE_MISSION} PRIVATE
|
||||
acsModeTree.cpp
|
||||
)
|
||||
target_sources(${LIB_EIVE_MISSION} PRIVATE acsModeTree.cpp)
|
||||
|
@ -1,13 +1,15 @@
|
||||
#include "acsModeTree.h"
|
||||
#include "eive/objects.h"
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
||||
#include <fsfw/modes/HasModesIF.h>
|
||||
#include <fsfw/subsystem/Subsystem.h>
|
||||
#include <fsfw/subsystem/modes/ModeDefinitions.h>
|
||||
|
||||
#include "eive/objects.h"
|
||||
#include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h"
|
||||
|
||||
Subsystem satsystem::ACS_SUBSYSTEM(objects::ACS_SUBSYSTEM, 12, 24);
|
||||
|
||||
void checkInsert(ReturnValue_t result, const char* ctx);
|
||||
void buildOffSequence(Subsystem* ss, ModeListEntry& eh);
|
||||
void buildDetumbleSequence(Subsystem* ss, ModeListEntry& entryHelper);
|
||||
@ -75,21 +77,13 @@ auto ACS_TABLE_TARGET_PT_TRANS_1 =
|
||||
|
||||
void satsystem::initAcsSubsystem(object_id_t satSystemObjId) {
|
||||
ModeListEntry entry;
|
||||
Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, satSystemObjId, 12, 24);
|
||||
acsSubsystem->registerChild(objects::ACS_CONTROLLER);
|
||||
acsSubsystem->registerChild(objects::IMTQ_HANDLER);
|
||||
acsSubsystem->registerChild(objects::STAR_TRACKER);
|
||||
acsSubsystem->registerChild(objects::ACS_BOARD_ASS);
|
||||
acsSubsystem->registerChild(objects::SUS_BOARD_ASS);
|
||||
acsSubsystem->registerChild(objects::IMTQ_HANDLER);
|
||||
acsSubsystem->registerChild(objects::RW_ASS);
|
||||
buildOffSequence(acsSubsystem, entry);
|
||||
buildSafeSequence(acsSubsystem, entry);
|
||||
buildDetumbleSequence(acsSubsystem, entry);
|
||||
buildIdleSequence(acsSubsystem, entry);
|
||||
buildIdleChargeSequence(acsSubsystem, entry);
|
||||
buildTargetPtSequence(acsSubsystem, entry);
|
||||
acsSubsystem->setInitialMode(HasModesIF::MODE_OFF);
|
||||
buildOffSequence(&ACS_SUBSYSTEM, entry);
|
||||
buildSafeSequence(&ACS_SUBSYSTEM, entry);
|
||||
buildDetumbleSequence(&ACS_SUBSYSTEM, entry);
|
||||
buildIdleSequence(&ACS_SUBSYSTEM, entry);
|
||||
buildIdleChargeSequence(&ACS_SUBSYSTEM, entry);
|
||||
buildTargetPtSequence(&ACS_SUBSYSTEM, entry);
|
||||
ACS_SUBSYSTEM.setInitialMode(HasModesIF::MODE_OFF);
|
||||
}
|
||||
|
||||
void buildOffSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||
|
@ -4,6 +4,8 @@ class Subsystem;
|
||||
|
||||
namespace satsystem {
|
||||
|
||||
extern Subsystem ACS_SUBSYSTEM;
|
||||
|
||||
void initAcsSubsystem(object_id_t satSystemObjId);
|
||||
|
||||
} // namespace satsystem
|
||||
|
Loading…
Reference in New Issue
Block a user