1 package net.sf.openrocket.simulation;
3 import java.util.Collection;
5 import net.sf.openrocket.aerodynamics.AerodynamicForces;
6 import net.sf.openrocket.aerodynamics.FlightConditions;
7 import net.sf.openrocket.simulation.exception.SimulationException;
11 public interface SimulationListener {
14 public void flightConditions(SimulationStatus status, FlightConditions conditions)
15 throws SimulationException;
18 public void forceCalculation(SimulationStatus status, FlightConditions conditions,
19 AerodynamicForces forces) throws SimulationException;
23 * Called every time a simulation step has been taken. The parameter contains the
24 * simulation status. This method may abort the simulation by returning a
25 * <code>SIMULATION_END</code> event. Note that this event and all others within
26 * the current time are still handled, so be careful not to create an infinite loop
29 * @param status the current flight status.
30 * @return new flight events to handle, or <code>null</code> for none.
32 public Collection<FlightEvent> stepTaken(SimulationStatus status)
33 throws SimulationException;
37 * Called every time an event is handled by the simulation system. The parameters
38 * contain the event and current simulation status. This method may abort the
39 * simulation by returning a <code>SIMULATION_END</code> event. Note that this
40 * event and all others within the current time are still handled, so be careful
41 * not to create an infinite loop of events.
43 * @param event the event that triggered this call.
44 * @param status the current flight status.
45 * @return new flight events to handle, or <code>null</code> for none.
47 public Collection<FlightEvent> handleEvent(FlightEvent event, SimulationStatus status)
48 throws SimulationException;