avoid exceptions
This commit is contained in:
@ -540,8 +540,10 @@ ReturnValue_t Guidance::getDistributionMatrixRw(ACS::SensorValues *sensorValues,
|
||||
}
|
||||
|
||||
void Guidance::getTargetParamsSafe(double sunTargetSafe[3], double satRateSafe[3]) {
|
||||
if (not std::filesystem::exists(SD_0_SKEWED_PTG_FILE) or
|
||||
not std::filesystem::exists(SD_1_SKEWED_PTG_FILE)) { // ToDo: if file does not exist anymore
|
||||
std::error_code e;
|
||||
if (not std::filesystem::exists(SD_0_SKEWED_PTG_FILE, e) or
|
||||
not std::filesystem::exists(SD_1_SKEWED_PTG_FILE,
|
||||
e)) { // ToDo: if file does not exist anymore
|
||||
std::memcpy(sunTargetSafe, acsParameters.safeModeControllerParameters.sunTargetDir,
|
||||
3 * sizeof(double));
|
||||
} else {
|
||||
@ -553,15 +555,16 @@ void Guidance::getTargetParamsSafe(double sunTargetSafe[3], double satRateSafe[3
|
||||
}
|
||||
|
||||
ReturnValue_t Guidance::solarArrayDeploymentComplete() {
|
||||
if (std::filesystem::exists(SD_0_SKEWED_PTG_FILE)) {
|
||||
std::error_code e;
|
||||
if (std::filesystem::exists(SD_0_SKEWED_PTG_FILE, e)) {
|
||||
std::remove(SD_0_SKEWED_PTG_FILE);
|
||||
if (std::filesystem::exists(SD_0_SKEWED_PTG_FILE)) {
|
||||
if (std::filesystem::exists(SD_0_SKEWED_PTG_FILE, e)) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
}
|
||||
if (std::filesystem::exists(SD_1_SKEWED_PTG_FILE)) {
|
||||
if (std::filesystem::exists(SD_1_SKEWED_PTG_FILE, e)) {
|
||||
std::remove(SD_1_SKEWED_PTG_FILE);
|
||||
if (std::filesystem::exists(SD_1_SKEWED_PTG_FILE)) {
|
||||
if (std::filesystem::exists(SD_1_SKEWED_PTG_FILE, e)) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user