commands to disable and enable star tracker filename timestamping
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
2022-02-24 13:47:52 +01:00
parent b822ee77bc
commit 2419e9fcc6
6 changed files with 2289 additions and 2249 deletions

View File

@ -171,14 +171,22 @@ ReturnValue_t StrHelper::startFlashRead(std::string path, uint8_t region, uint32
return RETURN_OK;
}
void StrHelper::disableTimestamping() {
timestamping = false;
}
void StrHelper::enableTimestamping() {
timestamping = true;
}
ReturnValue_t StrHelper::performImageDownload() {
ReturnValue_t result;
struct DownloadActionRequest downloadReq;
uint32_t size = 0;
uint32_t retries = 0;
Timestamp timestamp;
std::string image = downloadImage.path + "/" + timestamp.str() + downloadImage.filename;
std::ofstream file(image, std::ios_base::app | std::ios_base::out);
std::string image = makeFilename();
// std::ofstream file(image, std::ios_base::app | std::ios_base::out);
std::ofstream file(image, std::ios_base::out);
if (not std::filesystem::exists(image)) {
return FILE_CREATION_FAILED;
}
@ -576,3 +584,15 @@ ReturnValue_t StrHelper::unlockAndEraseRegions(uint32_t from, uint32_t to) {
}
return result;
}
std::string StrHelper::makeFilename() {
std::string image;
Timestamp timestamp;
if (timestamping) {
image = downloadImage.path + "/" + timestamp.str() + downloadImage.filename;
}
else {
image = downloadImage.path + "/" + downloadImage.filename;
}
return image;
}