commands to disable and enable star tracker filename timestamping
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
parent
b822ee77bc
commit
2419e9fcc6
2
fsfw
2
fsfw
@ -1 +1 @@
|
||||
Subproject commit c20bf31d5d9f7ed18d15f2a3211a14f28242eeb6
|
||||
Subproject commit 3c06d2dbbb0d79608e003a8a3c89ae90cc71f409
|
@ -399,6 +399,8 @@ static const DeviceCommandId_t LOGLEVEL = 81;
|
||||
static const DeviceCommandId_t LOGSUBSCRIPTION = 82;
|
||||
static const DeviceCommandId_t DEBUG_CAMERA = 83;
|
||||
static const DeviceCommandId_t FIRMWARE_UPDATE = 84;
|
||||
static const DeviceCommandId_t DISABLE_TIMESTAMP_GENERATION = 85;
|
||||
static const DeviceCommandId_t ENABLE_TIMESTAMP_GENERATION = 86;
|
||||
static const DeviceCommandId_t NONE = 0xFFFFFFFF;
|
||||
|
||||
static const uint32_t VERSION_SET_ID = REQ_VERSION;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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;
|
||||
}
|
||||
|
@ -139,6 +139,16 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
||||
*/
|
||||
void setFlashReadFilename(std::string filename);
|
||||
|
||||
/**
|
||||
* @brief Disables timestamp generation when new file is created
|
||||
*/
|
||||
void disableTimestamping();
|
||||
|
||||
/**
|
||||
* @brief Enables timestamp generation when new file is created
|
||||
*/
|
||||
void enableTimestamping();
|
||||
|
||||
private:
|
||||
static const uint8_t INTERFACE_ID = CLASS_ID::STR_HELPER;
|
||||
|
||||
@ -254,6 +264,12 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
||||
|
||||
uint32_t nextProgressPrint = 0;
|
||||
|
||||
#ifdef EGSE
|
||||
bool timestamping = false;
|
||||
#else
|
||||
bool timestamping = true;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* UART communication object responsible for low level access of star tracker
|
||||
* Must be set by star tracker handler
|
||||
@ -355,6 +371,8 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
||||
*
|
||||
*/
|
||||
ReturnValue_t unlockAndEraseRegions(uint32_t from, uint32_t to);
|
||||
|
||||
std::string makeFilename();
|
||||
};
|
||||
|
||||
#endif /* BSP_Q7S_DEVICES_STRHELPER_H_ */
|
||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit 0a8a2fb9c6833f2e1d89dabaf4c06bd79190fb50
|
||||
Subproject commit fd43ef0c8a8241e7c50eea16ac86d9b121736ac1
|
Loading…
Reference in New Issue
Block a user