]> git.gag.com Git - debian/openrocket/commitdiff
Fix to streamer loading of materials; missing material in Giant Leaps file.
authorrodinia814 <rodinia814@180e2498-e6e9-4542-8430-84ac67f01cd8>
Mon, 21 May 2012 04:36:20 +0000 (04:36 +0000)
committerrodinia814 <rodinia814@180e2498-e6e9-4542-8430-84ac67f01cd8>
Mon, 21 May 2012 04:36:20 +0000 (04:36 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@695 180e2498-e6e9-4542-8430-84ac67f01cd8

core/resources-src/datafiles/rocksim_components/giantleaprocketry/MATERIAL.CSV
core/src/net/sf/openrocket/preset/loader/StreamerLoader.java

index 1fb18038b26d20951cee3bf3fba0a8ed698be025..462e87db004a56a29fe34b285223e0f724b6f137 100644 (file)
@@ -3,3 +3,4 @@ Cardboard,lb/ft3,43,,,,1,1,1,1,0,1,0,0,1,1,1,1,1,1,,,,,,,,None,0,0
 Birch,lb/ft3,42.5,,,Wood,1,0,1,0,0,1,0,1,1,1,1,1,0,0,,,,,,,,None,0,0
 Kraft phenolic,lb/ft3,59.85,,,,1,1,0,0,0,0,0,0,0,1,0,0,1,1,,,,,,,,None,0,0
 Polycarbonate,lb/ft3,74.9,,,,1,1,1,1,0,1,0,0,1,1,1,1,1,1,,,,,,,,None,0,0
+Rip stop nylon,g/cm2,0.006685,,,,1,0,0,0,0,0,1,1,0,0,0,0,0,0,,,,,,,,None,0,0
index 4a2f38a92f2598dd94c1d5111b4950c0d4a18805..652b2d42fc1e5339e4b31d02ce6ef7003a22b5cc 100644 (file)
@@ -11,9 +11,19 @@ public class StreamerLoader extends BaseComponentLoader {
 
        private final MaterialHolder materials;
 
-       public StreamerLoader(MaterialHolder materials, File theBasePath) {
-               super(materials, theBasePath);
-               this.materials = materials;
+       public StreamerLoader(MaterialHolder theMaterials, File theBasePath) {
+               super(theMaterials, theBasePath);
+               materials = theMaterials;
+
+        //The base component loader adds a bulk material loader, which is incompatible with the surface loader
+        //for a streamer.  Remove the file column parser here so we can set your own in the code that follows.
+        for (int i = 0; i < fileColumns.size(); i++) {
+            RocksimComponentFileColumnParser rocksimComponentFileColumnParser = fileColumns.get(i);
+            if (rocksimComponentFileColumnParser instanceof MaterialColumnParser) {
+                fileColumns.remove(rocksimComponentFileColumnParser);
+            }
+        }
+
                fileColumns.add(new SurfaceMaterialColumnParser(materials,"Material",ComponentPreset.MATERIAL));
                fileColumns.add(new DoubleUnitColumnParser("Length","Units",ComponentPreset.LENGTH));
                fileColumns.add(new DoubleUnitColumnParser("Width","Units",ComponentPreset.WIDTH));