create changelog entry
[debian/openrocket] / core / src / net / sf / openrocket / motor / Motor.java
1 package net.sf.openrocket.motor;
2
3 import net.sf.openrocket.util.Coordinate;
4
5 public interface Motor {
6         
7         /**
8          * Enum of rocket motor types.
9          * 
10          * @author Sampo Niskanen <sampo.niskanen@iki.fi>
11          */
12         public enum Type {
13                 SINGLE("Single-use", "Single-use solid propellant motor"),
14                 RELOAD("Reloadable", "Reloadable solid propellant motor"),
15                 HYBRID("Hybrid", "Hybrid rocket motor engine"),
16                 UNKNOWN("Unknown", "Unknown motor type");
17                 
18                 private final String name;
19                 private final String description;
20                 
21                 Type(String name, String description) {
22                         this.name = name;
23                         this.description = description;
24                 }
25                 
26                 
27                 /**
28                  * Return a short name of this motor type.
29                  * @return  a short name of the motor type.
30                  */
31                 public String getName() {
32                         return name;
33                 }
34                 
35                 /**
36                  * Return a long description of this motor type.
37                  * @return  a description of the motor type.
38                  */
39                 public String getDescription() {
40                         return description;
41                 }
42                 
43                 @Override
44                 public String toString() {
45                         return name;
46                 }
47         }
48         
49         
50         /**
51          * Ejection charge delay value signifying a "plugged" motor with no ejection charge.
52          * The value is that of <code>Double.POSITIVE_INFINITY</code>.
53          */
54         public static final double PLUGGED = Double.POSITIVE_INFINITY;
55         
56         
57         /**
58          * Below what portion of maximum thrust is the motor chosen to be off when
59          * calculating average thrust and burn time.  NFPA 1125 defines the "official"
60          * burn time to be the time which the motor produces over 5% of its maximum thrust.
61          */
62         public static final double MARGINAL_THRUST = 0.05;
63         
64         
65         
66         /**
67          * Return the motor type.
68          * 
69          * @return  the motorType
70          */
71         public Type getMotorType();
72         
73         
74         /**
75          * Return the designation of the motor.
76          * 
77          * @return the designation
78          */
79         public String getDesignation();
80         
81         /**
82          * Return the designation of the motor, including a delay.
83          * 
84          * @param delay  the delay of the motor.
85          * @return               designation with delay.
86          */
87         public String getDesignation(double delay);
88         
89         
90         /**
91          * Return extra description for the motor.  This may include for example 
92          * comments on the source of the thrust curve.  The returned <code>String</code>
93          * may include new-lines.
94          * 
95          * @return the description
96          */
97         public String getDescription();
98         
99         
100         /**
101          * Return the maximum diameter of the motor.
102          * 
103          * @return the diameter
104          */
105         public double getDiameter();
106         
107         /**
108          * Return the length of the motor.  This should be a "characteristic" length,
109          * and the exact definition may depend on the motor type.  Typically this should
110          * be the length from the bottom of the motor to the end of the maximum diameter
111          * portion, ignoring any smaller ejection charge compartments.
112          * 
113          * @return the length
114          */
115         public double getLength();
116         
117         public String getDigest();
118         
119         public MotorInstance getInstance();
120         
121         
122         public Coordinate getLaunchCG();
123         
124         public Coordinate getEmptyCG();
125         
126         
127         /**
128          * Return an estimate of the burn time of this motor, or NaN if an estimate is unavailable.
129          */
130         public double getBurnTimeEstimate();
131         
132         /**
133          * Return an estimate of the average thrust of this motor, or NaN if an estimate is unavailable.
134          */
135         public double getAverageThrustEstimate();
136         
137         /**
138          * Return an estimate of the maximum thrust of this motor, or NaN if an estimate is unavailable.
139          */
140         public double getMaxThrustEstimate();
141         
142         /**
143          * Return an estimate of the total impulse of this motor, or NaN if an estimate is unavailable.
144          */
145         public double getTotalImpulseEstimate();
146         
147 }