SA DEPLY updates
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2023-03-17 11:09:29 +01:00
parent 52ab77eded
commit 509d144117
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 14 additions and 7 deletions

View File

@ -157,10 +157,14 @@ ReturnValue_t SolarArrayDeploymentHandler::performAutonomousDepl(sd::SdCard sdCa
return returnvalue::OK; return returnvalue::OK;
} }
bool SolarArrayDeploymentHandler::autonomousDeplForFile(sd::SdCard sdCard, const char* filename, bool SolarArrayDeploymentHandler::autonomousDeplForFile(sd::SdCard sdCard, const char* infoFile,
bool dryRun) { bool dryRun) {
using namespace std; using namespace std;
ifstream file(filename); std::error_code e;
ifstream file(infoFile);
if (file.bad()) {
return false;
}
string line; string line;
string word; string word;
unsigned int lineNum = 0; unsigned int lineNum = 0;
@ -240,15 +244,18 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(sd::SdCard sdCard, const
} }
} }
if (deplState == AutonomousDeplState::DONE) { if (deplState == AutonomousDeplState::DONE) {
remove(filename); std::filesystem::remove(infoFile, e);
if (sdCard == sd::SdCard::SLOT_0) { if (sdCard == sd::SdCard::SLOT_0) {
remove(SD_0_DEPL_FILE); std::filesystem::remove(SD_0_DEPL_FILE, e);
} else { } else {
remove(SD_1_DEPL_FILE); std::filesystem::remove(SD_1_DEPL_FILE, e);
} }
triggerEvent(AUTONOMOUS_DEPLOYMENT_COMPLETED); triggerEvent(AUTONOMOUS_DEPLOYMENT_COMPLETED);
} else { } else {
std::ofstream of(filename); std::ofstream of(infoFile);
if (of.bad()) {
return false;
}
of << "phase: "; of << "phase: ";
if (deplState == AutonomousDeplState::INIT) { if (deplState == AutonomousDeplState::INIT) {
of << PHASE_INIT_STR << "\n"; of << PHASE_INIT_STR << "\n";

2
tmtc

@ -1 +1 @@
Subproject commit 4f48c25bf757b6c056072049fe5965da890b4f5b Subproject commit 350e5d77b8113cc9e21eb72242fc37536368f541