Add new material types for rail buttons
Add two new material types for rail buttons, delrin and nylon. The material densities are pulled from wikipedia and cross-referenced with Dupont's material database. Additionally, set Delrin as the default material for RailButtons. Closes #554 Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
This commit is contained in:
		
							parent
							
								
									f8993e89db
								
							
						
					
					
						commit
						3995a330da
					
				| @ -1317,10 +1317,12 @@ material.brass = Brass | ||||
| material.cardboard = Cardboard | ||||
| material.carbon_fiber = Carbon fiber | ||||
| material.cork = Cork | ||||
| material.delrin = Delrin | ||||
| material.depron_xps = Depron (XPS) | ||||
| material.fiberglass = Fiberglass | ||||
| material.kraft_phenolic = Kraft phenolic | ||||
| material.maple = Maple | ||||
| material.nylon = Nylon | ||||
| material.paper_office = Paper (office) | ||||
| material.pine = Pine | ||||
| material.plywood_birch = Plywood (birch) | ||||
|  | ||||
| @ -50,10 +50,12 @@ public class Databases { | ||||
| 		BULK_MATERIAL.add(newMaterial(Material.Type.BULK, "Cardboard", 680)); | ||||
| 		BULK_MATERIAL.add(newMaterial(Material.Type.BULK, "Carbon fiber", 1780)); | ||||
| 		BULK_MATERIAL.add(newMaterial(Material.Type.BULK, "Cork", 240)); | ||||
| 		BULK_MATERIAL.add(newMaterial(Material.Type.BULK, "Delrin", 1420)); | ||||
| 		BULK_MATERIAL.add(newMaterial(Material.Type.BULK, "Depron (XPS)", 40)); | ||||
| 		BULK_MATERIAL.add(newMaterial(Material.Type.BULK, "Fiberglass", 1850)); | ||||
| 		BULK_MATERIAL.add(newMaterial(Material.Type.BULK, "Kraft phenolic", 950)); | ||||
| 		BULK_MATERIAL.add(newMaterial(Material.Type.BULK, "Maple", 755)); | ||||
| 		BULK_MATERIAL.add(newMaterial(Material.Type.BULK, "Nylon", 1150)); | ||||
| 		BULK_MATERIAL.add(newMaterial(Material.Type.BULK, "Paper (office)", 820)); | ||||
| 		BULK_MATERIAL.add(newMaterial(Material.Type.BULK, "Pine", 530)); | ||||
| 		BULK_MATERIAL.add(newMaterial(Material.Type.BULK, "Plywood (birch)", 630)); | ||||
|  | ||||
| @ -3,7 +3,9 @@ package net.sf.openrocket.rocketcomponent; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Collection; | ||||
| 
 | ||||
| import net.sf.openrocket.database.Databases; | ||||
| import net.sf.openrocket.l10n.Translator; | ||||
| import net.sf.openrocket.material.Material; | ||||
| import net.sf.openrocket.preset.ComponentPreset; | ||||
| import net.sf.openrocket.preset.ComponentPreset.Type; | ||||
| import net.sf.openrocket.rocketcomponent.position.AngleMethod; | ||||
| @ -65,6 +67,7 @@ public class RailButton extends ExternalComponent implements AnglePositionable, | ||||
| 		this.flangeHeight_m = 0.002; | ||||
| 		this.setStandoff( 0.002); | ||||
| 		this.setInstanceSeparation( this.outerDiameter_m * 6); | ||||
| 		this.setMaterial(Databases.findMaterial(Material.Type.BULK, "Delrin")); | ||||
| 	} | ||||
| 	 | ||||
| 	public RailButton( final double od, final double ht ) { | ||||
| @ -81,6 +84,7 @@ public class RailButton extends ExternalComponent implements AnglePositionable, | ||||
| 		this.flangeHeight_m = flangeThickness; | ||||
| 		this.setStandoff( _standoff); | ||||
| 		this.setInstanceSeparation( od*2); | ||||
| 		this.setMaterial(Databases.findMaterial(Material.Type.BULK, "Delrin")); | ||||
| 	} | ||||
| 	 | ||||
| 	private static final RailButton make1010Button(){ | ||||
|  | ||||
| @ -6,6 +6,7 @@ import javax.swing.JPanel; | ||||
| import javax.swing.JSpinner; | ||||
| 
 | ||||
| import net.miginfocom.swing.MigLayout; | ||||
| import net.sf.openrocket.database.Databases; | ||||
| import net.sf.openrocket.document.OpenRocketDocument; | ||||
| import net.sf.openrocket.gui.SpinnerEditor; | ||||
| import net.sf.openrocket.gui.adaptors.DoubleModel; | ||||
| @ -14,7 +15,6 @@ import net.sf.openrocket.gui.components.BasicSlider; | ||||
| 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.RailButton; | ||||
| import net.sf.openrocket.rocketcomponent.RocketComponent; | ||||
| import net.sf.openrocket.rocketcomponent.position.AxialMethod; | ||||
| @ -91,7 +91,6 @@ public class RailButtonConfig extends RocketComponentConfig { | ||||
| 		} | ||||
| 			 | ||||
| 		{ //// plus | ||||
| 			final double parentLength = ((BodyTube)rbc.getParent()).getLength(); | ||||
| 			panel.add(new JLabel(trans.get("RailBtnCfg.lbl.Plus")), "right"); | ||||
| 			DoubleModel offsetModel = new DoubleModel(component, "AxialOffset", UnitGroup.UNITS_LENGTH); | ||||
| 			JSpinner offsetSpinner = new JSpinner(offsetModel.getSpinnerModel()); | ||||
| @ -104,17 +103,7 @@ public class RailButtonConfig extends RocketComponentConfig { | ||||
| 					"w 100lp, wrap para"); | ||||
| 			 | ||||
| 		} | ||||
| 		 | ||||
| 		//// Material | ||||
| 		/* TODO (wolsen) confirm this removal | ||||
| 		 * I think the instanceablePanel should be removed and doesn't make much sense. I understand | ||||
| 		 * the idea that you may want to say "I have 2 rail buttons, 12 inches apart". I think in reality | ||||
| 		 * that most people would add 2 (or more) individual rail buttons at specific locations on the | ||||
| 		 * rocket. That will keep consistency with other components such as launch lugs. | ||||
| 		 */ | ||||
| 		//panel.add( instanceablePanel(rbc), "cell 4 0, spany 3, wrap para"); | ||||
| 		 | ||||
| 		 | ||||
| 				 | ||||
| 		//// Material | ||||
| 		panel.add(materialPanel(Material.Type.BULK),"span, wrap"); | ||||
| 		 | ||||
|  | ||||
| @ -1559,6 +1559,7 @@ public class PresetEditorDialog extends JDialog implements ItemListener { | ||||
| 			} | ||||
| 			break; | ||||
| 		case RAIL_BUTTON: | ||||
| 			setMaterial(materialChooser, preset, matHolder, Material.Type.BULK, ComponentPreset.MATERIAL); | ||||
| 			typeCombo.setSelectedItem(trans.get(RAIL_BUTTON_KEY)); | ||||
| 			rbDescTextField.setText(preset.get(ComponentPreset.DESCRIPTION)); | ||||
| 			if (preset.has(ComponentPreset.INNER_DIAMETER)) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user