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:
commit
6582b24bc4
Binary file not shown.
@ -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<>();
|
||||
try {
|
||||
b.addAll(ThrustCurveAPI.downloadData(motorId, "RockSim"));
|
||||
} catch (Exception ex) {
|
||||
System.out.println("\tError downloading RockSim for motorID=" + motorId);
|
||||
}
|
||||
try {
|
||||
b.addAll(ThrustCurveAPI.downloadData(motorId, "RASP"));
|
||||
} catch (Exception ex) {
|
||||
System.out.println("\tError downloading RASP for motorID=" + motorId);
|
||||
for (String format : formats) {
|
||||
try {
|
||||
List<MotorBurnFile> motorData = ThrustCurveAPI.downloadData(motorId, format);
|
||||
if (motorData != null) {
|
||||
b.addAll(motorData);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
System.out.println("\tError downloading " + format + " for motorID=" + motorId + ": " + ex.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user