Merge pull request #809 from JoePfeiffer/fix-807

get rid of error message when no data for motor in specified format (fixes #807)
This commit is contained in:
Joe Pfeiffer 2020-11-07 09:43:08 -06:00 committed by GitHub
commit 6582b24bc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View File

@ -161,20 +161,20 @@ public class SerializeThrustcurveMotors {
}
}
}
private static List<MotorBurnFile> getThrustCurvesForMotorId(int motorId) {
String formats[] = new String[] {"RASP", "RockSim"};
List<MotorBurnFile> b = new ArrayList<>();
for (String format : formats) {
try {
b.addAll(ThrustCurveAPI.downloadData(motorId, "RockSim"));
} catch (Exception ex) {
System.out.println("\tError downloading RockSim for motorID=" + motorId);
List<MotorBurnFile> motorData = ThrustCurveAPI.downloadData(motorId, format);
if (motorData != null) {
b.addAll(motorData);
}
try {
b.addAll(ThrustCurveAPI.downloadData(motorId, "RASP"));
} catch (Exception ex) {
System.out.println("\tError downloading RASP for motorID=" + motorId);
System.out.println("\tError downloading " + format + " for motorID=" + motorId + ": " + ex.getLocalizedMessage());
}
}
return b;
}