diff --git a/core/src/net/sf/openrocket/motor/ThrustCurveMotor.java b/core/src/net/sf/openrocket/motor/ThrustCurveMotor.java index 68073b0ee..d2f8a7f51 100644 --- a/core/src/net/sf/openrocket/motor/ThrustCurveMotor.java +++ b/core/src/net/sf/openrocket/motor/ThrustCurveMotor.java @@ -145,14 +145,15 @@ public class ThrustCurveMotor implements Motor, Comparable, Se if (motor.time.length < 2) { throw new IllegalArgumentException("Too short thrust-curve, length=" + motor.time.length); } + for (int i = 0; i < motor.time.length - 1; i++) { if (motor.time[i + 1] <= motor.time[i]) { - throw new IllegalArgumentException("Time stalls or goes backwards, " + - "time[" + i + "]=" + motor.time[i] + " " + - "time[" + (i + 1) + "]=" + motor.time[i + 1] + - ", thrust=(" + motor.thrust[i] + ", " + motor.thrust[i+1] + ")"); + throw new IllegalArgumentException("Two thrust values for single time point, " + + "time[" + i + "]=" + motor.time[i] + ", thrust=" + motor.thrust[i] + + "; time[" + (i + 1) + "]=" + motor.time[i + 1] + ", thrust=" + motor.thrust[i+1]); } } + if (!MathUtil.equals(motor.time[0], 0)) { throw new IllegalArgumentException("Curve starts at time " + motor.time[0]); } diff --git a/core/src/net/sf/openrocket/thrustcurve/SerializeThrustcurveMotors.java b/core/src/net/sf/openrocket/thrustcurve/SerializeThrustcurveMotors.java index 173e26375..7adef3a03 100644 --- a/core/src/net/sf/openrocket/thrustcurve/SerializeThrustcurveMotors.java +++ b/core/src/net/sf/openrocket/thrustcurve/SerializeThrustcurveMotors.java @@ -145,7 +145,7 @@ public class SerializeThrustcurveMotors { allMotors.add(builder.build()); } catch (IllegalArgumentException e) { - System.out.println("\tError in simFile " + burnFile.getSimfileId() + ": " + e.getMessage() + " (continuing)"); + System.out.println("\tError in simFile " + burnFile.getSimfileId() + ": " + e.getMessage()); try { FileOutputStream out = new FileOutputStream(("simfile-" + burnFile.getSimfileId()).toString()); out.write(burnFile.getContents().getBytes());