From cac0a529908fb82b1878f8f7ec02ca632db8393b Mon Sep 17 00:00:00 2001 From: Daniel_M_Williams Date: Tue, 27 Oct 2015 21:42:10 -0400 Subject: [PATCH] [Bugfix] Modestly reduced extra configuration instances --- core/src/net/sf/openrocket/document/Simulation.java | 11 ++++++----- .../rocketcomponent/FlightConfiguration.java | 5 ++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/src/net/sf/openrocket/document/Simulation.java b/core/src/net/sf/openrocket/document/Simulation.java index a4f699f96..0ac1d1e86 100644 --- a/core/src/net/sf/openrocket/document/Simulation.java +++ b/core/src/net/sf/openrocket/document/Simulation.java @@ -12,7 +12,7 @@ import net.sf.openrocket.aerodynamics.BarrowmanCalculator; import net.sf.openrocket.aerodynamics.WarningSet; import net.sf.openrocket.formatting.RocketDescriptor; import net.sf.openrocket.masscalc.MassCalculator; -import net.sf.openrocket.motor.MotorInstanceConfiguration; +import net.sf.openrocket.motor.MotorInstance; import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.simulation.BasicEventSimulationEngine; @@ -275,12 +275,13 @@ public class Simulation implements ChangeSource, Cloneable { } } - FlightConfiguration c = new FlightConfiguration( options.getConfigID(), this.getRocket()); - MotorInstanceConfiguration motors = new MotorInstanceConfiguration(c); - + FlightConfiguration config = rocket.getFlightConfiguration(options.getConfigID()); + List motorList = config.getActiveMotors(); + //Make sure this simulation has motors. - if (0 == motors.getMotorCount()) { + if (0 == motorList.size()){ status = Status.CANT_RUN; + log.warn(" Unable to simulate: no motors loaded."); } return status; diff --git a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java index 2ade0ff63..9dae2f02b 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java @@ -70,7 +70,6 @@ public class FlightConfiguration implements FlightConfigurableParameter(); config.stageMap = (HashMap) this.stageMap.clone(); - config.cachedBounds = new ArrayList(); + config.cachedBounds = this.cachedBounds.clone(); config.boundsModID = -1; config.refLengthModID = -1; rocket.addComponentChangeListener(config);