improve store init handling, add remaining stores
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
parent
ff9bcd6b14
commit
5d67b896aa
@ -19,6 +19,8 @@ PusTmFunnel::PusTmFunnel(object_id_t objectId, TimeReaderIF &timeReader, Storage
|
|||||||
sdcMan(sdcMan) {
|
sdcMan(sdcMan) {
|
||||||
Clock::getClock_timeval(¤tTv);
|
Clock::getClock_timeval(¤tTv);
|
||||||
Clock::getUptime(&lastTvUpdate);
|
Clock::getUptime(&lastTvUpdate);
|
||||||
|
hkStore.addApid(config::EIVE_PUS_APID);
|
||||||
|
hkStore.addService(3);
|
||||||
miscStore.addApid(config::EIVE_PUS_APID);
|
miscStore.addApid(config::EIVE_PUS_APID);
|
||||||
miscStore.addService(17);
|
miscStore.addService(17);
|
||||||
miscStore.addService(200);
|
miscStore.addService(200);
|
||||||
@ -88,12 +90,9 @@ ReturnValue_t PusTmFunnel::handlePacket(TmTcMessage &message) {
|
|||||||
lastTvUpdate = currentUptime;
|
lastTvUpdate = currentUptime;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sdcMan.isSdCardUsable(std::nullopt)) {
|
bool sdcUsable = sdcMan.isSdCardUsable(std::nullopt);
|
||||||
if (not storesInitialized) {
|
initStoresIfPossible(sdcUsable);
|
||||||
miscStore.updateBaseDir();
|
if (sdcUsable) {
|
||||||
okStore.updateBaseDir();
|
|
||||||
storesInitialized = true;
|
|
||||||
}
|
|
||||||
miscStore.passPacket(packet);
|
miscStore.passPacket(packet);
|
||||||
okStore.passPacket(packet);
|
okStore.passPacket(packet);
|
||||||
}
|
}
|
||||||
@ -131,11 +130,17 @@ ReturnValue_t PusTmFunnel::handlePacket(TmTcMessage &message) {
|
|||||||
|
|
||||||
const char *PusTmFunnel::getName() const { return "PUS TM Funnel"; }
|
const char *PusTmFunnel::getName() const { return "PUS TM Funnel"; }
|
||||||
|
|
||||||
ReturnValue_t PusTmFunnel::initialize() {
|
void PusTmFunnel::initStoresIfPossible(bool sdCardUsable) {
|
||||||
if (not storesInitialized and sdcMan.isSdCardUsable(std::nullopt)) {
|
if (not storesInitialized and sdCardUsable) {
|
||||||
miscStore.updateBaseDir();
|
miscStore.updateBaseDir();
|
||||||
okStore.updateBaseDir();
|
okStore.updateBaseDir();
|
||||||
|
hkStore.updateBaseDir();
|
||||||
|
notOkStore.updateBaseDir();
|
||||||
storesInitialized = true;
|
storesInitialized = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PusTmFunnel::initialize() {
|
||||||
|
initStoresIfPossible(sdcMan.isSdCardUsable(std::nullopt));
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ class PusTmFunnel : public TmFunnelBase {
|
|||||||
SdCardMountedIF &sdcMan;
|
SdCardMountedIF &sdcMan;
|
||||||
|
|
||||||
ReturnValue_t handlePacket(TmTcMessage &message);
|
ReturnValue_t handlePacket(TmTcMessage &message);
|
||||||
|
void initStoresIfPossible(bool sdCardUsable);
|
||||||
ReturnValue_t initialize() override;
|
ReturnValue_t initialize() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user