diff --git a/core/src/net/sf/openrocket/rocketcomponent/BoosterSet.java b/core/src/net/sf/openrocket/rocketcomponent/BoosterSet.java index 3e9737978..83872bf48 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/BoosterSet.java +++ b/core/src/net/sf/openrocket/rocketcomponent/BoosterSet.java @@ -102,6 +102,20 @@ public class BoosterSet extends AxialStage implements FlightConfigurableComponen return this.count; } + + @Override + public void setInstanceCount( final int newCount ){ + mutex.verify(); + if ( newCount < 1) { + // there must be at least one instance.... + return; + } + + this.count = newCount; + this.angularSeparation = Math.PI * 2 / this.count; + fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE); + } + @Override public double getRadialOffset() { return this.radialPosition_m; @@ -164,12 +178,14 @@ public class BoosterSet extends AxialStage implements FlightConfigurableComponen @Override public void setRadialOffset(final double radius) { + mutex.verify(); this.radialPosition_m = radius; fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE); } @Override public void setAngularOffset(final double angle_rad) { + mutex.verify(); this.angularPosition_rad = angle_rad; fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE); } diff --git a/core/src/net/sf/openrocket/rocketcomponent/PodSet.java b/core/src/net/sf/openrocket/rocketcomponent/PodSet.java index 1533a692c..913e0cdbf 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/PodSet.java +++ b/core/src/net/sf/openrocket/rocketcomponent/PodSet.java @@ -164,12 +164,33 @@ public class PodSet extends ComponentAssembly implements RingInstanceable, Outsi public String getPatternName(){ return (this.getInstanceCount() + "-ring"); } + + @Override public double getRadialOffset() { return this.radialPosition_m; } + + @Override + public int getInstanceCount() { + return this.count; + } + + + @Override + public void setInstanceCount( final int newCount ){ + mutex.verify(); + if ( newCount < 1) { + // there must be at least one instance.... + return; + } + + this.count = newCount; + this.angularSeparation = Math.PI * 2 / this.count; + fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE); + } @Override public Coordinate[] shiftCoordinates(Coordinate[] c) { @@ -212,12 +233,14 @@ public class PodSet extends ComponentAssembly implements RingInstanceable, Outsi @Override public void setAngularOffset(double angle_rad) { + mutex.verify(); this.angularPosition_rad = angle_rad; fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE); } @Override public void setRadialOffset(double radius_m) { + mutex.verify(); this.radialPosition_m = radius_m; fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE); } diff --git a/swing/src/net/sf/openrocket/gui/configdialog/AxialStageConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/AxialStageConfig.java index 8f617beb5..73994c763 100644 --- a/swing/src/net/sf/openrocket/gui/configdialog/AxialStageConfig.java +++ b/swing/src/net/sf/openrocket/gui/configdialog/AxialStageConfig.java @@ -29,7 +29,7 @@ public class AxialStageConfig extends ComponentAssemblyConfig { if (component.getStageNumber() > 0) { JPanel tab = separationTab((AxialStage) component); tabbedPane.insertTab(trans.get("StageConfig.tab.Separation"), null, tab, - trans.get("StageConfig.tab.Separation.ttip"), 1); + trans.get("StageConfig.tab.Separation.ttip"), 2); } } diff --git a/swing/src/net/sf/openrocket/gui/configdialog/ComponentAssemblyConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/ComponentAssemblyConfig.java index 269187b59..b1e25b72b 100644 --- a/swing/src/net/sf/openrocket/gui/configdialog/ComponentAssemblyConfig.java +++ b/swing/src/net/sf/openrocket/gui/configdialog/ComponentAssemblyConfig.java @@ -5,6 +5,7 @@ import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JSpinner; + import net.miginfocom.swing.MigLayout; import net.sf.openrocket.document.OpenRocketDocument; import net.sf.openrocket.gui.SpinnerEditor; @@ -27,7 +28,7 @@ public class ComponentAssemblyConfig extends RocketComponentConfig { // only stages which are actually off-centerline will get the dialog here: if(( component instanceof ComponentAssembly )&&( ! component.isCenterline() )){ - tabbedPane.insertTab( trans.get("RocketCompCfg.tab.Parallel"), null, parallelTab( (ComponentAssembly) component ), trans.get("RocketCompCfg.tab.ParallelComment"), 2); + tabbedPane.insertTab( trans.get("RocketCompCfg.tab.Parallel"), null, parallelTab( (ComponentAssembly) component ), trans.get("RocketCompCfg.tab.ParallelComment"), 1); } } diff --git a/swing/src/net/sf/openrocket/gui/configdialog/MotorConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/MotorConfig.java index 27606c264..e29a3ebef 100644 --- a/swing/src/net/sf/openrocket/gui/configdialog/MotorConfig.java +++ b/swing/src/net/sf/openrocket/gui/configdialog/MotorConfig.java @@ -71,7 +71,7 @@ public class MotorConfig extends JPanel { MotorInstance motorInstance = mount.getDefaultMotorInstance(); - final EnumModel igEvModel = new EnumModel(motorMount, "IgnitionEvent", IgnitionEvent.values()); + final EnumModel igEvModel = new EnumModel(motorInstance, "IgnitionEvent", IgnitionEvent.values()); final JComboBox eventBox = new JComboBox( igEvModel); panel.add(eventBox , "growx, wrap");