6cbb87f3ba23d91cfca35965fe06dd77678ef4cf
[debian/openrocket] / core / src / net / sf / openrocket / simulation / listeners / SimulationEventListener.java
1 package net.sf.openrocket.simulation.listeners;
2
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;
10
11 public interface SimulationEventListener {
12         
13
14         /**
15          * Called before adding a flight event to the event queue.
16          * 
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
21          */
22         public boolean addFlightEvent(SimulationStatus status, FlightEvent event) throws SimulationException;
23         
24         
25
26         /**
27          * Called before handling a flight event.
28          * 
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
33          */
34         public boolean handleFlightEvent(SimulationStatus status, FlightEvent event) throws SimulationException;
35         
36         
37         /**
38          * Motor ignition event.
39          * 
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
45          */
46         public boolean motorIgnition(SimulationStatus status, MotorId motorId, MotorMount mount,
47                         MotorInstance instance) throws SimulationException;
48         
49         
50         /**
51          * Recovery device deployment.
52          * 
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
56          */
57         public boolean recoveryDeviceDeployment(SimulationStatus status, RecoveryDevice recoveryDevice)
58                         throws SimulationException;
59         
60
61 }