finish file handling
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2022-10-12 19:55:20 +02:00
parent 22691b6950
commit e1b3688869
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -110,7 +110,7 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename) {
}
} else if (lineNum == 1) {
iss >> word;
if (word.find("phase:") == string::npos) {
if (word.find("secs_since_start:") == string::npos) {
return false;
}
@ -159,7 +159,20 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(const char* filename) {
}
}
if(stateSwitch or updateUptime) {
// TODO: Write new file here
std::ofstream of(filename);
of << "phase: " ;
if(deplState == AutonomousDeplState::INIT) {
of << PHASE_INIT_STR << "\n";
} else if(deplState == AutonomousDeplState::FIRST_BURN) {
of << PHASE_FIRST_BURN_STR << "\n";
} else if(deplState == AutonomousDeplState::WAIT) {
of << PHASE_WAIT_STR << "\n";
} else if(deplState == AutonomousDeplState::SECOND_BURN) {
of << PHASE_SECOND_BURN_STR << "\n";
} else if(deplState == AutonomousDeplState::DONE) {
of << PHASE_DONE<< "\n";
}
of << "secs_since_start: " << std::to_string(secsSinceBoot) << "\n";
}
return true;
}