New panels.
[sw/motorsim] / src / com / billkuker / rocketry / motorsim / Burn.java
index b0958e9476c55146d019c95c0bbff80a150c5039..f02d8ac00a636683bb8c174b2340baa32079b735 100644 (file)
@@ -24,8 +24,10 @@ import org.jscience.physics.amount.Amount;
 import org.jscience.physics.amount.Constants;\r
 \r
 import com.billkuker.rocketry.motorsim.fuel.KNSU;\r
+import com.billkuker.rocketry.motorsim.grain.BurnPanel;\r
 import com.billkuker.rocketry.motorsim.grain.CoredCylindricalGrain;\r
 import com.billkuker.rocketry.motorsim.grain.ExtrudedGrain;\r
+import com.billkuker.rocketry.motorsim.grain.GrainPanel;\r
 import com.billkuker.rocketry.motorsim.visual.Chart;\r
 \r
 public class Burn {\r
@@ -40,10 +42,10 @@ public class Burn {
        \r
        private static double densityRatio = 0.96;\r
        \r
-       protected class Interval{\r
+       public class Interval{\r
                Amount<Duration> time;\r
-               Amount<Length> regression;\r
-               Amount<Pressure> chamberPressure;\r
+               public Amount<Length> regression;\r
+               public Amount<Pressure> chamberPressure;\r
                Amount<Mass> chamberProduct;\r
                Amount<Force> thrust;\r
 \r
@@ -54,6 +56,18 @@ public class Burn {
        \r
        protected SortedMap<Amount<Duration>,Interval> data = new TreeMap<Amount<Duration>, Interval>();\r
        \r
+       public SortedMap<Amount<Duration>,Interval> getData(){\r
+               return data;\r
+       }\r
+       \r
+       public Motor getMotor(){\r
+               return motor;\r
+       }\r
+\r
+       public Amount<Duration> burnTime(){\r
+               return data.lastKey();\r
+       }\r
+       \r
        public Burn(Motor m){\r
                motor = m;\r
        }\r
@@ -216,7 +230,7 @@ public class Burn {
                g.setID(Amount.valueOf(10, SI.MILLIMETER));\r
                m.setGrain(g);\r
                \r
-               m.setGrain(new ExtrudedGrain());\r
+               //m.setGrain(new ExtrudedGrain());\r
                \r
                ConvergentDivergentNozzle n = new ConvergentDivergentNozzle();\r
                n.setThroatDiameter(Amount.valueOf(6.600, SI.MILLIMETER));\r
@@ -228,6 +242,8 @@ public class Burn {
                \r
                b.burn();\r
                \r
+               new BurnPanel(b).show();\r
+               /*\r
                Chart<Duration, Pressure> r = new Chart<Duration, Pressure>(\r
                                SI.SECOND,\r
                                SI.MEGA(SI.PASCAL),\r
@@ -244,19 +260,7 @@ public class Burn {
                t.setDomain(b.data.keySet());\r
                t.show();\r
                \r
-               /*\r
-               Chart<Length, Area> s = new Chart<Length, Area>(SI.MILLIMETER,\r
-                               SI.MILLIMETER.pow(2).asType(Area.class), g, "surfaceArea");\r
-               s.setDomain(s.new IntervalDomain(Amount.valueOf(0, SI.CENTIMETER), g\r
-                               .webThickness()));\r
-               s.show();\r
-               */\r
-               \r
-               Chart<Length, Dimensionless> kn = new Chart<Length, Dimensionless>(SI.MILLIMETER,\r
-                               Dimensionless.UNIT, b, "kn");\r
-               kn.setDomain(kn.new IntervalDomain(Amount.valueOf(0, SI.CENTIMETER), m.getGrain()\r
-                               .webThickness()));\r
-               kn.show();\r
+               new GrainPanel( m.getGrain() ).show();*/\r
                \r
        }\r
 }\r