From: rodinia814 Date: Sun, 22 Apr 2012 03:11:13 +0000 (+0000) Subject: Initial Rocksim CSV parsing support for materials and components. X-Git-Tag: upstream/12.09^2~340 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=35c563077bab39d0f2da4e376f962aed32041a98;p=debian%2Fopenrocket Initial Rocksim CSV parsing support for materials and components. git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@581 180e2498-e6e9-4542-8430-84ac67f01cd8 --- diff --git a/core/resources-src/datafiles/rocksim_components/bms/MATERIAL.CSV b/core/resources-src/datafiles/rocksim_components/bms/MATERIAL.CSV index 9c171a27..f062f557 100644 --- a/core/resources-src/datafiles/rocksim_components/bms/MATERIAL.CSV +++ b/core/resources-src/datafiles/rocksim_components/bms/MATERIAL.CSV @@ -1,4 +1,5 @@ Material Name,Units,Density,Low,High,Class,Rocketry Use,Body Tubes,Fin Sets,Launch Lugs,Cords,Nose,Chute,Streamer,Trans,Ring,Bulkhead,Engine Block,Sleeve,Tube Coupler,spare,spare,spare,spare,spare,spare,spare,Fixed dim type,Fixed dim units,Fixed dim value, Fiber,lb/ft3,41,,,,1,0,0,0,0,0,0,0,0,1,1,0,0,0,,,,,,,,None,In.,0 lite ply,lb/ft3,22,,,,1,0,1,0,0,0,0,0,0,1,1,1,0,0,,,,,,,,None,In.,0 - +Balsa,lb/ft3,8,,,Wood,1,1,1,0,0,1,0,0,1,1,1,1,0,0,,,,,,,,None,0,0 +Paper,lb/ft3,70,,,,1,1,1,1,0,1,0,1,1,1,1,1,1,1,,,,,,,,None,0,0 diff --git a/core/resources-src/datafiles/rocksim_components/bms/TRdata.csv b/core/resources-src/datafiles/rocksim_components/bms/TRdata.csv index a3678ffb..8b22bf55 100644 --- a/core/resources-src/datafiles/rocksim_components/bms/TRdata.csv +++ b/core/resources-src/datafiles/rocksim_components/bms/TRdata.csv @@ -4,18 +4,18 @@ BalsaMachining.com,BMS50V2B,V2 Boat-tail with bored BT5 hole,in.,0.50,0.95,0.97, BalsaMachining.com,BMS60V2B,V2 Boat-tail with bored BT20 hole,in.,0.50,1.59,1.63,3.70,1.05,0.73,0.00,0.00,,solid,Balsa,0,,0,Ogive,0 BalsaMachining.com,BMSV2BT1,V2 Boat-tail with bored BT50 hole,in.,0.50,1.59,1.63,3.70,1.11,0.97,0.00,0.00,,solid,Balsa,0,,0,Ogive,0 BalsaMachining.com,BTC55Z,V2 Boat-tail with bored BT20 hole,in.,0.50,1.28,1.32,3.00,0.97,0.73,0.00,0.00,,solid,Balsa,0,,0,Ogive,0 -BalsaMachining.com,TA2050,Transition T20 to T50 2 in long,in.,0.50,0.71,0.73,2.00,0.97,,0.50,0.71,,solid,Balsa,0,oz.,0,Conical,0 -BalsaMachining.com,TA2050A,Transition T20 to T50 1 in long,in.,0.50,0.71,0.73,1.00,0.97,,0.75,0.95,,solid,Balsa,0,oz.,0,Conical,0 -BalsaMachining.com,TA2055,Transition T20 to T55 1.5 in long,in.,0.50,0.71,0.73,1.50,1.63,,0.75,1.28,,solid,Balsa,0,oz.,0,Conical,0 -BalsaMachining.com,TA2060,Transition T20 to T80 0.84 in long,in.,0.75,0.71,0.73,0.84,2.60,,0.75,2.55,,solid,Balsa,0,oz.,0,Conical,0 -BalsaMachining.com,TA5055,Transition T50 to T55 1 in long,in.,0.75,0.95,0.97,1.00,1.63,,0.75,1.28,,solid,Balsa,0,oz.,0,Conical,0 -BalsaMachining.com,TA5055L,Transiition T50 to T55 1.5 in long,in.,0.75,0.95,0.97,1.50,1.63,,0.75,1.28,,solid,Balsa,0,oz.,0,Conical,0 -BalsaMachining.com,TA5060,Transition T50 to T60 2 in long,in.,0.75,0.95,0.97,2.00,1.63,,0.75,1.59,,solid,Balsa,0,oz.,0,Conical,0 -BalsaMachining.com,TA520,Transition T5 to T20 0.78 in long,in.,0.50,0.51,0.54,0.78,0.73,,0.50,0.71,,solid,Balsa,0,oz.,0,Conical,0 -BalsaMachining.com,TA550,Transition T5 to T50 1 in long,in.,0.50,0.51,0.54,1.00,0.97,,0.50,0.95,,solid,Balsa,0,oz.,0,Conical,0 -BalsaMachining.com,TA555,Transiition T5 to T55 2.75 in long,in.,0.75,0.51,0.54,2.75,1.63,,0.75,1.28,,solid,Balsa,0,oz.,0,Conical,0 -BalsaMachining.com,TA5560,Transition T55 to T60 1 long,in.,1.00,1.28,1.63,1.00,1.63,,1.00,1.59,,solid,Balsa,0,oz.,0,Conical,0 -BalsaMachining.com,TA5560A,Transition T55 to T60 1.3 in long,in.,0.75,1.28,1.63,1.30,1.63,,0.75,1.59,,solid,Balsa,0,oz.,0,Conical,0 -BalsaMachining.com,TA6070,Transition T60 to T70 1.75 in long,in.,0.60,1.59,1.63,1.50,2.21,,0.60,2.17,,solid,Balsa,0,oz.,0,Conical,0 -BalsaMachining.com,TA6080,Transition T60 to T80 2.25 in long,in.,1.25,1.59,1.63,2.25,2.60,,1.50,2.55,,solid,Balsa,0,oz.,0,Conical,0 -BalsaMachining.com,TA7080,Transition T70 to T80 2 in long,in.,1.40,2.17,2.21,2.00,2.60,,1.40,2.55,,solid,Balsa,0,oz.,0,Conical,0 +BalsaMachining.com,TA2050,Transition T20 to T50 2 in long,in.,0.50,0.71,0.73,2.00,0.97,0,0.50,0.71,,solid,Balsa,0,oz.,0,Conical,0 +BalsaMachining.com,TA2050A,Transition T20 to T50 1 in long,in.,0.50,0.71,0.73,1.00,0.97,0,0.75,0.95,,solid,Balsa,0,oz.,0,Conical,0 +BalsaMachining.com,TA2055,Transition T20 to T55 1.5 in long,in.,0.50,0.71,0.73,1.50,1.63,0,0.75,1.28,,solid,Balsa,0,oz.,0,Conical,0 +BalsaMachining.com,TA2060,Transition T20 to T80 0.84 in long,in.,0.75,0.71,0.73,0.84,2.60,0,0.75,2.55,,solid,Balsa,0,oz.,0,Conical,0 +BalsaMachining.com,TA5055,Transition T50 to T55 1 in long,in.,0.75,0.95,0.97,1.00,1.63,0,0.75,1.28,,solid,Balsa,0,oz.,0,Conical,0 +BalsaMachining.com,TA5055L,Transiition T50 to T55 1.5 in long,in.,0.75,0.95,0.97,1.50,1.63,0,0.75,1.28,,solid,Balsa,0,oz.,0,Conical,0 +BalsaMachining.com,TA5060,Transition T50 to T60 2 in long,in.,0.75,0.95,0.97,2.00,1.63,0,0.75,1.59,,solid,Balsa,0,oz.,0,Conical,0 +BalsaMachining.com,TA520,Transition T5 to T20 0.78 in long,in.,0.50,0.51,0.54,0.78,0.73,0,0.50,0.71,,solid,Balsa,0,oz.,0,Conical,0 +BalsaMachining.com,TA550,Transition T5 to T50 1 in long,in.,0.50,0.51,0.54,1.00,0.97,0,0.50,0.95,,solid,Balsa,0,oz.,0,Conical,0 +BalsaMachining.com,TA555,Transiition T5 to T55 2.75 in long,in.,0.75,0.51,0.54,2.75,1.63,0,0.75,1.28,,solid,Balsa,0,oz.,0,Conical,0 +BalsaMachining.com,TA5560,Transition T55 to T60 1 long,in.,1.00,1.28,1.63,1.00,1.63,0,1.00,1.59,,solid,Balsa,0,oz.,0,Conical,0 +BalsaMachining.com,TA5560A,Transition T55 to T60 1.3 in long,in.,0.75,1.28,1.63,1.30,1.63,0,0.75,1.59,,solid,Balsa,0,oz.,0,Conical,0 +BalsaMachining.com,TA6070,Transition T60 to T70 1.75 in long,in.,0.60,1.59,1.63,1.50,2.21,0,0.60,2.17,,solid,Balsa,0,oz.,0,Conical,0 +BalsaMachining.com,TA6080,Transition T60 to T80 2.25 in long,in.,1.25,1.59,1.63,2.25,2.60,0,1.50,2.55,,solid,Balsa,0,oz.,0,Conical,0 +BalsaMachining.com,TA7080,Transition T70 to T80 2 in long,in.,1.40,2.17,2.21,2.00,2.60,0,1.40,2.55,,solid,Balsa,0,oz.,0,Conical,0 diff --git a/core/resources-src/datafiles/rocksim_components/giantleaprocketry/MATERIAL.CSV b/core/resources-src/datafiles/rocksim_components/giantleaprocketry/MATERIAL.CSV new file mode 100644 index 00000000..1fb18038 --- /dev/null +++ b/core/resources-src/datafiles/rocksim_components/giantleaprocketry/MATERIAL.CSV @@ -0,0 +1,5 @@ +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 +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 diff --git a/core/resources-src/datafiles/rocksim_components/performancerocketry/BHDATA.CSV b/core/resources-src/datafiles/rocksim_components/performancerocketry/BHDATA.CSV index e58fb05c..775eb026 100644 --- a/core/resources-src/datafiles/rocksim_components/performancerocketry/BHDATA.CSV +++ b/core/resources-src/datafiles/rocksim_components/performancerocketry/BHDATA.CSV @@ -1,24 +1,24 @@ Mfg.,Part No.,Desc.,Units,ID,OD,Length,Material,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine,Engine -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 38mm x 3/32 Airframe,in,0,1.52,0.094,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 38mm x 3/32 Coupler,in,0,1.37,0.094,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 54mm x 3/32 Airframe,in,0,2.152,0.094,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 54mm x 3/32 Coupler,in,0,2,0.094,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 3in x 3/32 Airframe,in,0,3,0.094,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 3in x 3/32 Coupler,in,0,2.875,0.094,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 4 in x 3/32 Airframe,in,0,3.9,0.094,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 4 in x 3/32 Coupler,in,0,3.775,0.094,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 5in x 1/8 Airframe,in,0,5,0.125,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 5in x 1/8 Coupler,in,0,4.85,0.125,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 5.5in x 1/8 Airframe,in,0,5.375,0.125,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 5.5in x 1/8 Coupler,in,0,5.225,0.125,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 6in x 1/8 Airframe,in,0,6,0.125,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 6in x 1/8 Coupler,in,0,5.775,0.125,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 7.5 inx 1/8 Airframe,in,0,7.518,0.125,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 7.5 inx 1/8 Coupler,in,0,7.33,0.125,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 8in x 1/8 Airframe,in,0,7.815,0.125,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 8in x 1/8 Coupler,in,0,7.815,0.125,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 9in x 1/8 Airframe,in,0,9,0.125,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G10 Bulkplate,G10 Fiberglass 11.5in x 3/16 Airframe,in,0,11.42,0.188,G10 fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 38mm x 3/32 Airframe,in,0,1.52,0.094,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 38mm x 3/32 Coupler,in,0,1.37,0.094,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 54mm x 3/32 Airframe,in,0,2.152,0.094,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 54mm x 3/32 Coupler,in,0,2,0.094,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 3in x 3/32 Airframe,in,0,3,0.094,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 3in x 3/32 Coupler,in,0,2.875,0.094,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 4 in x 3/32 Airframe,in,0,3.9,0.094,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 4 in x 3/32 Coupler,in,0,3.775,0.094,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 5in x 1/8 Airframe,in,0,5,0.125,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 5in x 1/8 Coupler,in,0,4.85,0.125,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 5.5in x 1/8 Airframe,in,0,5.375,0.125,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 5.5in x 1/8 Coupler,in,0,5.225,0.125,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 6in x 1/8 Airframe,in,0,6,0.125,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 6in x 1/8 Coupler,in,0,5.775,0.125,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 7.5 inx 1/8 Airframe,in,0,7.518,0.125,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 7.5 inx 1/8 Coupler,in,0,7.33,0.125,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 8in x 1/8 Airframe,in,0,7.815,0.125,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 8in x 1/8 Coupler,in,0,7.815,0.125,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 9in x 1/8 Airframe,in,0,9,0.125,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G10 Bulkplate,G10 Fiberglass 11.5in x 3/16 Airframe,in,0,11.42,0.188,G10 Fiberglass,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Performance Rocketry,Birch Bulkplate,Baltic Birch 54mm x 1/16,in,0,2.152,0.0625,Birch,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Performance Rocketry,Birch Bulkplate,Baltic Birch 2.5in x 1/16,in,0,2.5,0.0625,Birch,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Performance Rocketry,Birch Bulkplate,Baltic Birch 3in x 3/32,in,0,3,0.094,Birch,0,g,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, diff --git a/core/resources-src/datafiles/rocksim_components/performancerocketry/MATERIAL.CSV b/core/resources-src/datafiles/rocksim_components/performancerocketry/MATERIAL.CSV new file mode 100644 index 00000000..b8c21ee5 --- /dev/null +++ b/core/resources-src/datafiles/rocksim_components/performancerocketry/MATERIAL.CSV @@ -0,0 +1,7 @@ +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 +Birch,lb/ft3,42.5,,,Wood,1,0,1,0,0,1,0,1,1,1,1,1,0,0,,,,,,,,None,0,0 +Carbon Fiber,kg/m3,1400,,,,1,1,1,0,0,0,1,0,0,1,1,1,1,1,,,,,,,,None,0,0 +Fiberglass,kg/m3,128.147704,,,,1,1,1,0,0,1,0,0,1,1,1,1,1,1,,,,,,,,None,0,0 +G10 Fiberglass,lb/ft3,118.94,,,,1,1,1,0,0,1,0,0,0,1,1,1,1,1,,,,,,,,None,0,0 +G12 Fiberglass,lb/ft3,118.94,,,,1,1,1,0,0,1,0,0,0,1,1,1,1,1,,,,,,,,None,0,0 +Polystyrene PS,lb/ft3,65.5,,,,1,1,1,1,0,1,0,0,1,1,1,1,1,1,,,,,,,,None,0,0 diff --git a/core/resources-src/datafiles/rocksim_components/performancerocketry/NCDATA.CSV b/core/resources-src/datafiles/rocksim_components/performancerocketry/NCDATA.CSV index f80eee66..f4646d83 100644 --- a/core/resources-src/datafiles/rocksim_components/performancerocketry/NCDATA.CSV +++ b/core/resources-src/datafiles/rocksim_components/performancerocketry/NCDATA.CSV @@ -62,15 +62,15 @@ Performance Rocketry,11.5 in,Fiberglass Ogive 3:1,in,38,11.67,0,6,11.42,0.25,ogi Performance Rocketry,11.5 in,Fiberglass Conical 4:1,in,47.25,11.67,0,6,11.42,0.25,cone,hollow,G10 Fiberglass,,oz,0,0,,,,,,,,,,,,, Performance Rocketry,11.5 in,Fiberglass Nike Smoke,in,66.5,13.17,0,8,11.42,0.25,cone,hollow,G10 Fiberglass,,oz,0,3,,,,,,,,,,,,, Performance Rocketry,16.5 in,Fiberglass Nike Smoke 6:1,in,93.5,18.75,0,10,16.25,0.25,cone,hollow,G10 Fiberglass,,oz,0,4.5,,,,,,,,,,,,, -Performance Rocketry,24mm,Graphite Composite Conical 5:1,in,5.5,1.045,0,1.5,0.945,0.125,cone,hollow,Carbon fiber,,oz,0,0,,,,,,,,,,,,, -Performance Rocketry,38mm ,Graphite Composite Conical 5:1,in,8.19,1.645,0,1.52,1.52,0.125,cone,hollow,Carbon fiber,,oz,0,0,,,,,,,,,,,,, -Performance Rocketry,38mm,Graphite Composite Von Karman 5:1,in,8.19,1.645,0,1.52,1.52,0.125,sh,hollow,Carbon fiber,,oz,0,0,,,,,,,,,,,,, -Performance Rocketry,54mm,Graphite Composite Conical 5:1,in,11,2.279,0,2.88,2.154,0.125,cone,hollow,Carbon fiber,,oz,0,0.5,,,,,,,,,,,,, -Performance Rocketry,54mm,Graphite Composite Von Karman 5:1,in,11.5,2.279,0,2.88,2.154,0.125,sh,hollow,Carbon fiber,,oz,0,0,,,,,,,,,,,,, -Performance Rocketry,3 in,Graphite Composite Conical 5:1,in,15.5,3.125,0,3.25,3,0.125,cone,hollow,Carbon fiber,,oz,0,0,,,,,,,,,,,,, -Performance Rocketry,3 in,Graphite Composite Von Karman 5:1,in,15.5,3.125,0,3.25,3,0.125,sh,hollow,Carbon fiber,,oz,0,0,,,,,,,,,,,,, -Performance Rocketry,4 in,Graphite Composite Conical 5:1,in,20.125,4.15,0,4.5,3.9,0.125,cone,hollow,Carbon fiber,,oz,0,0,,,,,,,,,,,,, -Performance Rocketry,4 in,Graphite Composite Von Karman 5:1,in,20.125,4.15,0,4.5,3.9,0.125,sh,hollow,Carbon fiber,,oz,0,0,,,,,,,,,,,,, -Performance Rocketry,5.5 in,Graphite Composite Conical 5:1,in,27.75,5.525,0,6,5.375,0.125,cone,hollow,Carbon fiber,,oz,0,0,,,,,,,,,,,,, -Performance Rocketry,6 in,Graphite Composite Conical 5:1,in,31,6.17,0,6.5,6,0.125,cone,hollow,Carbon fiber,,oz,0,0,,,,,,,,,,,,, -Performance Rocketry,7.5 in,Graphite Composite Conical 5:1,in,39,7.708,0,8,7.518,0.125,cone,hollow,Carbon fiber,,oz,0,0,,,,,,,,,,,,, +Performance Rocketry,24mm,Graphite Composite Conical 5:1,in,5.5,1.045,0,1.5,0.945,0.125,cone,hollow,Carbon Fiber,,oz,0,0,,,,,,,,,,,,, +Performance Rocketry,38mm ,Graphite Composite Conical 5:1,in,8.19,1.645,0,1.52,1.52,0.125,cone,hollow,Carbon Fiber,,oz,0,0,,,,,,,,,,,,, +Performance Rocketry,38mm,Graphite Composite Von Karman 5:1,in,8.19,1.645,0,1.52,1.52,0.125,sh,hollow,Carbon Fiber,,oz,0,0,,,,,,,,,,,,, +Performance Rocketry,54mm,Graphite Composite Conical 5:1,in,11,2.279,0,2.88,2.154,0.125,cone,hollow,Carbon Fiber,,oz,0,0.5,,,,,,,,,,,,, +Performance Rocketry,54mm,Graphite Composite Von Karman 5:1,in,11.5,2.279,0,2.88,2.154,0.125,sh,hollow,Carbon Fiber,,oz,0,0,,,,,,,,,,,,, +Performance Rocketry,3 in,Graphite Composite Conical 5:1,in,15.5,3.125,0,3.25,3,0.125,cone,hollow,Carbon Fiber,,oz,0,0,,,,,,,,,,,,, +Performance Rocketry,3 in,Graphite Composite Von Karman 5:1,in,15.5,3.125,0,3.25,3,0.125,sh,hollow,Carbon Fiber,,oz,0,0,,,,,,,,,,,,, +Performance Rocketry,4 in,Graphite Composite Conical 5:1,in,20.125,4.15,0,4.5,3.9,0.125,cone,hollow,Carbon Fiber,,oz,0,0,,,,,,,,,,,,, +Performance Rocketry,4 in,Graphite Composite Von Karman 5:1,in,20.125,4.15,0,4.5,3.9,0.125,sh,hollow,Carbon Fiber,,oz,0,0,,,,,,,,,,,,, +Performance Rocketry,5.5 in,Graphite Composite Conical 5:1,in,27.75,5.525,0,6,5.375,0.125,cone,hollow,Carbon Fiber,,oz,0,0,,,,,,,,,,,,, +Performance Rocketry,6 in,Graphite Composite Conical 5:1,in,31,6.17,0,6.5,6,0.125,cone,hollow,Carbon Fiber,,oz,0,0,,,,,,,,,,,,, +Performance Rocketry,7.5 in,Graphite Composite Conical 5:1,in,39,7.708,0,8,7.518,0.125,cone,hollow,Carbon Fiber,,oz,0,0,,,,,,,,,,,,, diff --git a/core/resources-src/datafiles/rocksim_components/performancerocketry/TCDATA.CSV b/core/resources-src/datafiles/rocksim_components/performancerocketry/TCDATA.CSV index b228356b..f7ff7737 100644 --- a/core/resources-src/datafiles/rocksim_components/performancerocketry/TCDATA.CSV +++ b/core/resources-src/datafiles/rocksim_components/performancerocketry/TCDATA.CSV @@ -22,28 +22,28 @@ Performance Rocketry,Std. G10 Fiberglass Coupler,8 Inch Coupler/16in,in,7.518,7. Performance Rocketry,Std. G10 Fiberglass Coupler,8.25 Inch Coupler/16in,in,7.815,7.998,16,G10 Fiberglass,8,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Performance Rocketry,Std. G10 Fiberglass Coupler,9 Inch Coupler/16in,in,8.75,8.998,16,G10 Fiberglass,8,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Performance Rocketry,Std. G10 Fiberglass Coupler,11.5 Inch Coupler/24in,in,11.15,11.415,24,G10 Fiberglass,12,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,.94in Coupler/4in,in,0.75,0.943,4,G12 Fiberglass Filament Wound,2,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,1.14in Coupler/4in,in,1,1.143,4,G12 Fiberglass Filament Wound,2,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,1.52in Coupler/4in,in,1.37,1.518,4,G12 Fiberglass Filament Wound,2,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,2.15in Coupler/6in,in,2,2.15,6,G12 Fiberglass Filament Wound,3,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,2.15in Coupler Long/8in,in,2,2.15,8,G12 Fiberglass Filament Wound,4,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,2.5 Inch Coupler/6in,in,2.375,2.558,6,G12 Fiberglass Filament Wound,3,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,3 Inch Coupler/6in,in,2.875,2.998,6,G12 Fiberglass Filament Wound,3,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,3 Inch Coupler Long/9in,in,2.875,2.998,9,G12 Fiberglass Filament Wound,4.5,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,3.5 Inch Coupler/8in,in,3.25,3.398,8,G12 Fiberglass Filament Wound,4,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,4 Inch Coupler/9in,in,3.755,3.898,9,G12 Fiberglass Filament Wound,4.5,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,4 Inch Coupler Long/12in,in,3.755,3.898,12,G12 Fiberglass Filament Wound,6,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,4.1 Inch Coupler/9in,in,3.9,3.998,9,G12 Fiberglass Filament Wound,4.5,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,4.5 Inch Coupler/9in,in,4.25,4.373,9,G12 Fiberglass Filament Wound,4.5,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,5 Inch Coupler/12in,in,4.815,4.998,12,G12 Fiberglass Filament Wound,6,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,5 Inch Coupler Long/12in,in,4.815,4.998,12,G12 Fiberglass Filament Wound,6,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,5.5 Inch Coupler/12in,in,5.18,5.373,12,G12 Fiberglass Filament Wound,6,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,6 Inch Coupler/12in,in,5.775,5.998,12,G12 Fiberglass Filament Wound,6,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,6 Inch Coupler Long/18in,in,5.775,5.998,18,G12 Fiberglass Filament Wound,9,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,7 Inch Coupler/16in,in,6.5,6.808,16,G12 Fiberglass Filament Wound,8,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,7.5 Inch Coupler/16in,in,7.33,7.516,16,G12 Fiberglass Filament Wound,8,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,8 Inch Coupler/16in,in,7.518,7.813,16,G12 Fiberglass Filament Wound,8,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -Performance Rocketry,G12 Fiberglass FW Coupler,8.25 Inch Coupler/16in,in,7.815,7.998,16,G12 Fiberglass Filament Wound,8,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,.94in Coupler/4in,in,0.75,0.943,4,G12 Fiberglass,2,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,1.14in Coupler/4in,in,1,1.143,4,G12 Fiberglass,2,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,1.52in Coupler/4in,in,1.37,1.518,4,G12 Fiberglass,2,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,2.15in Coupler/6in,in,2,2.15,6,G12 Fiberglass,3,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,2.15in Coupler Long/8in,in,2,2.15,8,G12 Fiberglass,4,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,2.5 Inch Coupler/6in,in,2.375,2.558,6,G12 Fiberglass,3,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,3 Inch Coupler/6in,in,2.875,2.998,6,G12 Fiberglass,3,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,3 Inch Coupler Long/9in,in,2.875,2.998,9,G12 Fiberglass,4.5,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,3.5 Inch Coupler/8in,in,3.25,3.398,8,G12 Fiberglass,4,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,4 Inch Coupler/9in,in,3.755,3.898,9,G12 Fiberglass,4.5,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,4 Inch Coupler Long/12in,in,3.755,3.898,12,G12 Fiberglass,6,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,4.1 Inch Coupler/9in,in,3.9,3.998,9,G12 Fiberglass,4.5,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,4.5 Inch Coupler/9in,in,4.25,4.373,9,G12 Fiberglass,4.5,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,5 Inch Coupler/12in,in,4.815,4.998,12,G12 Fiberglass,6,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,5 Inch Coupler Long/12in,in,4.815,4.998,12,G12 Fiberglass,6,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,5.5 Inch Coupler/12in,in,5.18,5.373,12,G12 Fiberglass,6,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,6 Inch Coupler/12in,in,5.775,5.998,12,G12 Fiberglass,6,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,6 Inch Coupler Long/18in,in,5.775,5.998,18,G12 Fiberglass,9,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,7 Inch Coupler/16in,in,6.5,6.808,16,G12 Fiberglass,8,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,7.5 Inch Coupler/16in,in,7.33,7.516,16,G12 Fiberglass,8,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,8 Inch Coupler/16in,in,7.518,7.813,16,G12 Fiberglass,8,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Performance Rocketry,G12 Fiberglass FW Coupler,8.25 Inch Coupler/16in,in,7.815,7.998,16,G12 Fiberglass,8,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Performance Rocketry,Carbon Fiber FW Coupler,.94in Coupler/4in,in,0.75,0.943,4,Carbon Fiber,2,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Performance Rocketry,Carbon Fiber FW Coupler,1.14in Coupler/4in,in,1,1.143,4,Carbon Fiber,2,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Performance Rocketry,Carbon Fiber FW Coupler,1.52in Coupler/4in,in,1.37,1.518,4,Carbon Fiber,2,oz,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, diff --git a/core/resources-src/datafiles/rocksim_components/publicmissiles/MATERIAL.CSV b/core/resources-src/datafiles/rocksim_components/publicmissiles/MATERIAL.CSV index 91d43768..26894c9e 100644 --- a/core/resources-src/datafiles/rocksim_components/publicmissiles/MATERIAL.CSV +++ b/core/resources-src/datafiles/rocksim_components/publicmissiles/MATERIAL.CSV @@ -14,6 +14,7 @@ Copper (rolled),lb/ft3,556.,556.,556.,unknown,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0, Cork (Solid),lb/ft3,15,15,15,Wood,y,n,n,n,n,y,n,n,n,n,y,y,n,n,n,n,n,n,n,n,n,n,n,n Cottonwood,lb/ft3,25,25,25,Wood,n,y,y,y,n,y,y,y,y,y,y,y,y,y,n,n,n,n,n,n,n,n,n,n Epoxy,lb/ft3,78.3,78.3,78.3,Plastic,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n +Fiberglass,kg/m3,128.147704,n,n,n,1,1,1,0,0,1,0,0,1,1,1,1,1,1,n,n,n,n,n,n,n,None,0,0 Fir (Douglas),lb/ft3,35,35,35,Wood,y,n,y,n,n,y,n,n,y,y,y,y,n,n,n,n,n,n,n,n,n,n,n,n Fir (White),lb/ft3,25,25,25,Wood,y,n,y,n,n,y,n,n,y,y,y,y,n,n,n,n,n,n,n,n,n,n,n,n G10 fiberglass,lb/ft3,118.94,118.27,118.61,Plastic,y,n,y,n,n,n,n,n,n,y,y,y,n,n,n,n,n,n,n,n,n,n,n,n diff --git a/core/resources-src/datafiles/rocksim_components/semroc/MATERIAL.CSV b/core/resources-src/datafiles/rocksim_components/semroc/MATERIAL.CSV new file mode 100644 index 00000000..6ef5c8c6 --- /dev/null +++ b/core/resources-src/datafiles/rocksim_components/semroc/MATERIAL.CSV @@ -0,0 +1,7 @@ +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 +Balsa,lb/ft3,8,,,Wood,1,1,1,0,0,1,0,0,1,1,1,1,0,0,,,,,,,,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 +Spiral/Glassine,lb/ft3,53,,,,1,1,1,1,0,1,0,0,1,1,1,1,1,1,,,,,,,,None,0,0 +Fiber,lb/ft3,41,,,,1,0,0,0,0,0,0,0,0,1,1,0,0,0,,,,,,,,None,0,0 +lite ply,lb/ft3,22,,,Composite,1,0,1,0,0,0,0,0,0,1,1,1,0,0,,,,,,,,None,0,0 +Paper,lb/ft3,70,,,,1,1,1,1,0,1,0,1,1,1,1,1,1,1,,,,,,,,None,0,0 diff --git a/core/src/net/sf/openrocket/file/preset/ColumnDefinition.java b/core/src/net/sf/openrocket/file/preset/ColumnDefinition.java index 69286427..a7e7513a 100644 --- a/core/src/net/sf/openrocket/file/preset/ColumnDefinition.java +++ b/core/src/net/sf/openrocket/file/preset/ColumnDefinition.java @@ -22,6 +22,16 @@ public class ColumnDefinition { } } + public void setProperty(TypedPropertyMap preset, T value) { + if (value != null) { + preset.put(key, value); + } + } + + public TypedKey getKey() { + return key; + } + private static Object parseFromString( Class type, String value ) { if ( type.equals(Manufacturer.class)) { Manufacturer m = Manufacturer.getManufacturer(value); @@ -35,7 +45,12 @@ public class ColumnDefinition { return Boolean.parseBoolean(value); } if ( type.isAssignableFrom(Double.class) ) { - return Double.parseDouble(value); + try { + return Double.parseDouble(value); + } + catch (NumberFormatException nfe) { + return 0d; + } } if ( type.equals(String.class ) ) { return value; @@ -85,7 +100,7 @@ public class ColumnDefinition { } throw new IllegalArgumentException("Invalid type " + type.getName() + " for component preset parameter." ); } - + private static Material getMaterialFor( String translatedName ) { Material material; material = Databases.findMaterial(Material.Type.BULK, translatedName); diff --git a/core/src/net/sf/openrocket/file/rocksim/RocksimNoseConeCode.java b/core/src/net/sf/openrocket/file/rocksim/RocksimNoseConeCode.java index cd580ea1..8d24e244 100644 --- a/core/src/net/sf/openrocket/file/rocksim/RocksimNoseConeCode.java +++ b/core/src/net/sf/openrocket/file/rocksim/RocksimNoseConeCode.java @@ -5,38 +5,57 @@ package net.sf.openrocket.file.rocksim; import net.sf.openrocket.rocketcomponent.Transition; +import java.util.HashSet; +import java.util.Set; + /** * Models the nose cone shape of a rocket. Maps from Rocksim's notion to OpenRocket's. */ public enum RocksimNoseConeCode { - CONICAL (0, Transition.Shape.CONICAL), - OGIVE (1, Transition.Shape.OGIVE), - PARABOLIC (2, Transition.Shape.ELLIPSOID), //Rocksim' PARABOLIC most closely resembles an ELLIPSOID in OpenRocket - ELLIPTICAL (3, Transition.Shape.ELLIPSOID), - POWER_SERIES (4, Transition.Shape.POWER), + CONICAL(0, Transition.Shape.CONICAL, "Conic", "Cone"), + OGIVE(1, Transition.Shape.OGIVE), + PARABOLIC(2, Transition.Shape.ELLIPSOID), //Rocksim' PARABOLIC most closely resembles an ELLIPSOID in OpenRocket + ELLIPTICAL(3, Transition.Shape.ELLIPSOID), + POWER_SERIES(4, Transition.Shape.POWER), PARABOLIC_SERIES(5, Transition.Shape.PARABOLIC), - HAACK (6, Transition.Shape.HAACK); + HAACK(6, Transition.Shape.HAACK); - /** The Rocksim enumeration value. Sent in XML. */ + /** + * The Rocksim enumeration value. Sent in XML. + */ private final int ordinal; - - /** The corresponding OpenRocket shape. */ + + /** + * The corresponding OpenRocket shape. + */ private final Transition.Shape shape; + /** + * Names of the shape that are sometimes found in NCDATA.CSV + */ + private Set shapeNames = new HashSet(); + /** * Constructor. - * - * @param idx the Rocksim shape code - * @param aShape the corresponding OpenRocket shape + * + * @param idx the Rocksim shape code + * @param aShape the corresponding OpenRocket shape + * @param theShapeNames an array of alternate names */ - private RocksimNoseConeCode(int idx, Transition.Shape aShape) { + private RocksimNoseConeCode(int idx, Transition.Shape aShape, String... theShapeNames) { ordinal = idx; shape = aShape; + shapeNames.add(this.name().toLowerCase()); + if (theShapeNames != null) { + for (String theShapeName : theShapeNames) { + shapeNames.add(theShapeName.toLowerCase()); + } + } } /** * Get the OpenRocket shape that corresponds to the Rocksim shape. - * + * * @return a shape */ public Transition.Shape asOpenRocket() { @@ -45,8 +64,8 @@ public enum RocksimNoseConeCode { /** * Lookup an instance of this enum based upon the Rocksim code. - * - * @param rocksimShapeCode the Rocksim code (from XML) + * + * @param rocksimShapeCode the Rocksim code (from XML) * @return an instance of this enum */ public static RocksimNoseConeCode fromCode(int rocksimShapeCode) { @@ -61,9 +80,8 @@ public enum RocksimNoseConeCode { /** * Lookup an ordinal value for the Rocksim code. - * - * @param type the OR Shape - * + * + * @param type the OR Shape * @return the Rocksim code */ public static int toCode(Transition.Shape type) { @@ -78,4 +96,36 @@ public enum RocksimNoseConeCode { } return ELLIPTICAL.ordinal; //Default } + + /** + * Given the name of a shape, map it into an instance of this enum. + * + * @param theName the name of the shape; case does not matter + * @return the corresponding enum instance; defaults to PARABOLIC if not found. + */ + public static RocksimNoseConeCode fromShapeName(String theName) { + RocksimNoseConeCode[] values = values(); + for (RocksimNoseConeCode value : values) { + if (value.shapeNames.contains(theName.toLowerCase())) { + return value; + } + } + return PARABOLIC; //Default + } + + /** + * Convenience method that determines if the parameter is an integer that refers to a shape code, or the name + * of the shape itself. This basically combines fromCode and fromShapeName into one method. + * + * @param nameOrOrdinalString the shape number or shape name + * @return an instance of this enum; defaults to PARABOLIC if not found + */ + public static RocksimNoseConeCode fromShapeNameOrCode(String nameOrOrdinalString) { + try { + return fromCode(Integer.parseInt(nameOrOrdinalString)); + } + catch (NumberFormatException nfe) { + return fromShapeName(nameOrOrdinalString); + } + } } diff --git a/core/src/net/sf/openrocket/preset/ComponentPreset.java b/core/src/net/sf/openrocket/preset/ComponentPreset.java index d10a88b7..3da35755 100644 --- a/core/src/net/sf/openrocket/preset/ComponentPreset.java +++ b/core/src/net/sf/openrocket/preset/ComponentPreset.java @@ -1,5 +1,13 @@ package net.sf.openrocket.preset; +import net.sf.openrocket.material.Material; +import net.sf.openrocket.motor.Manufacturer; +import net.sf.openrocket.rocketcomponent.ExternalComponent.Finish; +import net.sf.openrocket.rocketcomponent.Transition.Shape; +import net.sf.openrocket.unit.UnitGroup; +import net.sf.openrocket.util.BugException; +import net.sf.openrocket.util.TextUtil; + import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.security.MessageDigest; @@ -11,21 +19,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import net.sf.openrocket.material.Material; -import net.sf.openrocket.motor.Manufacturer; -import net.sf.openrocket.rocketcomponent.ExternalComponent.Finish; -import net.sf.openrocket.rocketcomponent.Transition.Shape; -import net.sf.openrocket.unit.UnitGroup; -import net.sf.openrocket.util.BugException; -import net.sf.openrocket.util.TextUtil; - /** * A model for a preset component. *

* A preset component contains a component class type, manufacturer information, * part information, and a method that returns a prototype of the preset component. - * + * * @author Sampo Niskanen */ // FIXME - Implement clone. @@ -44,7 +44,7 @@ public class ComponentPreset implements Comparable { ComponentPreset.INNER_DIAMETER, ComponentPreset.OUTER_DIAMETER, ComponentPreset.LENGTH} ), - + NOSE_CONE( new TypedKey[] { ComponentPreset.MANUFACTURER, ComponentPreset.PARTNO, @@ -60,16 +60,20 @@ public class ComponentPreset implements Comparable { ComponentPreset.DESCRIPTION, ComponentPreset.SHAPE, ComponentPreset.FORE_OUTER_DIAMETER, - ComponentPreset.OUTER_DIAMETER, + ComponentPreset.FORE_SHOULDER_DIAMETER, + ComponentPreset.FORE_SHOULDER_LENGTH, + ComponentPreset.AFT_OUTER_DIAMETER, + ComponentPreset.AFT_SHOULDER_DIAMETER, + ComponentPreset.AFT_SHOULDER_LENGTH, ComponentPreset.LENGTH} ), - + TUBE_COUPLER( new TypedKey[] { ComponentPreset.MANUFACTURER, ComponentPreset.PARTNO, ComponentPreset.OUTER_DIAMETER, ComponentPreset.INNER_DIAMETER, ComponentPreset.LENGTH} ), - + BULK_HEAD( new TypedKey[] { ComponentPreset.MANUFACTURER, ComponentPreset.PARTNO, @@ -106,7 +110,7 @@ public class ComponentPreset implements Comparable { public TypedKey[] getDisplayedColumns() { return displayedColumns; } - + private static Map> compatibleTypeMap = new HashMap>(); static { @@ -115,7 +119,7 @@ public class ComponentPreset implements Comparable { compatibleTypeMap.put( CENTERING_RING, Arrays.asList( CENTERING_RING, ENGINE_BLOCK ) ); compatibleTypeMap.put( NOSE_CONE, Arrays.asList( NOSE_CONE, TRANSITION)); } - + } public final static TypedKey MANUFACTURER = new TypedKey("Manufacturer", Manufacturer.class); @@ -130,6 +134,9 @@ public class ComponentPreset implements Comparable { public final static TypedKey FORE_SHOULDER_LENGTH = new TypedKey("ForeShoulderLength",Double.class, UnitGroup.UNITS_LENGTH); public final static TypedKey FORE_SHOULDER_DIAMETER = new TypedKey("ForeShoulderDiameter",Double.class, UnitGroup.UNITS_LENGTH); public final static TypedKey FORE_OUTER_DIAMETER = new TypedKey("ForeOuterDiameter", Double.class, UnitGroup.UNITS_LENGTH); + public final static TypedKey AFT_SHOULDER_LENGTH = new TypedKey("AftShoulderLength",Double.class, UnitGroup.UNITS_LENGTH); + public final static TypedKey AFT_SHOULDER_DIAMETER = new TypedKey("AftShoulderDiameter",Double.class, UnitGroup.UNITS_LENGTH); + public final static TypedKey AFT_OUTER_DIAMETER = new TypedKey("AftOuterDiameter", Double.class, UnitGroup.UNITS_LENGTH); public final static TypedKey SHAPE = new TypedKey("Shape", Shape.class); public final static TypedKey MATERIAL = new TypedKey("Material", Material.class); public final static TypedKey FINISH = new TypedKey("Finish", Finish.class); @@ -177,15 +184,15 @@ public class ComponentPreset implements Comparable { FINISH, MATERIAL ); - - + + // package scope constructor to encourage use of factory. ComponentPreset() { } /** * Convenience method to retrieve the Type of this ComponentPreset. - * + * * @return */ public Type getType() { @@ -235,7 +242,7 @@ public class ComponentPreset implements Comparable { void put( TypedKey key, T value ) { properties.put(key, value); } - + public T get(TypedKey key) { T value = properties.get(key); if (value == null) { @@ -328,6 +335,7 @@ public class ComponentPreset implements Comparable { digest = TextUtil.hexString(md5.digest( bos.toByteArray() )); } catch ( Exception e ) { + e.printStackTrace(); throw new BugException(e); } } diff --git a/core/src/net/sf/openrocket/preset/loader/RocksimComponentFileLoader.java b/core/src/net/sf/openrocket/preset/loader/RocksimComponentFileLoader.java new file mode 100644 index 00000000..5202f864 --- /dev/null +++ b/core/src/net/sf/openrocket/preset/loader/RocksimComponentFileLoader.java @@ -0,0 +1,570 @@ +package net.sf.openrocket.preset.loader; + +import au.com.bytecode.opencsv.CSVReader; +import net.sf.openrocket.database.Databases; +import net.sf.openrocket.file.preset.ColumnDefinition; +import net.sf.openrocket.file.rocksim.RocksimNoseConeCode; +import net.sf.openrocket.gui.print.PrintUnit; +import net.sf.openrocket.gui.util.SwingPreferences; +import net.sf.openrocket.material.Material; +import net.sf.openrocket.preset.ComponentPreset; +import net.sf.openrocket.preset.ComponentPresetFactory; +import net.sf.openrocket.preset.InvalidComponentPresetException; +import net.sf.openrocket.preset.TypedKey; +import net.sf.openrocket.preset.TypedPropertyMap; +import net.sf.openrocket.startup.Application; +import net.sf.openrocket.unit.UnitGroup; +import net.sf.openrocket.util.ArrayList; +import net.sf.openrocket.util.BugException; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Primary entry point for parsing component CSV files that are in Rocksim format. + */ +public class RocksimComponentFileLoader { + + /** + * Common unit of measure key. Rocksim format allows different types of units. + */ + public final static TypedKey UNITS_OF_MEASURE = new TypedKey("Units", String.class); + + + public static List load(RocksimComponentFileType type) { + return load(RocksimComponentFileLoader.class.getResourceAsStream("/performancerocketry/" + type.getDefaultFileName())); + } + + public static List load(File file) throws FileNotFoundException { + return load(new FileInputStream(file)); + } + + public static List load(InputStream is) { + if (is == null) { + return new ArrayList(); + } + InputStreamReader r = null; + try { + r = new InputStreamReader(is); + + // Create the CSV reader. Use comma separator. + CSVReader reader = new CSVReader(r, ',', '\'', '\\'); + + //Read and throw away the header row. + reader.readNext(); + + //Read the rest of the file as data rows. + return reader.readAll(); + } + catch (IOException e) { + } + finally { + if (r != null) { + try { + r.close(); + } + catch (IOException e) { + } + } + } + + return new ArrayList(); + } + + /** + * Rocksim CSV units are either inches or mm. A value of 0 or "in." indicate inches. A value of 1 or "mm" indicate + * millimeters. + * + * @param units the value from the file + * @return true if it's inches + */ + private static boolean isInches(String units) { + String tmp = units.trim().toLowerCase(); + return "0".equals(tmp) || tmp.startsWith("in"); + } + + /** + * Convert inches or millimeters to meters. + * + * @param units a Rocksim CSV string representing the kind of units. + * @param value the original value within the CSV file + * @return the value in meters + */ + private static double convertLength(String units, double value) { + if (isInches(units)) { + return PrintUnit.INCHES.toMeters(value); + } + else { + return PrintUnit.MILLIMETERS.toMeters(value); + } + } + + /** + * Remove all occurrences of the given character. Note: this is done because some manufacturers embed double + * quotes in their descriptions or material names. Those are stripped away because they cause all sorts of + * matching/lookup issues. + * + * @param target the target string to be operated upon + * @param toBeRemoved the character to remove + * @return target, minus every occurrence of toBeRemoved + */ + private static String stripAll(String target, Character toBeRemoved) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < target.length(); i++) { + Character c = target.charAt(i); + if (!c.equals(toBeRemoved)) { + sb.append(c); + } + } + return sb.toString(); + } + + /** + * Convert all words in a given string to Camel Case (first letter capitalized). Words are assumed to be + * separated by a space. Note: this is done because some manufacturers define their material name in Camel Case + * but the component part references the material in lower case. That causes matching/lookup issues that's + * easiest handled this way (rather than converting everything to lower case. + * + * @param target the target string to be operated upon + * @return target, with the first letter of each word in uppercase + */ + private static String toCamelCase(String target) { + StringBuilder sb = new StringBuilder(); + String[] t = target.split("[ ]"); + if (t != null && t.length > 0) { + for (int i = 0; i < t.length; i++) { + String s = t[i]; + s = s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase(); + sb.append(s).append(" "); + } + return sb.toString().trim(); + } + else { + return target; + } + } + + private static Collection commonLoader(final List theData, + final List> keyMap, + final Map materialMap, + final ComponentPreset.Type type) { + Collection result = new ArrayList(); + List templates = new java.util.ArrayList(); + Set favorites = Application.getPreferences().getComponentFavorites(); + Integer uom = null; + + ColumnDefinition[] columns = new ColumnDefinition[keyMap.size()]; + for (int i = 0; i < keyMap.size(); i++) { + TypedKey key = keyMap.get(i); + if (key != null) { + columns[i] = new ColumnDefinition(key); + } + if (key.getName().equals("Units")) { + uom = i; + } + } + + for (int i = 0; i < theData.size(); i++) { + String[] item = theData.get(i); + TypedPropertyMap preset = new TypedPropertyMap(); + + for (int j = 0; j < columns.length; j++) { + if (j < item.length) { + String value = item[j]; + if (value == null) { + continue; + } + value = value.trim(); + value = stripAll(value, '"'); + if (value.length() == 0) { + continue; + } + final TypedKey typedKey = columns[j].getKey(); + if (typedKey.equals(ComponentPreset.MATERIAL)) { + preset.put(ComponentPreset.MATERIAL, materialMap.get(value)); + } + else if (typedKey.equals(ComponentPreset.SHAPE)) { + preset.put(ComponentPreset.SHAPE, RocksimNoseConeCode.fromShapeNameOrCode(value).asOpenRocket()); + } + else { + final UnitGroup unitGroup = typedKey.getUnitGroup(); + if (unitGroup != null && unitGroup.equals(UnitGroup.UNITS_LENGTH)) { + columns[j].setProperty(preset, convertLength(item[uom], Double.valueOf(value))); + } + else { + columns[j].setProperty(preset, value); + } + } + } + } + preset.put(ComponentPreset.TYPE, type); + templates.add(preset); + } + + for (TypedPropertyMap o : templates) { + try { + ComponentPreset preset = ComponentPresetFactory.create(o); + if (favorites.contains(preset.preferenceKey())) { + preset.setFavorite(true); + } + result.add(preset); + } + catch (InvalidComponentPresetException ex) { + throw new BugException(ex); + } + } + + return result; + } + + static class BodyTubeLoader { + private final static int MFG_INDEX = 0; + private final static int PART_NO_INDEX = 1; + private final static int DESCRIPTION_INDEX = 2; + private final static int UNITS_INDEX = 3; + private final static int ID_INDEX = 4; + private final static int OD_INDEX = 5; + private final static int LENGTH_INDEX = 6; + private final static int MATERIAL_INDEX = 7; + + public final static List> keyMap = new ArrayList>(8); + + static { + keyMap.add(MFG_INDEX, ComponentPreset.MANUFACTURER); + keyMap.add(PART_NO_INDEX, ComponentPreset.PARTNO); + keyMap.add(DESCRIPTION_INDEX, ComponentPreset.DESCRIPTION); + keyMap.add(UNITS_INDEX, UNITS_OF_MEASURE); + keyMap.add(ID_INDEX, ComponentPreset.INNER_DIAMETER); + keyMap.add(OD_INDEX, ComponentPreset.OUTER_DIAMETER); + keyMap.add(LENGTH_INDEX, ComponentPreset.LENGTH); + keyMap.add(MATERIAL_INDEX, ComponentPreset.MATERIAL); + } + + public Collection load(Map materialMap) { + List data = RocksimComponentFileLoader.load(RocksimComponentFileType.BODY_TUBE); + return commonLoader(data, keyMap, materialMap, ComponentPreset.Type.BODY_TUBE); + } + + public Collection load(Map materialMap, File file) throws + FileNotFoundException { + List data = RocksimComponentFileLoader.load(file); + return commonLoader(data, keyMap, materialMap, ComponentPreset.Type.BODY_TUBE); + } + + } + + /** + * Tube coupler parser. Although there are additional fields in the file, they are not used by + * most (any?) manufacturers so we ignore them entirely. + */ + static class TubeCouplerLoader extends BodyTubeLoader { + public Collection load(Map materialMap) { + List data = RocksimComponentFileLoader.load(RocksimComponentFileType.TUBE_COUPLER); + return commonLoader(data, keyMap, materialMap, ComponentPreset.Type.TUBE_COUPLER); + } + + public Collection load(Map materialMap, File file) throws + FileNotFoundException { + List data = RocksimComponentFileLoader.load(file); + return commonLoader(data, keyMap, materialMap, ComponentPreset.Type.TUBE_COUPLER); + } + } + + /** + * Engine block parser. Although there are additional fields in the file, they are not used by + * most (any?) manufacturers so we ignore them entirely. + */ + static class EngineBlockLoader extends BodyTubeLoader { + public Collection load(Map materialMap) { + List data = RocksimComponentFileLoader.load(RocksimComponentFileType.ENGINE_BLOCK); + return commonLoader(data, keyMap, materialMap, ComponentPreset.Type.ENGINE_BLOCK); + } + + public Collection load(Map materialMap, File file) throws + FileNotFoundException { + List data = RocksimComponentFileLoader.load(file); + return commonLoader(data, keyMap, materialMap, ComponentPreset.Type.ENGINE_BLOCK); + } + } + + + static class BulkheadLoader extends BodyTubeLoader { + public Collection load(Map materialMap) { + List data = RocksimComponentFileLoader.load(RocksimComponentFileType.BULKHEAD); + return commonLoader(data, keyMap, materialMap, ComponentPreset.Type.BULK_HEAD); + } + + public Collection load(Map materialMap, File file) throws + FileNotFoundException { + List data = RocksimComponentFileLoader.load(file); + return commonLoader(data, keyMap, materialMap, ComponentPreset.Type.BULK_HEAD); + } + } + + static class CenteringRingLoader extends BodyTubeLoader { + public Collection load(Map materialMap) { + List data = RocksimComponentFileLoader.load(RocksimComponentFileType.CENTERING_RING); + return commonLoader(data, keyMap, materialMap, ComponentPreset.Type.CENTERING_RING); + } + + public Collection load(Map materialMap, File file) throws + FileNotFoundException { + List data = RocksimComponentFileLoader.load(file); + return commonLoader(data, keyMap, materialMap, ComponentPreset.Type.CENTERING_RING); + } + } + + static class NoseConeLoader { + public static final int MFG_INDEX = 0; + public static final int PART_NO_INDEX = 1; + public static final int DESCRIPTION_INDEX = 2; + public static final int UNITS_INDEX = 3; + public static final int LENGTH_INDEX = 4; + public static final int OUTER_DIA_INDEX = 5; + public static final int LD_RATIO_INDEX = 6; + public static final int INSERT_LENGTH_INDEX = 7; + public static final int INSERT_OD_INDEX = 8; + public static final int THICKNESS_INDEX = 9; + public static final int SHAPE_INDEX = 10; + public static final int CONFIG_INDEX = 11; + public static final int MATERIAL_INDEX = 12; + public static final int CG_LOC_INDEX = 13; + public static final int MASS_UNITS_INDEX = 14; + public static final int MASS_INDEX = 15; + public static final int BASE_EXT_LEN_INDEX = 16; + + public final static TypedKey LD_RATIO = new TypedKey("Len/Dia Ratio", Double.class); + public final static TypedKey BASE_EXT_LEN = new TypedKey("Base Ext Len", Double.class, UnitGroup.UNITS_LENGTH); + public final static TypedKey CONFIG = new TypedKey("Config", String.class); + public final static TypedKey CG_LOC = new TypedKey("CG Loc", Double.class, UnitGroup.UNITS_LENGTH); + public final static List> keyMap = new ArrayList>(17); + + static { + keyMap.add(MFG_INDEX, ComponentPreset.MANUFACTURER); + keyMap.add(PART_NO_INDEX, ComponentPreset.PARTNO); + keyMap.add(DESCRIPTION_INDEX, ComponentPreset.DESCRIPTION); + keyMap.add(UNITS_INDEX, UNITS_OF_MEASURE); + keyMap.add(LENGTH_INDEX, ComponentPreset.LENGTH); + keyMap.add(OUTER_DIA_INDEX, ComponentPreset.OUTER_DIAMETER); + keyMap.add(LD_RATIO_INDEX, LD_RATIO); + keyMap.add(INSERT_LENGTH_INDEX, ComponentPreset.SHOULDER_LENGTH); + keyMap.add(INSERT_OD_INDEX, ComponentPreset.SHOULDER_DIAMETER); + keyMap.add(THICKNESS_INDEX, ComponentPreset.THICKNESS); + keyMap.add(SHAPE_INDEX, ComponentPreset.SHAPE); + keyMap.add(CONFIG_INDEX, CONFIG); + keyMap.add(MATERIAL_INDEX, ComponentPreset.MATERIAL); + keyMap.add(CG_LOC_INDEX, CG_LOC); + keyMap.add(MASS_UNITS_INDEX, UNITS_OF_MEASURE); + keyMap.add(MASS_INDEX, ComponentPreset.MASS); + keyMap.add(BASE_EXT_LEN_INDEX, BASE_EXT_LEN); + } + + public Collection load(Map materialMap) { + List data = RocksimComponentFileLoader.load(RocksimComponentFileType.NOSE_CONE); + return commonLoader(data, keyMap, materialMap, ComponentPreset.Type.NOSE_CONE); + } + + public Collection load(Map materialMap, File file) throws + FileNotFoundException { + List data = RocksimComponentFileLoader.load(file); + return commonLoader(data, keyMap, materialMap, ComponentPreset.Type.NOSE_CONE); + } + } + + static class TransitionLoader { + public static final int MFG_INDEX = 0; + public static final int PART_NO_INDEX = 1; + public static final int DESCRIPTION_INDEX = 2; + public static final int UNITS_INDEX = 3; + public static final int FRONT_INSERT_LENGTH_INDEX = 4; + public static final int FRONT_INSERT_OD_INDEX = 5; + public static final int FRONT_OD_INDEX = 6; + public static final int LENGTH_INDEX = 7; + public static final int REAR_OD_INDEX = 8; + public static final int CORE_DIA_INDEX = 9; + public static final int REAR_INSERT_LENGTH_INDEX = 10; + public static final int REAR_INSERT_OD_INDEX = 11; + public static final int THICKNESS_INDEX = 12; + public static final int CONFIG_INDEX = 13; + public static final int MATERIAL_INDEX = 14; + public static final int CG_LOC_INDEX = 15; + public static final int MASS_UNITS_INDEX = 16; + public static final int MASS_INDEX = 17; + public static final int SHAPE_INDEX = 18; + + public final static TypedKey CONFIG = new TypedKey("Config", String.class); + public final static TypedKey IGNORE = new TypedKey("Ignore", String.class); + public final static TypedKey CG_LOC = new TypedKey("CG Loc", Double.class, UnitGroup.UNITS_LENGTH); + public final static List> keyMap = new ArrayList>(19); + + static { + keyMap.add(MFG_INDEX, ComponentPreset.MANUFACTURER); + keyMap.add(PART_NO_INDEX, ComponentPreset.PARTNO); + keyMap.add(DESCRIPTION_INDEX, ComponentPreset.DESCRIPTION); + keyMap.add(UNITS_INDEX, UNITS_OF_MEASURE); + keyMap.add(FRONT_INSERT_LENGTH_INDEX, ComponentPreset.FORE_SHOULDER_LENGTH); + keyMap.add(FRONT_INSERT_OD_INDEX, ComponentPreset.FORE_SHOULDER_DIAMETER); + keyMap.add(FRONT_OD_INDEX, ComponentPreset.FORE_OUTER_DIAMETER); + keyMap.add(LENGTH_INDEX, ComponentPreset.LENGTH); + keyMap.add(REAR_OD_INDEX, ComponentPreset.OUTER_DIAMETER); + keyMap.add(CORE_DIA_INDEX, IGNORE); + keyMap.add(REAR_INSERT_LENGTH_INDEX, ComponentPreset.SHOULDER_LENGTH); + keyMap.add(REAR_INSERT_OD_INDEX, ComponentPreset.SHOULDER_DIAMETER); + keyMap.add(THICKNESS_INDEX, ComponentPreset.THICKNESS); + keyMap.add(CONFIG_INDEX, CONFIG); + keyMap.add(MATERIAL_INDEX, ComponentPreset.MATERIAL); + keyMap.add(CG_LOC_INDEX, CG_LOC); + keyMap.add(MASS_UNITS_INDEX, UNITS_OF_MEASURE); + keyMap.add(MASS_INDEX, ComponentPreset.MASS); + keyMap.add(SHAPE_INDEX, ComponentPreset.SHAPE); + } + + public Collection load(Map materialMap) { + List data = RocksimComponentFileLoader.load(RocksimComponentFileType.TRANSITION); + return commonLoader(data, keyMap, materialMap, ComponentPreset.Type.TRANSITION); + } + + public Collection load(Map materialMap, File file) throws + FileNotFoundException { + List data = RocksimComponentFileLoader.load(file); + return commonLoader(data, keyMap, materialMap, ComponentPreset.Type.TRANSITION); + } + } + + static class MaterialLoader { + private final static int MATERIAL_INDEX = 0; + private final static int UNITS_INDEX = 1; + private final static int DENSITY_INDEX = 2; + private final static int LOW_INDEX = 3; + private final static int HIGH_INDEX = 4; + private final static int CLASS_INDEX = 5; + private final static int ROCKETRY_USE_INDEX = 6; + private final static int BODY_TUBES_INDEX = 7; + public static final int FIN_SETS_INDEX = 8; + public static final int LAUNCH_LUGS_INDEX = 9; + public static final int CORDS_INDEX = 10; + public static final int NOSE_INDEX = 11; + public static final int PARACHUTE_INDEX = 12; + public static final int STREAMER_INDEX = 13; + public static final int TRANSITION_INDEX = 14; + public static final int RING_INDEX = 15; + public static final int BULKHEAD_INDEX = 16; + public static final int ENGINE_BLOCK_INDEX = 17; + public static final int SLEEVE_INDEX = 18; + public static final int TUBE_COUPLER_INDEX = 19; + public static final int KNOWN_DIM_TYPE_INDEX = 27; + public static final int KNOWN_DIM_UNITS_INDEX = 28; + public static final int KNOWN_DIM_VALUE_INDEX = 29; + + public final static List> keyMap = new ArrayList>(8); + public final static TypedKey MATERIAL_NAME = new TypedKey("Material Name", String.class); + public final static TypedKey DENSITY = new TypedKey("Density", Double.class); + + static class MaterialAdapter { + Material.Type type; + double conversionFactor; + + MaterialAdapter(Material.Type theType, double cf) { + type = theType; + conversionFactor = cf; + } + } + + private final static Map materialAdapterMap = new HashMap(); + + static { + materialAdapterMap.put("g/cm", new MaterialAdapter(Material.Type.LINE, 0.1d)); + materialAdapterMap.put("g/cm2", new MaterialAdapter(Material.Type.SURFACE, 10.0d)); + materialAdapterMap.put("g/cm3", new MaterialAdapter(Material.Type.BULK, 1000.0d)); + materialAdapterMap.put("kg/m3", new MaterialAdapter(Material.Type.BULK, 1d)); + materialAdapterMap.put("lb/ft3", new MaterialAdapter(Material.Type.BULK, 16.0184634d)); + materialAdapterMap.put("oz/in", new MaterialAdapter(Material.Type.LINE, 1.11612296d)); + materialAdapterMap.put("oz/in2", new MaterialAdapter(Material.Type.SURFACE, 43.9418487)); + + keyMap.add(MATERIAL_INDEX, MATERIAL_NAME); + keyMap.add(UNITS_INDEX, UNITS_OF_MEASURE); + keyMap.add(DENSITY_INDEX, DENSITY); + } + + static Map load() { + List data = RocksimComponentFileLoader.load(RocksimComponentFileType.MATERIAL); + Map materialMap = new HashMap(); + + for (int i = 0; i < data.size(); i++) { + try { + String[] strings = data.get(i); + MaterialAdapter ma = materialAdapterMap.get(strings[UNITS_INDEX]); + double metricDensity = ma.conversionFactor * Double.parseDouble(strings[DENSITY_INDEX]); + final String cleanedMaterialName = stripAll(strings[MATERIAL_INDEX], '"').trim(); + final Material material = Databases.findMaterial(ma.type, cleanedMaterialName, + metricDensity, true); + materialMap.put(cleanedMaterialName, material); + materialMap.put(cleanedMaterialName.toLowerCase(), material); + materialMap.put(toCamelCase(cleanedMaterialName), material); + } + catch (Exception e) { + //Trap a bad row and move on + //TODO: log it? Display to user? + } + } + return materialMap; + } + } + + public static void main(String[] args) { + Application.setPreferences(new SwingPreferences()); + Map materialMap = MaterialLoader.load(); + Collection presetNC = new NoseConeLoader().load(materialMap); + Collection presetBC = new BodyTubeLoader().load(materialMap); + Collection presetBH = new BulkheadLoader().load(materialMap); + Collection presetCR = new CenteringRingLoader().load(materialMap); + Collection presetTC = new TubeCouplerLoader().load(materialMap); + Collection presetTR = new TransitionLoader().load(materialMap); + Collection presetEB = new EngineBlockLoader().load(materialMap); + + for (Iterator iterator = presetNC.iterator(); iterator.hasNext(); ) { + ComponentPreset next = iterator.next(); + System.err.println(next); + } + for (Iterator iterator = presetBC.iterator(); iterator.hasNext(); ) { + ComponentPreset next = iterator.next(); + System.err.println(next); + } + for (Iterator iterator = presetBH.iterator(); iterator.hasNext(); ) { + ComponentPreset next = iterator.next(); + System.err.println(next); + } + for (Iterator iterator = presetCR.iterator(); iterator.hasNext(); ) { + ComponentPreset next = iterator.next(); + System.err.println(next); + } + for (Iterator iterator = presetTC.iterator(); iterator.hasNext(); ) { + ComponentPreset next = iterator.next(); + System.err.println(next); + } + for (Iterator iterator = presetTR.iterator(); iterator.hasNext(); ) { + ComponentPreset next = iterator.next(); + System.err.println(next); + } + for (Iterator iterator = presetEB.iterator(); iterator.hasNext(); ) { + ComponentPreset next = iterator.next(); + System.err.println(next); + } + } +} + +//Errata: +//The oddities I've found thus far in the stock Rocksim data: +//1. BTDATA.CSV - Totally Tubular goofed up their part no. and description columns (They messed up TCDATA also) +//2. NCDATA.CSV - Estes Balsa nose cones are classified as G10 Fiberglass +//3. TRDATA.CSV - Apogee Saturn LEM Transition has no part number; Balsa Machining transitions have blank diameter diff --git a/core/src/net/sf/openrocket/preset/loader/RocksimComponentFileType.java b/core/src/net/sf/openrocket/preset/loader/RocksimComponentFileType.java new file mode 100644 index 00000000..c4b85d90 --- /dev/null +++ b/core/src/net/sf/openrocket/preset/loader/RocksimComponentFileType.java @@ -0,0 +1,77 @@ +package net.sf.openrocket.preset.loader; + +import java.util.Arrays; + +/** + * Definition of the typical Rocksim component files and their formats. + */ +public enum RocksimComponentFileType { + BODY_TUBE("BTDATA.CSV", "Mfg.", "Part No.", "Desc.", "Units", "ID", "OD", "Length", "Material", "Engine"), + BULKHEAD("BHDATA.CSV", "Mfg.", "Part No.", "Desc.", "Units", "ID", "OD", "Length", "Material", "Engine", "Engine", + "Engine", "Engine", "Engine", "Engine", "Engine", "Engine", "Engine", "Engine", "Engine"), + CENTERING_RING("CRDATA.CSV", "Mfg.", "Part No.", "Desc.", "Units", "ID", "OD", "Length", "Material", "AutoSize"), + CUSTOM_FIN("CSDATA.CSV"), + ENGINE_BLOCK("EBDATA.CSV", "Mfg.", "Part No.", "Desc.", "Units", "ID", "OD", "Length", "Material", "CG", "Mass Units", "Mass", "AutoSize"), + FIN("FSDATA.CSV"), + LAUNCH_LUG("LLDATA.CSV"), + MASS_OBJECT("MODATA.CSV", "Mfg.", "Part no", "Desc", "Units", "Name", "Type", "Length", "Material", "Mass units", "Mass"), + MATERIAL("MATERIAL.CSV", "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"), + NOSE_CONE("NCDATA.CSV", "Mfg.","Part No.","Desc.","Units","Length","Outer Dia","L/D Ratio","Insert Length","Insert OD", + "Thickness","Shape","Config","Material","CG Loc","Mass Units","Mass","Base Ext. Len"), + PARACHUTE("PCDATA.CSV"), + SLEEVE("SLDATA.CSV"), + STREAMER("STDATA.CSV"), + TUBE_COUPLER("TCDATA.CSV", "Mfg.", "Part No.", "Desc.", "Units", "ID", "OD", "Length", "Material", "Mass Units", "CG", "Mass", "AutoSize"), + TRANSITION("TRDATA.CSV", "Mfg.", "Part No.", "Desc.", "Units", "Front Insert Len", "Front Insert OD", "Front OD", "Length", + "Rear OD", "Core Dia.", "Rear Insert Len", "Rear Insert OD", "Thickness", "Config", "Material", "CG Loc", + "Mass Units", "Mass", "Shape", "Shape", "Shape", "Shape", "Shape", "Shape", "Shape", "Shape", "Shape", "Shape", "Shape", "Shape"); + + /** + * The default filename for the type of data. + */ + private final String defaultFileName; + + /** + * The column names. + */ + private final String[] columns; + + /** + * Constructor. + * + * @param theDefaultFileName the default filename + * @param theColumns the array of column names in the file + */ + private RocksimComponentFileType(final String theDefaultFileName, String... theColumns) { + defaultFileName = theDefaultFileName; + columns = theColumns; + } + + /** + * Get the typical file name used for this type of component data. + * + * @return a filename + */ + public String getDefaultFileName() { + return defaultFileName; + } + + /** + * Try to be omniscient and figure out what kind of data file it is given an array of header (column) names. + * + * @param headers an array of column names + * @return the data type of the file, or null if unable to match the header names + */ + public static RocksimComponentFileType determineType(String[] headers) { + RocksimComponentFileType[] types = values(); + for (int i = 0; i < types.length; i++) { + RocksimComponentFileType type = types[i]; + if (Arrays.equals(headers, type.columns)) { + return type; + } + } + return null; + } +}