1 package net.sf.openrocket.simulation.listeners;
3 import net.sf.openrocket.motor.MotorId;
4 import net.sf.openrocket.motor.MotorInstance;
5 import net.sf.openrocket.rocketcomponent.MotorMount;
6 import net.sf.openrocket.rocketcomponent.RecoveryDevice;
7 import net.sf.openrocket.simulation.FlightEvent;
8 import net.sf.openrocket.simulation.SimulationStatus;
9 import net.sf.openrocket.simulation.exception.SimulationException;
11 public interface SimulationEventListener {
15 * Called before adding a flight event to the event queue.
17 * @param status the simulation status
18 * @param event the event that is being added
19 * @return <code>true</code> to add the event,
20 * <code>false</code> to abort adding event to event queue
22 public boolean addFlightEvent(SimulationStatus status, FlightEvent event) throws SimulationException;
27 * Called before handling a flight event.
29 * @param status the simulation status
30 * @param event the event that is taking place
31 * @return <code>true</code> to continue handling the event,
32 * <code>false</code> to abort handling
34 public boolean handleFlightEvent(SimulationStatus status, FlightEvent event) throws SimulationException;
38 * Motor ignition event.
40 * @param status the simulation status
41 * @param motorId the motor id in the MotorInstanceConfiguration
42 * @param mount the motor mount containing the motor
43 * @param instance the motor instance being ignited
44 * @return <code>true</code> to ignite the motor, <code>false</code> to abort ignition
46 public boolean motorIgnition(SimulationStatus status, MotorId motorId, MotorMount mount,
47 MotorInstance instance) throws SimulationException;
51 * Recovery device deployment.
53 * @param status the simulation status
54 * @param recoveryDevice the recovery device that is being deployed.
55 * @return <code>true</code> to deploy the recovery device, <code>false</code> to abort deployment
57 public boolean recoveryDeviceDeployment(SimulationStatus status, RecoveryDevice recoveryDevice)
58 throws SimulationException;