Updates for 0.9.5
[debian/openrocket] / src / net / sf / openrocket / simulation / SimulationStatus.java
1 package net.sf.openrocket.simulation;
2
3 import java.util.HashSet;
4 import java.util.Set;
5
6 import net.sf.openrocket.aerodynamics.GravityModel;
7 import net.sf.openrocket.aerodynamics.WarningSet;
8 import net.sf.openrocket.aerodynamics.WindSimulator;
9 import net.sf.openrocket.rocketcomponent.Configuration;
10 import net.sf.openrocket.rocketcomponent.RecoveryDevice;
11 import net.sf.openrocket.util.BugException;
12 import net.sf.openrocket.util.Coordinate;
13
14
15 public class SimulationStatus implements Cloneable {
16         
17         public SimulationConditions startConditions;
18
19         public double time;
20         public Configuration configuration;
21         public FlightDataBranch flightData;
22         
23         public Coordinate position;
24         public Coordinate velocity;
25         
26         public WindSimulator windSimulator;
27         public GravityModel gravityModel;
28         
29         public double launchRodLength;
30         
31         
32         /** Nanosecond time when the simulation was started. */
33         public long simulationStartTime = Long.MIN_VALUE;
34         
35         
36         /** Set to true when a motor has ignited. */
37         public boolean motorIgnited = false;
38         
39         /** Set to true when the rocket has risen from the ground. */
40         public boolean liftoff = false;
41         
42         /** <code>true</code> while the rocket is on the launch rod. */
43         public boolean launchRod = true;
44
45         /** Set to true when apogee has been detected. */
46         public boolean apogeeReached = false;
47          
48         /** Contains a list of deployed recovery devices. */
49         public final Set<RecoveryDevice> deployedRecoveryDevices = new HashSet<RecoveryDevice>();
50         
51         
52         public WarningSet warnings;
53         
54         
55         /** Available for special purposes by the listeners. */
56         public Object extra = null;
57         
58         
59         /**
60          * Returns a (shallow) copy of this object.  The general purpose is that the 
61          * conditions, flight data etc. point to the same objects.  However, subclasses 
62          * are allowed to deep-clone specific objects, such as those pertaining to the 
63          * current orientation of the rocket.
64          */
65         @Override
66         public SimulationStatus clone() {
67                 try {
68                         return (SimulationStatus) super.clone();
69                 } catch (CloneNotSupportedException e) {
70                         throw new BugException("BUG:  CloneNotSupportedException?!?",e);
71                 }
72         }
73 }