1 package net.sf.openrocket.simulation.listeners;
5 import net.sf.openrocket.motor.MotorId;
6 import net.sf.openrocket.motor.MotorInstance;
7 import net.sf.openrocket.rocketcomponent.MotorMount;
8 import net.sf.openrocket.rocketcomponent.RecoveryDevice;
9 import net.sf.openrocket.simulation.FlightDataType;
10 import net.sf.openrocket.simulation.FlightEvent;
11 import net.sf.openrocket.simulation.SimulationStatus;
12 import net.sf.openrocket.simulation.exception.SimulationException;
14 public interface SimulationEventListener {
18 * Called before adding a flight event to the event queue.
20 * @param status the simulation status
21 * @param event the event that is being added
22 * @return <code>true</code> to add the event,
23 * <code>false</code> to abort adding event to event queue
25 public boolean addFlightEvent(SimulationStatus status, FlightEvent event) throws SimulationException;
30 * Called before handling a flight event.
32 * @param status the simulation status
33 * @param event the event that is taking place
34 * @return <code>true</code> to continue handling the event,
35 * <code>false</code> to abort handling
37 public boolean handleFlightEvent(SimulationStatus status, FlightEvent event) throws SimulationException;
41 * Motor ignition event.
43 * @param status the simulation status
44 * @param motorId the motor id in the MotorInstanceConfiguration
45 * @param mount the motor mount containing the motor
46 * @param instance the motor instance being ignited
47 * @return <code>true</code> to ignite the motor, <code>false</code> to abort ignition
49 public boolean motorIgnition(SimulationStatus status, MotorId motorId, MotorMount mount,
50 MotorInstance instance) throws SimulationException;
54 * Recovery device deployment.
56 * @param status the simulation status
57 * @param recoveryDevice the recovery device that is being deployed.
58 * @return <code>true</code> to deploy the recovery device, <code>false</code> to abort deployment
60 public boolean recoveryDeviceDeployment(SimulationStatus status, RecoveryDevice recoveryDevice)
61 throws SimulationException;
65 public FlightDataType[] getFlightDataTypes();