Create new SIM_ABORT FlightEvent
This commit is contained in:
parent
64e999f2e2
commit
2123531f14
@ -1964,6 +1964,7 @@ FlightEvent.Type.STAGE_SEPARATION = Stage separation
|
||||
FlightEvent.Type.APOGEE = Apogee
|
||||
FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT = Recovery device deployment
|
||||
FlightEvent.Type.GROUND_HIT = Ground hit
|
||||
FlightEvent.Type.SIM_ABORT = Simulation abort
|
||||
FlightEvent.Type.SIMULATION_END = Simulation end
|
||||
FlightEvent.Type.ALTITUDE = Altitude change
|
||||
FlightEvent.Type.TUMBLE = Tumbling
|
||||
|
@ -1,6 +1,7 @@
|
||||
package net.sf.openrocket.simulation;
|
||||
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.logging.SimulationAbort;
|
||||
import net.sf.openrocket.rocketcomponent.AxialStage;
|
||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
@ -82,7 +83,13 @@ public class FlightEvent implements Comparable<FlightEvent> {
|
||||
TUMBLE(trans.get("FlightEvent.Type.TUMBLE")),
|
||||
|
||||
/**
|
||||
* Simulation aborted
|
||||
* It is impossible for the simulation proceed due to characteristics
|
||||
* of the rocket or flight configuration
|
||||
*/
|
||||
SIM_ABORT(trans.get("FlightEvent.Type.SIM_ABORT")),
|
||||
|
||||
/**
|
||||
* Simulation exception thrown due to error in OpenRocket code
|
||||
*/
|
||||
EXCEPTION(trans.get("FlightEvent.Type.EXCEPTION"));
|
||||
|
||||
@ -239,6 +246,11 @@ public class FlightEvent implements Comparable<FlightEvent> {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SIM_ABORT:
|
||||
if (( null == this.data ) || ( ! ( this.data instanceof SimulationAbort ))) {
|
||||
throw new IllegalStateException(type.name()+" events require SimulationAbort objects");
|
||||
}
|
||||
break;
|
||||
case LAUNCH:
|
||||
case LIFTOFF:
|
||||
case LAUNCHROD:
|
||||
|
Loading…
x
Reference in New Issue
Block a user