diff --git a/core/src/net/sf/openrocket/rocketcomponent/AxialStage.java b/core/src/net/sf/openrocket/rocketcomponent/AxialStage.java index ff8d9820b..df2285c37 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/AxialStage.java +++ b/core/src/net/sf/openrocket/rocketcomponent/AxialStage.java @@ -8,8 +8,7 @@ import net.sf.openrocket.util.Coordinate; public class AxialStage extends ComponentAssembly implements FlightConfigurableComponent { private static final Translator trans = Application.getTranslator(); - //private static final Logger log = LoggerFactory.getLogger(AxialStage.class); - + /** list of separations to be happening*/ protected FlightConfigurableParameterSet separations; /** number of stages */ @@ -93,7 +92,6 @@ public class AxialStage extends ComponentAssembly implements FlightConfigurableC copy.separations = new FlightConfigurableParameterSet(separations); return copy; } - /** * Stages may be positioned relative to other stages. In that case, this will set the stage number diff --git a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java index effe1da8c..10c302735 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java @@ -46,22 +46,23 @@ public class FlightConfiguration implements FlightConfigurableParameter stages = new HashMap(); // Map of stage number to StageFlags of the corresponding stage + 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 ConcurrentLinkedQueue(); final private InstanceMap activeInstances = new InstanceMap(); @@ -130,7 +131,7 @@ public class FlightConfiguration implements FlightConfigurableParameter getAllStages() { List stages = new ArrayList<>(); for (StageFlags flags : this.stages.values()) { - stages.add( rocket.getStage(flags.stageNumber)); + stages.add( rocket.getStage(flags.stageId)); } return stages; } @@ -382,7 +383,11 @@ public class FlightConfiguration implements FlightConfigurableParameter stagesBackup = new HashMap<>(this.stages); this.stages.clear(); for (AxialStage curStage : this.rocket.getStageList()) { if (curStage == null) continue; - StageFlags flagsToAdd = new StageFlags( curStage.getStageNumber(), true); + boolean active = true; + for (FlightConfiguration.StageFlags flag : stagesBackup.values()) { + if (flag.stageId.equals(curStage.getID())) { + active = flag.active; + break; + } + } + StageFlags flagsToAdd = new StageFlags(curStage.getStageNumber(), curStage.getID(), active); this.stages.put(curStage.getStageNumber(), flagsToAdd); } } @@ -842,8 +851,8 @@ public class FlightConfiguration implements FlightConfigurableParameter