- Implemented a DampingMoment simulation listener example
[debian/openrocket] / core / src / net / sf / openrocket / simulation / listeners / SimulationEventListener.java
1 package net.sf.openrocket.simulation.listeners;
2
3 import java.util.List;
4
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;
13
14 public interface SimulationEventListener {
15         
16
17         /**
18          * Called before adding a flight event to the event queue.
19          * 
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
24          */
25         public boolean addFlightEvent(SimulationStatus status, FlightEvent event) throws SimulationException;
26         
27         
28
29         /**
30          * Called before handling a flight event.
31          * 
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
36          */
37         public boolean handleFlightEvent(SimulationStatus status, FlightEvent event) throws SimulationException;
38         
39         
40         /**
41          * Motor ignition event.
42          * 
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
48          */
49         public boolean motorIgnition(SimulationStatus status, MotorId motorId, MotorMount mount,
50                         MotorInstance instance) throws SimulationException;
51         
52         
53         /**
54          * Recovery device deployment.
55          * 
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
59          */
60         public boolean recoveryDeviceDeployment(SimulationStatus status, RecoveryDevice recoveryDevice)
61                         throws SimulationException;
62
63
64
65         public FlightDataType[] getFlightDataTypes();
66         
67
68 }