Initial work on BodyTube ComponentPresets.
This commit is contained in:
parent
6d86baa926
commit
6de0ea7083
@ -26,5 +26,6 @@
|
||||
<classpathentry kind="lib" path="lib-test/uispec4j-2.3-jdk16.jar"/>
|
||||
<classpathentry kind="lib" path="resources"/>
|
||||
<classpathentry kind="lib" path="lib/jspf.core-1.0.2.jar" sourcepath="/home/sampo/Projects/lib/jspf/documentation/api"/>
|
||||
<classpathentry kind="lib" path="lib/opencsv-2.3.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
<!-- JAR -->
|
||||
<target name="jar" depends="build">
|
||||
<target name="jar" depends="build" description="Create the OpenRocket jar file">
|
||||
<copy todir="${dist.dir}/">
|
||||
<fileset dir="." includes="LICENSE.TXT README.TXT ChangeLog ReleaseNotes fileformat.txt" />
|
||||
<fileset dir="resources/"/>
|
||||
@ -73,6 +73,7 @@
|
||||
<zipfileset src="lib/jcommon-1.0.16.jar" />
|
||||
<zipfileset src="lib/jfreechart-1.0.13.jar" />
|
||||
<zipfileset src="lib/iText-5.0.2.jar" />
|
||||
<zipfileset src="lib/opencsv-2.3.jar" />
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
|
44
core/doc/techdoc/figures/motors/staged
Normal file
44
core/doc/techdoc/figures/motors/staged
Normal file
@ -0,0 +1,44 @@
|
||||
#FIG 3.2 Produced by xfig version 3.2.5
|
||||
Landscape
|
||||
Center
|
||||
Metric
|
||||
A4
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
1200 2
|
||||
0 32 #696d69
|
||||
6 4275 -3915 5625 225
|
||||
1 2 0 1 0 0 48 -1 20 0.000 1 0.0000 4960 -224 170 87 4790 -224 5130 -224
|
||||
1 2 0 1 0 32 49 -1 20 0.000 1 0.0000 4951 -109 540 270 4411 -109 5491 -109
|
||||
1 2 0 1 0 7 50 -1 20 0.000 1 0.0000 4950 -112 675 337 4275 -112 5625 -112
|
||||
1 2 0 1 0 7 55 -1 -1 0.000 1 0.0000 4950 -292 675 337 4275 -292 5625 -292
|
||||
1 2 1 1 0 7 60 -1 -1 4.000 1 0.0000 4950 -3547 675 337 4275 -3547 5625 -3547
|
||||
2 1 0 1 0 7 51 -1 -1 0.000 0 0 -1 0 0 2
|
||||
4275 -89 4275 -314
|
||||
2 2 0 0 -1 7 53 -1 20 0.000 0 0 -1 0 0 5
|
||||
4275 -314 5625 -314 5625 -89 4275 -89 4275 -314
|
||||
2 1 0 1 0 7 51 -1 -1 0.000 0 0 -1 0 0 2
|
||||
5625 -134 5625 -314
|
||||
2 1 1 1 0 32 60 -1 -1 4.000 0 0 -1 0 0 2
|
||||
4275 -269 4275 -3554
|
||||
2 1 1 1 0 32 60 -1 -1 4.000 0 0 -1 0 0 2
|
||||
5625 -269 5625 -3554
|
||||
2 1 0 1 0 7 51 -1 -1 0.000 0 0 -1 0 0 2
|
||||
4590 -990 4590 -1170
|
||||
-6
|
||||
1 2 0 1 0 0 48 -1 20 0.000 1 0.0000 4960 4185 170 87 4790 4185 5130 4185
|
||||
1 2 0 1 0 32 49 -1 20 0.000 1 0.0000 4951 4300 540 270 4411 4300 5491 4300
|
||||
1 2 0 1 0 7 50 -1 20 0.000 1 0.0000 4950 4297 675 337 4275 4297 5625 4297
|
||||
1 2 0 1 0 7 55 -1 -1 0.000 1 0.0000 4950 4117 675 337 4275 4117 5625 4117
|
||||
1 2 1 1 0 7 55 -1 -1 4.000 1 0.0000 4950 862 675 337 4275 862 5625 862
|
||||
2 1 0 1 0 7 51 -1 -1 0.000 0 0 -1 0 0 2
|
||||
4275 4320 4275 4095
|
||||
2 2 0 0 -1 7 53 -1 20 0.000 0 0 -1 0 0 5
|
||||
4275 4095 5625 4095 5625 4320 4275 4320 4275 4095
|
||||
2 1 1 1 0 32 55 -1 -1 4.000 0 0 -1 0 0 2
|
||||
4275 4140 4275 855
|
||||
2 1 1 1 0 32 55 -1 -1 4.000 0 0 -1 0 0 2
|
||||
5625 4140 5625 855
|
||||
2 2 1 0 0 7 57 -1 20 2.000 0 0 -1 0 0 5
|
||||
4275 1125 5625 1125 5625 4275 4275 4275 4275 1125
|
BIN
core/lib/opencsv-2.3.jar
Normal file
BIN
core/lib/opencsv-2.3.jar
Normal file
Binary file not shown.
384
core/resources/datafiles/bodytubepresets.csv
Normal file
384
core/resources/datafiles/bodytubepresets.csv
Normal file
@ -0,0 +1,384 @@
|
||||
Manufacturer,PartNo,id(cm),od(cm),maxlength(cm)
|
||||
Semroc,BT-3,0.8865,0.9525,45.72
|
||||
Semroc,BT-3H,0.8865,0.9525,7.62
|
||||
Semroc,BT-3XW,0.8865,0.9525,3.81
|
||||
Semroc,BT-4,1.0719,1.1379,45.72
|
||||
Semroc,BT-4HW,1.0719,1.1379,15.24
|
||||
Semroc,BT-4IJ,1.0719,1.1379,22.86
|
||||
Semroc,BT-4LJ,1.0719,1.1379,6.35
|
||||
Semroc,BT-4W,1.0719,1.1379,30.48
|
||||
Semroc,BT-5,1.3081,1.3792,45.72
|
||||
Semroc,BT-5BJ,1.3081,1.3792,5.08
|
||||
Semroc,BT-5CJ,1.3081,1.3792,7.62
|
||||
Semroc,BT-5P,1.3081,1.3792,12.954
|
||||
Semroc,BT-5T,1.3081,1.3792,3.81
|
||||
Semroc,BT-5TP,1.3081,1.3792,15.24
|
||||
Semroc,BT-5XW,1.3081,1.3792,34.925
|
||||
Semroc,BT-19,1.712,1.778,45.72
|
||||
Semroc,BT-20,1.8034,1.8694,45.72
|
||||
Semroc,BT-20AE,1.8034,1.8694,3.81
|
||||
Semroc,BT-20B,1.8034,1.8694,21.971
|
||||
Semroc,BT-20D,1.8034,1.8694,16.51
|
||||
Semroc,BT-20DJ,1.8034,1.8694,10.16
|
||||
Semroc,BT-20E,1.8034,1.8694,19.685
|
||||
Semroc,BT-20G,1.8034,1.8694,8.89
|
||||
Semroc,BT-20J,1.8034,1.8694,6.985
|
||||
Semroc,BT-20L,1.8034,1.8694,30.48
|
||||
Semroc,BT-20M,1.8034,1.8694,5.715
|
||||
Semroc,BT-20N,1.8034,1.8694,24.765
|
||||
Semroc,BT-20P,1.8034,1.8694,34.925
|
||||
Semroc,BT-20XW,1.8034,1.8694,20.32
|
||||
Semroc,BT-30,1.8415,1.9482,22.86
|
||||
Semroc,BT-30-180,1.8415,1.9482,45.72
|
||||
Semroc,BT-30A,1.8415,1.9482,8.89
|
||||
Semroc,BT-30AP,1.8415,1.9482,8.89
|
||||
Semroc,BT-30B,1.8415,1.9482,15.57
|
||||
Semroc,BT-30C,1.8415,1.9482,13.97
|
||||
Semroc,BT-30F,1.8415,1.9482,20.32
|
||||
Semroc,BT-30J,1.8415,1.9482,6.985
|
||||
Semroc,BT-30K,1.8415,1.9482,6.985
|
||||
Semroc,BT-30XW,1.8415,1.9482,7.62
|
||||
Semroc,BT-40,1.9431,2.0955,33.655
|
||||
Semroc,BT-40-185,1.9431,2.0955,46.99
|
||||
Semroc,BT-40W,1.9431,2.0955,23.495
|
||||
Semroc,BT-50,2.413,2.479,45.72
|
||||
Semroc,BT-50-113,2.413,2.479,28.575
|
||||
Semroc,BT-50A,2.413,2.479,25.4
|
||||
Semroc,BT-50AE,2.413,2.479,3.81
|
||||
Semroc,BT-50AH,2.413,2.479,4.775
|
||||
Semroc,BT-50B,2.413,2.479,26.035
|
||||
Semroc,BT-50BH,2.413,2.479,20.955
|
||||
Semroc,BT-50EE,2.413,2.479,13.97
|
||||
Semroc,BT-50F,2.413,2.479,12.7
|
||||
Semroc,BT-50FE,2.413,2.479,16.51
|
||||
Semroc,BT-50H,2.413,2.479,19.685
|
||||
Semroc,BT-50IJ,2.413,2.479,22.86
|
||||
Semroc,BT-50J,2.413,2.479,6.985
|
||||
Semroc,BT-50KE,2.413,2.479,38.1
|
||||
Semroc,BT-50L,2.413,2.479,32.258
|
||||
Semroc,BT-50N,2.413,2.479,35.56
|
||||
Semroc,BT-50P,2.413,2.479,27.94
|
||||
Semroc,BT-50S,2.413,2.479,10.16
|
||||
Semroc,BT-50SV,2.413,2.479,41.275
|
||||
Semroc,BT-50TF,2.413,2.479,40.64
|
||||
Semroc,BT-50V,2.413,2.479,41.91
|
||||
Semroc,BT-50W,2.413,2.479,24.13
|
||||
Semroc,BT-50XW,2.413,2.479,39.37
|
||||
Semroc,BT-51CI,2.5019,2.5679,9.855
|
||||
Semroc,BT-51N,2.5019,2.5679,31.547
|
||||
Semroc,BT-51SE,2.5019,2.5679,5.08
|
||||
Semroc,BT-52,2.5095,2.5756,45.72
|
||||
Semroc,BT-52AG,2.5095,2.5756,5.334
|
||||
Semroc,BT-52S,2.5095,2.5756,10002.52
|
||||
Semroc,BT-55,3.2588,3.3655,45.72
|
||||
Semroc,BT-55RJ,3.2588,3.3655,13.335
|
||||
Semroc,BT-55-109,3.2588,3.3655,27.737
|
||||
Semroc,BT-55-110,3.2588,3.3655,27.94
|
||||
Semroc,BT-55-113,3.2588,3.3655,28.575
|
||||
Semroc,BT-55C,3.2588,3.3655,35.56
|
||||
Semroc,BT-55E,3.2588,3.3655,7.62
|
||||
Semroc,BT-55IJ,3.2588,3.3655,22.86
|
||||
Semroc,BT-55J,3.2588,3.3655,6.985
|
||||
Semroc,BT-55KA,3.2588,3.3655,26.67
|
||||
Semroc,BT-55KG,3.2588,3.3655,42.672
|
||||
Semroc,BT-55S,3.2588,3.3655,10.16
|
||||
Semroc,BT-55V,3.2588,3.3655,41.656
|
||||
Semroc,BT-55W,3.2588,3.3655,30.48
|
||||
Semroc,BT-58,3.8049,3.9116,32.385
|
||||
Semroc,BT-58-180,3.8049,3.9116,45.72
|
||||
Semroc,BT-58AJ,3.8049,3.9116,25.4
|
||||
Semroc,BT-58IJ,3.8049,3.9116,22.86
|
||||
Semroc,BT-58LJ,3.8049,3.9116,13652.5
|
||||
Semroc,BT-58SB,3.8049,3.9116,16192.5
|
||||
Semroc,BT-58SV,3.8049,3.9116,15557.5
|
||||
Semroc,BT-60,4.0513,4.158,45.72
|
||||
Semroc,BT-60-63,4.0513,4.158,15.875
|
||||
Semroc,BT-60AD,4.0513,4.158,35.56
|
||||
Semroc,BT-60AE,4.0513,4.158,36.195
|
||||
Semroc,BT-60AJ,4.0513,4.158,25.4
|
||||
Semroc,BT-60BB,4.0513,4.158,19.05
|
||||
Semroc,BT-60C,4.0513,4.158,2.54
|
||||
Semroc,BT-60D,4.0513,4.158,27.94
|
||||
Semroc,BT-60DS,4.0513,4.158,31.75
|
||||
Semroc,BT-60FG,4.0513,4.158,17.018
|
||||
Semroc,BT-60HE,4.0513,4.158,21.59
|
||||
Semroc,BT-60J,4.0513,4.158,6.985
|
||||
Semroc,BT-60K,4.0513,4.158,17.78
|
||||
Semroc,BT-60KC,4.0513,4.158,32.614
|
||||
Semroc,BT-60KF,4.0513,4.158,40.894
|
||||
Semroc,BT-60P,4.0513,4.158,40.64
|
||||
Semroc,BT-60R,4.0513,4.158,12.7
|
||||
Semroc,BT-60RB,4.0513,4.158,8.255
|
||||
Semroc,BT-60V,4.0513,4.158,10.947
|
||||
Semroc,BT-60XW,4.0513,4.158,7.62
|
||||
Semroc,BT-70,5.5245,5.6312,45.72
|
||||
Semroc,BT-70BD,5.5245,5.6312,38.735
|
||||
Semroc,BT-70H,5.5245,5.6312,18.161
|
||||
Semroc,BT-70KD,5.5245,5.6312,44.45
|
||||
Semroc,RT-70,5.5245,5.6312,1.727
|
||||
Semroc,BT-70V,5.5245,5.6312,26.924
|
||||
Semroc,BT-80,6.4973,6.604,45.72
|
||||
Semroc,BT-80-76,6.4973,6.604,19.304
|
||||
Semroc,BT-80-93,6.4973,6.604,23.622
|
||||
Semroc,BT-80A,6.4973,6.604,22.86
|
||||
Semroc,BT-80KD,6.4973,6.604,36.068
|
||||
Semroc,BT-80MA,6.4973,6.604,8.179
|
||||
Semroc,BT-80OP,6.4973,6.604,27.94
|
||||
Semroc,BT-80R,6.4973,6.604,5.588
|
||||
Semroc,BT-80S,6.4973,6.604,11.43
|
||||
Semroc,BT-80SV,6.4973,6.604,22.377
|
||||
Semroc,BT-80WH,6.4973,6.604,20.32
|
||||
Semroc,RT-99D,9.3167,9.398,0.993
|
||||
Semroc,BT-100CE,9.4031,9.5098,8.89
|
||||
Semroc,BT-100D,9.4031,9.5098,10.389
|
||||
Semroc,BT-100Z,9.4031,9.5098,27.686
|
||||
Semroc,BT-101,9.8958,10.0025,41.91
|
||||
Semroc,BT-101A,9.8958,10.0025,2.54
|
||||
Semroc,BT-101K,9.8958,10.0025,19.279
|
||||
Semroc,BT-101KJ,9.8958,10.0025,26.67
|
||||
Semroc,BT-101LA,9.8958,10.0025,54.356
|
||||
Semroc,BT-101SV,9.8958,10.0025,62.548
|
||||
Semroc,BT-101T,9.8958,10.0025,7.061
|
||||
Semroc,BTH-70-88,5.5245,5.7074,22.352
|
||||
Semroc,BTH-70-120,5.5245,5.7074,30.48
|
||||
Semroc,BTH-70-172,5.5245,5.7074,43.688
|
||||
Semroc,BTH-70-180,5.5245,5.7074,45.72
|
||||
Semroc,BTH-70-280,5.5245,5.7074,71.12
|
||||
Semroc,BTH-70-286,5.5245,5.7074,72.644
|
||||
Semroc,BTH-70-300,5.5245,5.7074,76.2
|
||||
Semroc,BTH-80-80,6.4973,6.7056,20.32
|
||||
Semroc,BTH-80-100,6.4973,6.7056,25.4
|
||||
Semroc,BTH-80-115,6.4973,6.7056,29.21
|
||||
Semroc,BTH-80-119S3,6.4973,6.7056,30.226
|
||||
Semroc,BTH-80-120,6.4973,6.7056,30.48
|
||||
Semroc,BTH-80-185S4,6.4973,6.7056,46.99
|
||||
Semroc,BTH-80-220,6.4973,6.7056,55.88
|
||||
Semroc,BTH-80-300,6.4973,6.7056,76.2
|
||||
Semroc,ST-220,0.5944,0.6604,5.08
|
||||
Semroc,ST-2180,0.5944,0.6604,45.72
|
||||
Semroc,ST-515,1.3081,1.3792,3.81
|
||||
Semroc,ST-520,1.3081,1.3792,5.08
|
||||
Semroc,ST-520E,1.3081,1.3792,5.08
|
||||
Semroc,ST-525,1.3081,1.3792,6.35
|
||||
Semroc,ST-530,1.3081,1.3792,7.62
|
||||
Semroc,ST-540,1.3081,1.3792,10.16
|
||||
Semroc,ST-545,1.3081,1.3792,11.43
|
||||
Semroc,ST-560,1.3081,1.3792,15.24
|
||||
Semroc,ST-560S,1.3081,1.3792,15.24
|
||||
Semroc,ST-580,1.3081,1.3792,20.32
|
||||
Semroc,ST-590,1.3081,1.3792,22.86
|
||||
Semroc,ST-5120,1.3081,1.3792,30.48
|
||||
Semroc,ST-5180,1.3081,1.3792,45.72
|
||||
Semroc,ST-660,1.5494,1.651,15.24
|
||||
Semroc,ST-690,1.5494,1.651,22.86
|
||||
Semroc,ST-6120,1.5494,1.651,30.48
|
||||
Semroc,ST-6180,1.5494,1.651,45.72
|
||||
Semroc,ST-703,1.8161,1.9279,0.635
|
||||
Semroc,ST-720,1.8161,1.9279,5.08
|
||||
Semroc,ST-720H,1.8161,1.9279,5.08
|
||||
Semroc,ST-720X,1.8161,1.9279,5.08
|
||||
Semroc,ST-722,1.8161,1.9279,5.588
|
||||
Semroc,ST-723,1.8161,1.9279,5.715
|
||||
Semroc,ST-725,1.8161,1.9279,6.35
|
||||
Semroc,ST-728,1.8161,1.9279,6.985
|
||||
Semroc,ST-730,1.8161,1.9279,7.62
|
||||
Semroc,ST-730E,1.8161,1.9279,7.62
|
||||
Semroc,ST-740,1.8161,1.9279,10.16
|
||||
Semroc,ST-749,1.8161,1.9279,12.446
|
||||
Semroc,ST-750P,1.8161,1.9279,12.7
|
||||
Semroc,ST-753,1.8161,1.9279,13.335
|
||||
Semroc,ST-755,1.8161,1.9279,13.97
|
||||
Semroc,ST-758,1.8161,1.9279,14.605
|
||||
Semroc,ST-760,1.8161,1.9279,15.24
|
||||
Semroc,ST-765,1.8161,1.9279,16.51
|
||||
Semroc,ST-770,1.8161,1.9279,17.78
|
||||
Semroc,ST-790,1.8161,1.9279,22.86
|
||||
Semroc,ST-7100,1.8161,1.9279,25.4
|
||||
Semroc,ST-7120,1.8161,1.9279,30.48
|
||||
Semroc,ST-7180,1.8161,1.9279,45.72
|
||||
Semroc,ST-820,2.1971,2.3063,5.08
|
||||
Semroc,ST-823,2.1971,2.3063,5.715
|
||||
Semroc,ST-825,2.1971,2.3063,6.35
|
||||
Semroc,ST-830,2.1971,2.3063,7.62
|
||||
Semroc,ST-845,2.1971,2.3063,11.43
|
||||
Semroc,ST-855,2.1971,2.3063,13.97
|
||||
Semroc,ST-857,2.1971,2.3063,14.478
|
||||
Semroc,ST-860,2.1971,2.3063,15.24
|
||||
Semroc,ST-873,2.1971,2.3063,18.542
|
||||
Semroc,ST-880,2.1971,2.3063,20.32
|
||||
Semroc,ST-890,2.1971,2.3063,22.86
|
||||
Semroc,ST-8100,2.1971,2.3063,25.4
|
||||
Semroc,ST-8103,2.1971,2.3063,26.162
|
||||
Semroc,ST-8105,2.1971,2.3063,26.67
|
||||
Semroc,ST-8113,2.1971,2.3063,28.702
|
||||
Semroc,ST-8120,2.1971,2.3063,30.48
|
||||
Semroc,ST-8130,2.1971,2.3063,33.02
|
||||
Semroc,ST-8150,2.1971,2.3063,38.1
|
||||
Semroc,ST-8157,2.1971,2.3063,40.005
|
||||
Semroc,ST-8180,2.1971,2.3063,45.72
|
||||
Semroc,ST-8F28,2.2479,2.3393,6.985
|
||||
Semroc,ST-8F33,2.2479,2.3393,8.255
|
||||
Semroc,ST-8F40,2.2479,2.3393,10.16
|
||||
Semroc,ST-8F60,2.2479,2.3393,15.24
|
||||
Semroc,ST-8F80,2.2479,2.3393,20.32
|
||||
Semroc,ST-8F90,2.2479,2.3393,22.86
|
||||
Semroc,ST-8F90M,2.2479,2.3393,22.86
|
||||
Semroc,ST-8F120,2.2479,2.3393,30.48
|
||||
Semroc,ST-8F180,2.2479,2.3393,45.72
|
||||
Semroc,ST-930,2.413,2.5349,7.62
|
||||
Semroc,ST-940,2.413,2.5349,10.16
|
||||
Semroc,ST-940E,2.413,2.5349,10.16
|
||||
Semroc,ST-950,2.413,2.5349,12.7
|
||||
Semroc,ST-950E,2.413,2.5349,12.7
|
||||
Semroc,ST-980,2.413,2.5349,20.32
|
||||
Semroc,ST-990,2.413,2.5349,22.86
|
||||
Semroc,ST-9180,2.413,2.5349,45.72
|
||||
Semroc,ST-1020,2.54,2.6416,5.08
|
||||
Semroc,ST-1030,2.54,2.6416,7.62
|
||||
Semroc,ST-1040,2.54,2.6416,10.16
|
||||
Semroc,ST-1050,2.54,2.6416,12.7
|
||||
Semroc,ST-1060,2.54,2.6416,15.24
|
||||
Semroc,ST-1080,2.54,2.6416,20.32
|
||||
Semroc,ST-1094,2.54,2.6416,23.876
|
||||
Semroc,ST-1095,2.54,2.6416,24.13
|
||||
Semroc,ST-10100,2.54,2.6416,25.4
|
||||
Semroc,ST-10105,2.54,2.6416,26.67
|
||||
Semroc,ST-10120,2.54,2.6416,30.48
|
||||
Semroc,ST-10130,2.54,2.6416,33.02
|
||||
Semroc,ST-10180,2.54,2.6416,45.72
|
||||
Semroc,ST-1160,2.8702,2.9718,15.24
|
||||
Semroc,ST-1180,2.8702,2.9718,20.32
|
||||
Semroc,ST-1190,2.8702,2.9718,22.86
|
||||
Semroc,ST-11120,2.8702,2.9718,30.48
|
||||
Semroc,ST-11125,2.8702,2.9718,31.75
|
||||
Semroc,ST-11133,2.8702,2.9718,33.655
|
||||
Semroc,ST-11158,2.8702,2.9718,40.132
|
||||
Semroc,ST-11180,2.8702,2.9718,45.72
|
||||
Semroc,ST-1323,3.302,3.4036,5.715
|
||||
Semroc,ST-1330,3.302,3.4036,7.62
|
||||
Semroc,ST-1340,3.302,3.4036,10.16
|
||||
Semroc,ST-1360,3.302,3.4036,15.24
|
||||
Semroc,ST-1363,3.302,3.4036,15.875
|
||||
Semroc,ST-1380,3.302,3.4036,20.32
|
||||
Semroc,ST-1383,3.302,3.4036,20.98
|
||||
Semroc,ST-13105,3.302,3.4036,26.67
|
||||
Semroc,ST-13120,3.302,3.4036,30.48
|
||||
Semroc,ST-13130,3.302,3.4036,33.02
|
||||
Semroc,ST-13135,3.302,3.4036,34.29
|
||||
Semroc,ST-13180,3.302,3.4036,45.72
|
||||
Semroc,ST-1620,4.064,4.1656,5.08
|
||||
Semroc,ST-1622,4.064,4.1656,5.715
|
||||
Semroc,ST-1630,4.064,4.1656,7.62
|
||||
Semroc,ST-1645,4.064,4.1656,11.43
|
||||
Semroc,ST-1650,4.064,4.1656,12.7
|
||||
Semroc,ST-1652,4.064,4.1656,13.335
|
||||
Semroc,ST-1660,4.064,4.1656,15.24
|
||||
Semroc,ST-1667,4.064,4.1656,17.018
|
||||
Semroc,ST-1675,4.064,4.1656,19.05
|
||||
Semroc,ST-1685,4.064,4.1656,21.59
|
||||
Semroc,ST-1690,4.064,4.1656,22.86
|
||||
Semroc,ST-16100,4.064,4.1656,25.4
|
||||
Semroc,ST-16109,4.064,4.1656,27.686
|
||||
Semroc,ST-16110,4.064,4.1656,27.94
|
||||
Semroc,ST-16120,4.064,4.1656,30.48
|
||||
Semroc,ST-16128,4.064,4.1656,32.512
|
||||
Semroc,ST-16130,4.064,4.1656,33.02
|
||||
Semroc,ST-16132,4.064,4.1656,33.528
|
||||
Semroc,ST-16151,4.064,4.1656,38.405
|
||||
Semroc,ST-16160,4.064,4.1656,40.64
|
||||
Semroc,ST-16161,4.064,4.1656,40.958
|
||||
Semroc,ST-16163,4.064,4.1656,41.275
|
||||
Semroc,ST-16180,4.064,4.1656,45.72
|
||||
Semroc,ST-1817,4.572,4.6736,4.318
|
||||
Semroc,ST-1830,4.572,4.6736,7.62
|
||||
Semroc,ST-1844,4.572,4.6736,11.113
|
||||
Semroc,ST-1860,4.572,4.6736,15.24
|
||||
Semroc,ST-1890,4.572,4.6736,22.86
|
||||
Semroc,ST-18120,4.572,4.6736,30.48
|
||||
Semroc,ST-18180,4.572,4.6736,45.72
|
||||
Semroc,ST-2030,5.08,5.1816,7.62
|
||||
Semroc,ST-2050,5.08,5.1816,12.7
|
||||
Semroc,ST-2060,5.08,5.1816,15.24
|
||||
Semroc,ST-2090,5.08,5.1816,22.86
|
||||
Semroc,ST-2098,5.08,5.1816,24.892
|
||||
Semroc,ST-20120,5.08,5.1816,30.48
|
||||
Semroc,ST-20128,5.08,5.1816,32.512
|
||||
Semroc,ST-20140,5.08,5.1816,35.56
|
||||
Semroc,ST-20145,5.08,5.1816,36.83
|
||||
Semroc,ST-20180,5.08,5.1816,45.72
|
||||
Semroc,ST-27014,6.792,6.858,3.505
|
||||
Semroc,ST-27180,6.792,6.858,45.72
|
||||
Semroc,ST-3630,9.144,9.3726,7.62
|
||||
Semroc,LT-08580,2.1971,2.4003,20.32
|
||||
Semroc,LT-085160,2.1971,2.4003,40.64
|
||||
Semroc,LT-085220,2.1971,2.4003,55.88
|
||||
Semroc,LT-085300,2.1971,2.4003,76.2
|
||||
Semroc,LT-11530,2.8956,3.0988,7.62
|
||||
Semroc,LT-11535,2.8956,3.0988,8.89
|
||||
Semroc,LT-11550,2.8956,3.0988,12.7
|
||||
Semroc,LT-11555,2.8956,3.0988,13.97
|
||||
Semroc,LT-11560,2.8956,3.0988,15.24
|
||||
Semroc,LT-11575,2.8956,3.0988,19.05
|
||||
Semroc,LT-11580,2.8956,3.0988,20.32
|
||||
Semroc,LT-115109,2.8956,3.0988,27.686
|
||||
Semroc,LT-115160,2.8956,3.0988,40.64
|
||||
Semroc,LT-115160S4,2.8956,3.0988,40.64
|
||||
Semroc,LT-115170,2.8956,3.0988,43.18
|
||||
Semroc,LT-115180,2.8956,3.0988,45.72
|
||||
Semroc,LT-115220,2.8956,3.0988,55.88
|
||||
Semroc,LT-115300,2.8956,3.0988,76.2
|
||||
Semroc,LT-12580,3.175,3.4036,20.32
|
||||
Semroc,LT-125122,3.175,3.4036,30.988
|
||||
Semroc,LT-125122S3,3.175,3.4036,30.988
|
||||
Semroc,LT-125150,3.175,3.4036,38.1
|
||||
Semroc,LT-125150S4,3.175,3.4036,38.1
|
||||
Semroc,LT-125157S4,3.175,3.4036,39.878
|
||||
Semroc,LT-125220,3.175,3.4036,55.88
|
||||
Semroc,LT-125220S4,3.175,3.4036,55.88
|
||||
Semroc,LT-125300,3.175,3.4036,76.2
|
||||
Semroc,LT-15080,3.81,4.0386,20.32
|
||||
Semroc,LT-150220,3.81,4.0386,55.88
|
||||
Semroc,LT-150300,3.81,4.0386,76.2
|
||||
Semroc,LT-150300S3,3.81,4.0386,76.2
|
||||
Semroc,LT-17555,4.445,4.6736,13.97
|
||||
Semroc,LT-17560,4.445,4.6736,15.24
|
||||
Semroc,LT-17580,4.445,4.6736,20.32
|
||||
Semroc,LT-175120,4.445,4.6736,30.48
|
||||
Semroc,LT-175165,4.445,4.6736,41.91
|
||||
Semroc,LT-175200,4.445,4.6736,50.8
|
||||
Semroc,LT-175200S4,4.445,4.6736,50.8
|
||||
Semroc,LT-175220,4.445,4.6736,55.88
|
||||
Semroc,LT-175220S3,4.445,4.6736,55.88
|
||||
Semroc,LT-175220S4,4.445,4.6736,55.88
|
||||
Semroc,LT-175300,4.445,4.6736,76.2
|
||||
Semroc,LT-20080,5.08,5.2832,20.32
|
||||
Semroc,LT-200215,5.08,5.2832,54.61
|
||||
Semroc,LT-200220,5.08,5.2832,55.88
|
||||
Semroc,LT-200300,5.08,5.2832,76.2
|
||||
Semroc,LT-22560,5.715,5.9436,15.24
|
||||
Semroc,LT-22570,5.715,5.9436,17.78
|
||||
Semroc,LT-22580,5.715,5.9436,20.32
|
||||
Semroc,LT-225140,5.715,5.9436,35.56
|
||||
Semroc,LT-225140S4,5.715,5.9436,35.56
|
||||
Semroc,LT-225159S4,5.715,5.9436,40.386
|
||||
Semroc,LT-225187S3,5.715,5.9436,47.498
|
||||
Semroc,LT-225220,5.715,5.9436,55.88
|
||||
Semroc,LT-225220S3,5.715,5.9436,55.88
|
||||
Semroc,LT-225290S3,5.715,5.9436,73.66
|
||||
Semroc,LT-225300,5.715,5.9436,76.2
|
||||
Semroc,LT-225300S3,5.715,5.9436,76.2
|
||||
Semroc,LT-225300S3L,5.715,5.9436,76.2
|
||||
Semroc,LT-27580,6.985,7.2136,20.32
|
||||
Semroc,LT-275220,6.985,7.2136,55.88
|
||||
Semroc,LT-275300,6.985,7.2136,76.2
|
||||
Semroc,CPT-719,1.8161,1.9279,4.75
|
||||
Semroc,CPT-722,1.8161,1.9279,5.715
|
||||
Semroc,CPT-7180,1.8161,1.9279,45.72
|
||||
Semroc,CPT-825,2.1971,2.3063,6.35
|
||||
Semroc,CPT-835,2.1971,2.3063,8.89
|
||||
Semroc,CPT-8180,2.1971,2.3063,45.72
|
||||
Semroc,PST-50,2.413,2.479,45.72
|
||||
Semroc,PST-50S,2.413,2.479,10.16
|
||||
Semroc,PST-50FJ,2.413,2.479,15.24
|
||||
Semroc,PST-55,3.2588,3.3655,30.48
|
||||
Semroc,PST-55-180,3.2588,3.3655,45.72
|
|
@ -572,6 +572,7 @@ ringcompcfg.note.desc = Note: An inner tube will not affect the aerodynamics of
|
||||
|
||||
! Body Tube Config
|
||||
BodyTubecfg.lbl.Bodytubelength = Body tube length:
|
||||
BodyTubecfg.lbl.Bodytubepreset = Body tube preset:
|
||||
BodyTubecfg.lbl.Outerdiameter = Outer diameter:
|
||||
BodyTubecfg.lbl.Innerdiameter = Inner diameter:
|
||||
BodyTubecfg.lbl.Wallthickness = Wall thickness:
|
||||
|
50
core/src/net/sf/openrocket/database/BodyTubePresetDao.java
Normal file
50
core/src/net/sf/openrocket/database/BodyTubePresetDao.java
Normal file
@ -0,0 +1,50 @@
|
||||
package net.sf.openrocket.database;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.sf.openrocket.preset.ComponentPreset;
|
||||
import net.sf.openrocket.rocketcomponent.BodyTube;
|
||||
import au.com.bytecode.opencsv.CSVReader;
|
||||
|
||||
public class BodyTubePresetDao {
|
||||
|
||||
private final List<ComponentPreset> templates = new ArrayList<ComponentPreset>();
|
||||
|
||||
// Package scope constructor to control creation pattern.
|
||||
BodyTubePresetDao() {}
|
||||
|
||||
void initialize() throws IOException {
|
||||
|
||||
InputStream is = BodyTubePresetDao.class.getResourceAsStream("/datafiles/bodytubepresets.csv");
|
||||
InputStreamReader r = new InputStreamReader(is);
|
||||
// Create the CSV reader. Use comma separator and double-quote escaping. Skip first line.
|
||||
CSVReader reader = new CSVReader(r,',','"',1);
|
||||
String[] line;
|
||||
while( (line = reader.readNext()) != null ) {
|
||||
String manu = line[0];
|
||||
String prod = line[1];
|
||||
// inner diameter in centimeters
|
||||
String idString = line[2];
|
||||
double innerRadius = Double.parseDouble(idString) /100.0/2.0;
|
||||
// outer diameter in centimeters
|
||||
String odString = line[3];
|
||||
double outerRadius = Double.parseDouble(odString) /100.0/2.0;
|
||||
// length in centimeters
|
||||
String maxLength = line[4];
|
||||
double length = Double.parseDouble(maxLength) /100.0;
|
||||
BodyTube bt = new BodyTube(length, outerRadius, outerRadius - innerRadius );
|
||||
ComponentPreset preset = new ComponentPreset( manu, prod, "", bt );
|
||||
templates.add(preset);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<ComponentPreset> listAll() {
|
||||
return templates;
|
||||
}
|
||||
|
||||
}
|
7
core/src/net/sf/openrocket/database/Daos.java
Normal file
7
core/src/net/sf/openrocket/database/Daos.java
Normal file
@ -0,0 +1,7 @@
|
||||
package net.sf.openrocket.database;
|
||||
|
||||
public interface Daos {
|
||||
|
||||
public BodyTubePresetDao getBodyTubePresetDao();
|
||||
|
||||
}
|
19
core/src/net/sf/openrocket/database/DaosImpl.java
Normal file
19
core/src/net/sf/openrocket/database/DaosImpl.java
Normal file
@ -0,0 +1,19 @@
|
||||
package net.sf.openrocket.database;
|
||||
|
||||
|
||||
public class DaosImpl implements Daos {
|
||||
|
||||
private BodyTubePresetDao bodyTubePresetDao;
|
||||
|
||||
public DaosImpl() throws Exception {
|
||||
bodyTubePresetDao = new BodyTubePresetDao();
|
||||
bodyTubePresetDao.initialize();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public BodyTubePresetDao getBodyTubePresetDao() {
|
||||
return bodyTubePresetDao;
|
||||
}
|
||||
|
||||
}
|
105
core/src/net/sf/openrocket/gui/adaptors/BodyTubePresetModel.java
Normal file
105
core/src/net/sf/openrocket/gui/adaptors/BodyTubePresetModel.java
Normal file
@ -0,0 +1,105 @@
|
||||
package net.sf.openrocket.gui.adaptors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.AbstractListModel;
|
||||
import javax.swing.ComboBoxModel;
|
||||
import javax.swing.event.ListDataListener;
|
||||
|
||||
import net.sf.openrocket.preset.ComponentPreset;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeListener;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
|
||||
public class BodyTubePresetModel extends AbstractListModel implements
|
||||
ComboBoxModel, ComponentChangeListener {
|
||||
|
||||
private final RocketComponent component;
|
||||
|
||||
private List<ComponentPreset> presets;
|
||||
|
||||
public BodyTubePresetModel(RocketComponent component) {
|
||||
presets = Application.getDaos().getBodyTubePresetDao().listAll();
|
||||
this.component = component;
|
||||
}
|
||||
|
||||
public static class BodyTubePresetAdapter {
|
||||
private ComponentPreset bt;
|
||||
private BodyTubePresetAdapter( ComponentPreset bt ) {
|
||||
this.bt = bt;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return bt.getManufacturer() + " " + bt.getPartNo();
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((bt == null) ? 0 : bt.hashCode());
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
BodyTubePresetAdapter other = (BodyTubePresetAdapter) obj;
|
||||
if (bt == null) {
|
||||
if (other.bt != null)
|
||||
return false;
|
||||
} else if (!bt.equals(other.bt))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
return presets.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getElementAt(int index) {
|
||||
return new BodyTubePresetAdapter(presets.get(index));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeListDataListener(ListDataListener l) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentChanged(ComponentChangeEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelectedItem(Object anItem) {
|
||||
BodyTubePresetAdapter selected = (BodyTubePresetAdapter) anItem;
|
||||
component.loadPreset(selected.bt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getSelectedItem() {
|
||||
ComponentPreset preset = (ComponentPreset) component.getPresetComponent();
|
||||
if ( preset == null ) {
|
||||
return null;
|
||||
} else {
|
||||
return new BodyTubePresetAdapter(preset);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -157,7 +157,8 @@ public class DoubleModel implements StateChangeListener, ChangeSource, Invalidat
|
||||
* Use linear scale value = linear1 * x + linear0 when x < linearPosition
|
||||
* Use quadratic scale value = quad2 * x^2 + quad1 * x + quad0 otherwise
|
||||
*/
|
||||
|
||||
private final boolean islinear;
|
||||
|
||||
// Linear in range x <= linearPosition
|
||||
private final double linearPosition;
|
||||
|
||||
@ -169,11 +170,10 @@ public class DoubleModel implements StateChangeListener, ChangeSource, Invalidat
|
||||
//private final double linear0;
|
||||
|
||||
// Non-linear multiplier, exponent and constant
|
||||
private final double quad2, quad1, quad0;
|
||||
|
||||
|
||||
private double quad2, quad1, quad0;
|
||||
|
||||
public ValueSliderModel(DoubleModel min, DoubleModel max) {
|
||||
this.islinear = true;
|
||||
linearPosition = 1.0;
|
||||
|
||||
this.min = min;
|
||||
@ -192,6 +192,7 @@ public class DoubleModel implements StateChangeListener, ChangeSource, Invalidat
|
||||
* Generate a linear model from min to max.
|
||||
*/
|
||||
public ValueSliderModel(double min, double max) {
|
||||
this.islinear = true;
|
||||
linearPosition = 1.0;
|
||||
|
||||
this.min = new DoubleModel(min);
|
||||
@ -205,6 +206,10 @@ public class DoubleModel implements StateChangeListener, ChangeSource, Invalidat
|
||||
this(min, 0.5, mid, max);
|
||||
}
|
||||
|
||||
public ValueSliderModel(double min, double mid, DoubleModel max) {
|
||||
this(min, 0.5, mid, max);
|
||||
}
|
||||
|
||||
/*
|
||||
* v(x) = mul * x^exp + add
|
||||
*
|
||||
@ -212,33 +217,46 @@ public class DoubleModel implements StateChangeListener, ChangeSource, Invalidat
|
||||
* v(1) = mul + add = max
|
||||
* v'(pos) = mul*exp * pos^(exp-1) = linearMul
|
||||
*/
|
||||
public ValueSliderModel(double min, double pos, double mid, double max) {
|
||||
public ValueSliderModel(double min, double pos, double mid, double max ) {
|
||||
this(min, pos, mid, new DoubleModel(max));
|
||||
}
|
||||
public ValueSliderModel(double min, double pos, double mid, DoubleModel max) {
|
||||
this.min = new DoubleModel(min);
|
||||
this.mid = new DoubleModel(mid);
|
||||
this.max = new DoubleModel(max);
|
||||
|
||||
this.max = max;
|
||||
|
||||
this.islinear = false;
|
||||
|
||||
max.addChangeListener(this);
|
||||
|
||||
linearPosition = pos;
|
||||
//linear0 = min;
|
||||
//linear1 = (mid-min)/pos;
|
||||
|
||||
if (!(min < mid && mid <= max && 0 < pos && pos < 1)) {
|
||||
if (!(min < mid && mid <= max.getValue() && 0 < pos && pos < 1)) {
|
||||
throw new IllegalArgumentException("Bad arguments for ValueSliderModel " +
|
||||
"min=" + min + " mid=" + mid + " max=" + max + " pos=" + pos);
|
||||
}
|
||||
|
||||
updateExponentialParameters();
|
||||
|
||||
}
|
||||
|
||||
private void updateExponentialParameters() {
|
||||
double pos = this.linearPosition;
|
||||
double minValue = this.min.getValue();
|
||||
double midValue = this.mid.getValue();
|
||||
double maxValue = this.max.getValue();
|
||||
/*
|
||||
* quad2..0 are calculated such that
|
||||
* f(pos) = mid - continuity
|
||||
* f(1) = max - end point
|
||||
* f'(pos) = linear1 - continuity of derivative
|
||||
*/
|
||||
|
||||
double delta = (mid - min) / pos;
|
||||
quad2 = (max - mid - delta + delta * pos) / pow2(pos - 1);
|
||||
quad1 = (delta + 2 * (mid - max) * pos - delta * pos * pos) / pow2(pos - 1);
|
||||
quad0 = (mid - (2 * mid + delta) * pos + (max + delta) * pos * pos) / pow2(pos - 1);
|
||||
|
||||
double delta = (midValue - minValue) / pos;
|
||||
quad2 = (maxValue - midValue - delta + delta * pos) / pow2(pos - 1);
|
||||
quad1 = (delta + 2 * (midValue - maxValue) * pos - delta * pos * pos) / pow2(pos - 1);
|
||||
quad0 = (midValue - (2 * midValue + delta) * pos + (maxValue + delta) * pos * pos) / pow2(pos - 1);
|
||||
}
|
||||
|
||||
private double pow2(double x) {
|
||||
@ -366,6 +384,11 @@ public class DoubleModel implements StateChangeListener, ChangeSource, Invalidat
|
||||
@Override
|
||||
public void stateChanged(EventObject e) {
|
||||
// Min or max range has changed.
|
||||
if ( !islinear ) {
|
||||
double midValue = (max.getValue() - min.getValue()) /3.0;
|
||||
mid.setValue(midValue);
|
||||
updateExponentialParameters();
|
||||
}
|
||||
// Fire if not already firing
|
||||
if (firing == 0)
|
||||
fireStateChanged();
|
||||
@ -385,6 +408,10 @@ public class DoubleModel implements StateChangeListener, ChangeSource, Invalidat
|
||||
return new ValueSliderModel(min, mid, max);
|
||||
}
|
||||
|
||||
public BoundedRangeModel getSliderModel(double min, double mid, DoubleModel max) {
|
||||
return new ValueSliderModel(min, mid, max);
|
||||
}
|
||||
|
||||
public BoundedRangeModel getSliderModel(double min, double pos, double mid, double max) {
|
||||
return new ValueSliderModel(min, pos, mid, max);
|
||||
}
|
||||
@ -516,7 +543,7 @@ public class DoubleModel implements StateChangeListener, ChangeSource, Invalidat
|
||||
private Unit currentUnit;
|
||||
|
||||
private final double minValue;
|
||||
private final double maxValue;
|
||||
private double maxValue;
|
||||
|
||||
private String toString = null;
|
||||
|
||||
@ -725,7 +752,6 @@ public class DoubleModel implements StateChangeListener, ChangeSource, Invalidat
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether setting the value automatically is available.
|
||||
*/
|
||||
|
@ -2,6 +2,7 @@ package net.sf.openrocket.gui.configdialog;
|
||||
|
||||
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JSpinner;
|
||||
@ -9,6 +10,7 @@ import javax.swing.JSpinner;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import net.sf.openrocket.document.OpenRocketDocument;
|
||||
import net.sf.openrocket.gui.SpinnerEditor;
|
||||
import net.sf.openrocket.gui.adaptors.BodyTubePresetModel;
|
||||
import net.sf.openrocket.gui.adaptors.BooleanModel;
|
||||
import net.sf.openrocket.gui.adaptors.DoubleModel;
|
||||
import net.sf.openrocket.gui.components.BasicSlider;
|
||||
@ -16,12 +18,15 @@ import net.sf.openrocket.gui.components.UnitSelector;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.material.Material;
|
||||
import net.sf.openrocket.rocketcomponent.BodyTube;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeListener;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.unit.UnitGroup;
|
||||
|
||||
public class BodyTubeConfig extends RocketComponentConfig {
|
||||
|
||||
private ComponentChangeListener listener;
|
||||
private MotorConfig motorConfigPane = null;
|
||||
private static final Translator trans = Application.getTranslator();
|
||||
|
||||
@ -30,17 +35,25 @@ public class BodyTubeConfig extends RocketComponentConfig {
|
||||
|
||||
JPanel panel = new JPanel(new MigLayout("gap rel unrel", "[][65lp::][30lp::][]", ""));
|
||||
|
||||
//// Body tube template
|
||||
panel.add( new JLabel(trans.get("BodyTubecfg.lbl.Bodytubepreset")) );
|
||||
{
|
||||
JComboBox combo = new JComboBox(new BodyTubePresetModel(component));
|
||||
panel.add(combo, "wrap");
|
||||
}
|
||||
|
||||
//// Body tube length
|
||||
panel.add(new JLabel(trans.get("BodyTubecfg.lbl.Bodytubelength")));
|
||||
|
||||
DoubleModel m = new DoubleModel(component, "Length", UnitGroup.UNITS_LENGTH, 0);
|
||||
final DoubleModel maxLength = new DoubleModel(2.0);
|
||||
DoubleModel length = new DoubleModel(component, "Length", UnitGroup.UNITS_LENGTH, 0);
|
||||
|
||||
JSpinner spin = new JSpinner(m.getSpinnerModel());
|
||||
JSpinner spin = new JSpinner(length.getSpinnerModel());
|
||||
spin.setEditor(new SpinnerEditor(spin));
|
||||
panel.add(spin, "growx");
|
||||
|
||||
panel.add(new UnitSelector(m), "growx");
|
||||
panel.add(new BasicSlider(m.getSliderModel(0, 0.5, 2.0)), "w 100lp, wrap");
|
||||
panel.add(new UnitSelector(length), "growx");
|
||||
panel.add(new BasicSlider(length.getSliderModel(0, 0.5, maxLength)), "w 100lp, wrap");
|
||||
|
||||
|
||||
//// Body tube diameter
|
||||
@ -66,7 +79,7 @@ public class BodyTubeConfig extends RocketComponentConfig {
|
||||
panel.add(new JLabel(trans.get("BodyTubecfg.lbl.Innerdiameter")));
|
||||
|
||||
// Diameter = 2*Radius
|
||||
m = new DoubleModel(component, "InnerRadius", 2, UnitGroup.UNITS_LENGTH, 0);
|
||||
DoubleModel m = new DoubleModel(component, "InnerRadius", 2, UnitGroup.UNITS_LENGTH, 0);
|
||||
|
||||
|
||||
spin = new JSpinner(m.getSpinnerModel());
|
||||
@ -107,6 +120,29 @@ public class BodyTubeConfig extends RocketComponentConfig {
|
||||
tabbedPane.insertTab(trans.get("BodyTubecfg.tab.Motor"), null, motorConfigPane,
|
||||
trans.get("BodyTubecfg.tab.Motormountconf"), 1);
|
||||
tabbedPane.setSelectedIndex(0);
|
||||
|
||||
// need to work in the max length for body tubes based on presets...
|
||||
BodyTube bt = (BodyTube) component;
|
||||
if ( bt.getPresetComponent() != null ) {
|
||||
BodyTube btPreset = (BodyTube) bt.getPresetComponent().getPrototype();
|
||||
maxLength.setValue( btPreset.getLength() );
|
||||
}
|
||||
|
||||
listener = new ComponentChangeListener() {
|
||||
|
||||
@Override
|
||||
public void componentChanged(ComponentChangeEvent e) {
|
||||
BodyTube bt = (BodyTube) component;
|
||||
if ( bt.getPresetComponent() != null ) {
|
||||
BodyTube btPreset = (BodyTube) bt.getPresetComponent().getPrototype();
|
||||
maxLength.setValue(btPreset.getLength());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
component.addChangeListener(listener);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -115,5 +151,11 @@ public class BodyTubeConfig extends RocketComponentConfig {
|
||||
if (motorConfigPane != null)
|
||||
motorConfigPane.updateFields();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidateModels() {
|
||||
super.invalidateModels();
|
||||
component.removeChangeListener(listener);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
package net.sf.openrocket.preset;
|
||||
|
||||
import net.sf.openrocket.motor.Manufacturer;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
|
||||
|
||||
/**
|
||||
* A model for a preset component.
|
||||
* <p>
|
||||
@ -11,63 +11,63 @@ import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
*
|
||||
* @author Sampo Niskanen <sampo.niskanen@iki.fi>
|
||||
*/
|
||||
public abstract class ComponentPreset {
|
||||
|
||||
private final Manufacturer manufacturer;
|
||||
public class ComponentPreset {
|
||||
|
||||
|
||||
private final String manufacturer;
|
||||
private final String partNo;
|
||||
private final String partDescription;
|
||||
private final RocketComponent prototype;
|
||||
|
||||
|
||||
public ComponentPreset(Manufacturer manufacturer, String partNo, String partDescription,
|
||||
RocketComponent prototype) {
|
||||
|
||||
|
||||
public ComponentPreset(String manufacturer, String partNo, String partDescription, RocketComponent prototype) {
|
||||
this.manufacturer = manufacturer;
|
||||
this.partNo = partNo;
|
||||
this.partDescription = partDescription;
|
||||
this.prototype = prototype.copy();
|
||||
|
||||
|
||||
if (prototype.getParent() != null) {
|
||||
throw new IllegalArgumentException("Prototype component cannot have a parent");
|
||||
}
|
||||
if (prototype.getChildCount() > 0) {
|
||||
throw new IllegalArgumentException("Prototype component cannot have children");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the component class that this preset defines.
|
||||
*/
|
||||
public Class<? extends RocketComponent> getComponentClass() {
|
||||
return prototype.getClass();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the manufacturer of this preset component.
|
||||
*/
|
||||
public Manufacturer getManufacturer() {
|
||||
public String getManufacturer() {
|
||||
return manufacturer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the part number. This is the part identifier (e.g. "BT-50").
|
||||
*/
|
||||
public String getPartNo() {
|
||||
return partNo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the part description. This is a longer description of the component.
|
||||
*/
|
||||
public String getPartDescription() {
|
||||
return partDescription;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a prototype component. This component may be modified freely.
|
||||
*/
|
||||
public RocketComponent getPrototype() {
|
||||
return prototype.copy();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -135,13 +135,16 @@ public class BodyTube extends SymmetricComponent implements MotorMount, Coaxial
|
||||
|
||||
@Override
|
||||
protected void loadFromPreset(RocketComponent preset) {
|
||||
BodyTube c = (BodyTube) preset;
|
||||
this.setOuterRadius(c.getOuterRadius());
|
||||
|
||||
super.loadFromPreset(preset);
|
||||
BodyTube bt = (BodyTube) preset;
|
||||
this.autoRadius = false;
|
||||
this.outerRadius = bt.getOuterRadius();
|
||||
this.thickness = (bt.getOuterRadius() - bt.getInnerRadius());
|
||||
this.length = bt.getLength();
|
||||
|
||||
fireComponentChangeEvent(ComponentChangeEvent.MASS_CHANGE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getAftRadius() {
|
||||
return getOuterRadius();
|
||||
|
@ -17,7 +17,7 @@ import net.sf.openrocket.unit.UnitGroup;
|
||||
*/
|
||||
|
||||
public abstract class ExternalComponent extends RocketComponent {
|
||||
|
||||
|
||||
public enum Finish {
|
||||
//// Rough
|
||||
ROUGH("ExternalComponent.Rough", 500e-6),
|
||||
@ -29,35 +29,35 @@ public abstract class ExternalComponent extends RocketComponent {
|
||||
SMOOTH("ExternalComponent.Smoothpaint", 20e-6),
|
||||
//// Polished
|
||||
POLISHED("ExternalComponent.Polished", 2e-6);
|
||||
|
||||
|
||||
private static final Translator trans = Application.getTranslator();
|
||||
private final String name;
|
||||
private final double roughnessSize;
|
||||
|
||||
|
||||
Finish(String name, double roughness) {
|
||||
this.name = name;
|
||||
this.roughnessSize = roughness;
|
||||
}
|
||||
|
||||
|
||||
public double getRoughnessSize() {
|
||||
return roughnessSize;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return trans.get(name) + " (" + UnitGroup.UNITS_ROUGHNESS.toStringUnit(roughnessSize) + ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The material of the component.
|
||||
*/
|
||||
protected Material material = null;
|
||||
|
||||
|
||||
protected Finish finish = Finish.NORMAL;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor that sets the relative position of the component.
|
||||
@ -66,13 +66,13 @@ public abstract class ExternalComponent extends RocketComponent {
|
||||
super(relativePosition);
|
||||
this.material = Application.getPreferences().getDefaultComponentMaterial(this.getClass(), Material.Type.BULK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the volume of the component. This value is used in calculating the mass
|
||||
* of the object.
|
||||
*/
|
||||
public abstract double getComponentVolume();
|
||||
|
||||
|
||||
/**
|
||||
* Calculates the mass of the component as the product of the volume and interior density.
|
||||
*/
|
||||
@ -80,7 +80,7 @@ public abstract class ExternalComponent extends RocketComponent {
|
||||
public double getComponentMass() {
|
||||
return material.getDensity() * getComponentVolume();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ExternalComponent has aerodynamic effect, so return true.
|
||||
*/
|
||||
@ -88,7 +88,7 @@ public abstract class ExternalComponent extends RocketComponent {
|
||||
public boolean isAerodynamic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ExternalComponent has effect on the mass, so return true.
|
||||
*/
|
||||
@ -96,18 +96,18 @@ public abstract class ExternalComponent extends RocketComponent {
|
||||
public boolean isMassive() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public Material getMaterial() {
|
||||
return material;
|
||||
}
|
||||
|
||||
|
||||
public void setMaterial(Material mat) {
|
||||
if (mat.getType() != Material.Type.BULK) {
|
||||
throw new IllegalArgumentException("ExternalComponent requires a bulk material" +
|
||||
" type=" + mat.getType());
|
||||
}
|
||||
|
||||
|
||||
if (material.equals(mat))
|
||||
return;
|
||||
material = mat;
|
||||
@ -115,29 +115,31 @@ public abstract class ExternalComponent extends RocketComponent {
|
||||
fireComponentChangeEvent(ComponentChangeEvent.MASS_CHANGE);
|
||||
clearPreset();
|
||||
}
|
||||
|
||||
|
||||
public Finish getFinish() {
|
||||
return finish;
|
||||
}
|
||||
|
||||
|
||||
public void setFinish(Finish finish) {
|
||||
if (this.finish == finish)
|
||||
return;
|
||||
this.finish = finish;
|
||||
fireComponentChangeEvent(ComponentChangeEvent.AERODYNAMIC_CHANGE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void loadFromPreset(RocketComponent preset) {
|
||||
super.loadFromPreset(preset);
|
||||
|
||||
|
||||
// Surface finish is left unchanged
|
||||
|
||||
|
||||
ExternalComponent c = (ExternalComponent) preset;
|
||||
|
||||
|
||||
Material mat = c.getMaterial();
|
||||
if (c.isMassOverridden()) {
|
||||
if ( mat != null ) {
|
||||
setMaterial(mat);
|
||||
} else if (c.isMassOverridden()) {
|
||||
double mass = c.getOverrideMass();
|
||||
double volume = getComponentVolume();
|
||||
double density;
|
||||
@ -147,12 +149,11 @@ public abstract class ExternalComponent extends RocketComponent {
|
||||
density = 1000;
|
||||
}
|
||||
mat = Material.newMaterial(Type.BULK, mat.getName(), density, true);
|
||||
setMaterial(mat);
|
||||
}
|
||||
|
||||
setMaterial(mat);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected List<RocketComponent> copyFrom(RocketComponent c) {
|
||||
ExternalComponent src = (ExternalComponent) c;
|
||||
@ -160,5 +161,5 @@ public abstract class ExternalComponent extends RocketComponent {
|
||||
this.material = src.material;
|
||||
return super.copyFrom(c);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.sf.openrocket.startup;
|
||||
|
||||
import net.sf.openrocket.database.Daos;
|
||||
import net.sf.openrocket.database.MotorDatabase;
|
||||
import net.sf.openrocket.l10n.ClassBasedTranslator;
|
||||
import net.sf.openrocket.l10n.DebugTranslator;
|
||||
@ -23,6 +24,8 @@ public final class Application {
|
||||
private static Translator baseTranslator = new DebugTranslator(null);
|
||||
|
||||
private static MotorDatabase motorSetDatabase;
|
||||
|
||||
private static Daos daos;
|
||||
|
||||
private static Preferences preferences;
|
||||
|
||||
@ -159,6 +162,14 @@ public final class Application {
|
||||
public static void setMotorSetDatabase(MotorDatabase motorSetDatabase) {
|
||||
Application.motorSetDatabase = motorSetDatabase;
|
||||
}
|
||||
|
||||
public static Daos getDaos() {
|
||||
return daos;
|
||||
}
|
||||
|
||||
public static void setDaos(Daos daos) {
|
||||
Application.daos = daos;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import java.io.PrintStream;
|
||||
import java.util.Locale;
|
||||
import java.util.prefs.Preferences;
|
||||
|
||||
import net.sf.openrocket.database.DaosImpl;
|
||||
import net.sf.openrocket.gui.util.SwingPreferences;
|
||||
import net.sf.openrocket.l10n.DebugTranslator;
|
||||
import net.sf.openrocket.l10n.L10N;
|
||||
@ -52,6 +53,8 @@ public class Startup {
|
||||
|
||||
Application.setPreferences( new SwingPreferences() );
|
||||
|
||||
Application.setDaos( new DaosImpl() );
|
||||
|
||||
// Setup the translations
|
||||
initializeL10n();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user