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

Submodule fsfw updated: 808e3e0462...7e0a5d5a9e

View File

@ -6,7 +6,9 @@
#include <algorithm>
#include <ctime>
#include <iostream>
#include <fstream>
#include <random>
#include <filesystem>
#include "fsfw/globalfunctions/CRC.h"
#include "mission/devices/devicedefinitions/ScexDefinitions.h"
@ -195,7 +197,7 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons
fileId = date_time_string();
std::ostringstream oss;
auto prefix = sdcMan.getCurrentMountPrefix();
oss << prefix << "/scex-" << cmdName << fileId << ".bin";
oss << prefix << "/scex/scex-" << cmdName << fileId << ".bin";
fileName = oss.str();
sif::info << "ScexDeviceHandler::interpretDeviceReply: FileName: " << fileName << std::endl;
ofstream out(fileName, ofstream::binary);
@ -212,7 +214,7 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons
fileId = date_time_string();
std::ostringstream oss;
auto prefix = sdcMan.getCurrentMountPrefix();
oss << prefix << "/scex-" << cmdName << fileId << ".bin";
oss << prefix << "/scex/scex-" << cmdName << fileId << ".bin";
fileName = oss.str();
sif::info << "ScexDeviceHandler::interpretDeviceReply: FileName: " << fileName
<< std::endl; // TODO remove
@ -349,4 +351,18 @@ void ScexDeviceHandler::modeChanged() {}
void ScexDeviceHandler::setPowerSwitcher(PowerSwitchIF& powerSwitcher, power::Switch_t switchId) {
DeviceHandlerBase::setPowerSwitcher(&powerSwitcher);
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,
LocalDataPoolManager &poolManager) override;
ReturnValue_t initializeAfterTaskCreation() override;
void modeChanged() override;
};

2
tmtc

Submodule tmtc updated: a7714747bc...6caf06248b