Fix to streamer loading of materials; missing material in Giant Leaps file.

This commit is contained in:
Doug Pedrick 2012-05-21 04:36:20 +00:00
parent 798f631259
commit e3f173d83e
2 changed files with 14 additions and 3 deletions

View 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

1 Material Name Units Density Low High Class Rocketry Use Body Tubes Fin Sets Launch Lugs Cords Nose Chute Stream Trans Ring Bulkhead Engine Block Sleeve Tube Coupler spare spare spare spare spare spare spare Known Dim type Known Dim Units Known Dim Value
3 Birch lb/ft3 42.5 Wood 1 0 1 0 0 1 0 1 1 1 1 1 0 0 None 0 0
4 Kraft phenolic lb/ft3 59.85 1 1 0 0 0 0 0 0 0 1 0 0 1 1 None 0 0
5 Polycarbonate lb/ft3 74.9 1 1 1 1 0 1 0 0 1 1 1 1 1 1 None 0 0
6 Rip stop nylon g/cm2 0.006685 1 0 0 0 0 0 1 1 0 0 0 0 0 0 None 0 0

View 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));