scex directory
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Irini Kosmidou 2022-09-29 19:38:19 +02:00
parent c7e06f8878
commit 43cda300e3
4 changed files with 21 additions and 4 deletions

2
fsfw

@ -1 +1 @@
Subproject commit 808e3e0462999d7caa1b6834174140dbbeb8b01c Subproject commit 7e0a5d5a9e4f38c6d818bbdd5b44d34d8007eb1e

View File

@ -6,7 +6,9 @@
#include <algorithm> #include <algorithm>
#include <ctime> #include <ctime>
#include <iostream> #include <iostream>
#include <fstream>
#include <random> #include <random>
#include <filesystem>
#include "fsfw/globalfunctions/CRC.h" #include "fsfw/globalfunctions/CRC.h"
#include "mission/devices/devicedefinitions/ScexDefinitions.h" #include "mission/devices/devicedefinitions/ScexDefinitions.h"
@ -195,7 +197,7 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons
fileId = date_time_string(); fileId = date_time_string();
std::ostringstream oss; std::ostringstream oss;
auto prefix = sdcMan.getCurrentMountPrefix(); auto prefix = sdcMan.getCurrentMountPrefix();
oss << prefix << "/scex-" << cmdName << fileId << ".bin"; oss << prefix << "/scex/scex-" << cmdName << fileId << ".bin";
fileName = oss.str(); fileName = oss.str();
sif::info << "ScexDeviceHandler::interpretDeviceReply: FileName: " << fileName << std::endl; sif::info << "ScexDeviceHandler::interpretDeviceReply: FileName: " << fileName << std::endl;
ofstream out(fileName, ofstream::binary); ofstream out(fileName, ofstream::binary);
@ -212,7 +214,7 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons
fileId = date_time_string(); fileId = date_time_string();
std::ostringstream oss; std::ostringstream oss;
auto prefix = sdcMan.getCurrentMountPrefix(); auto prefix = sdcMan.getCurrentMountPrefix();
oss << prefix << "/scex-" << cmdName << fileId << ".bin"; oss << prefix << "/scex/scex-" << cmdName << fileId << ".bin";
fileName = oss.str(); fileName = oss.str();
sif::info << "ScexDeviceHandler::interpretDeviceReply: FileName: " << fileName sif::info << "ScexDeviceHandler::interpretDeviceReply: FileName: " << fileName
<< std::endl; // TODO remove << std::endl; // TODO remove
@ -349,4 +351,18 @@ void ScexDeviceHandler::modeChanged() {}
void ScexDeviceHandler::setPowerSwitcher(PowerSwitchIF& powerSwitcher, power::Switch_t switchId) { void ScexDeviceHandler::setPowerSwitcher(PowerSwitchIF& powerSwitcher, power::Switch_t switchId) {
DeviceHandlerBase::setPowerSwitcher(&powerSwitcher); DeviceHandlerBase::setPowerSwitcher(&powerSwitcher);
this->switchId = switchId; this->switchId = switchId;
}
ReturnValue_t ScexDeviceHandler::initializeAfterTaskCreation() {
// hier checken ob `<prefix>/ordner` existiert und wenn nicht erstellen
auto mntPrefix = sdcMan.getCurrentMountPrefix();
std::filesystem::path fullFilePath = mntPrefix;
fullFilePath /= "scex";
bool fileExists = std::filesystem::exists(fullFilePath);
if(not fileExists){
std::filesystem::create_directory(fullFilePath);
}
return DeviceHandlerBase::initializeAfterTaskCreation();
} }

View File

@ -57,6 +57,7 @@ class ScexDeviceHandler : public DeviceHandlerBase {
ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) override; LocalDataPoolManager &poolManager) override;
ReturnValue_t initializeAfterTaskCreation() override;
void modeChanged() override; void modeChanged() override;
}; };

2
tmtc

@ -1 +1 @@
Subproject commit a7714747bc45dfa6a9ccb41cc6eb890b21ca0481 Subproject commit 6caf06248b73f9328c9069d627a5b387a3ac14b3