diff --git a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java index 308ec86c2..f94a34325 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java @@ -60,7 +60,7 @@ public class FlightConfiguration implements FlightConfigurableParameter stages = new HashMap(); + final protected Map stages = new HashMap(); // Map of stage number to StageFlags of the corresponding stage final protected Map motors = new HashMap(); final private Collection activeMotors = new ArrayList(); final private InstanceMap activeInstances = new InstanceMap(); diff --git a/core/src/net/sf/openrocket/rocketcomponent/Rocket.java b/core/src/net/sf/openrocket/rocketcomponent/Rocket.java index 3855db54c..5411440f7 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/Rocket.java +++ b/core/src/net/sf/openrocket/rocketcomponent/Rocket.java @@ -748,6 +748,14 @@ public class Rocket extends ComponentAssembly { fireComponentChangeEvent(ComponentChangeEvent.TREE_CHANGE); return nextConfig.getFlightConfigurationID(); } + + /** + * Return all the flight configurations of this rocket. + * @return all the flight configurations of this rocket. + */ + public FlightConfigurableParameterSet getFlightConfigurations() { + return this.configSet; + } /** diff --git a/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java b/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java index ff43f79ed..23a954e70 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java +++ b/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java @@ -1545,6 +1545,11 @@ public abstract class RocketComponent implements ChangeSource, Cloneable, Iterab AxialStage stage = (AxialStage) component; this.getRocket().forgetStage(stage); } + + // Remove sub-stages of the removed component + for (AxialStage stage : component.getSubStages()) { + this.getRocket().forgetStage(stage); + } this.checkComponentStructure(); component.checkComponentStructure();