From 1036ac98bf3cfbcf27d454951a1fce8447888cfa Mon Sep 17 00:00:00 2001 From: JoePfeiffer Date: Sat, 26 Sep 2020 16:41:00 -0600 Subject: [PATCH 1/3] add logging to BarrowmanCalculator for debugging --- .../net/sf/openrocket/aerodynamics/BarrowmanCalculator.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java b/core/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java index d88b2fe2e..40af97cf2 100644 --- a/core/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java +++ b/core/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java @@ -4,6 +4,9 @@ import static net.sf.openrocket.util.MathUtil.pow2; import java.util.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import net.sf.openrocket.aerodynamics.barrowman.FinSetCalc; import net.sf.openrocket.aerodynamics.barrowman.RocketComponentCalc; import net.sf.openrocket.rocketcomponent.ComponentAssembly; @@ -29,6 +32,7 @@ import net.sf.openrocket.util.Reflection; * @author Sampo Niskanen */ public class BarrowmanCalculator extends AbstractAerodynamicCalculator { + private static final Logger log = LoggerFactory.getLogger(BarrowmanCalculator.class); private static final String BARROWMAN_PACKAGE = "net.sf.openrocket.aerodynamics.barrowman"; private static final String BARROWMAN_SUFFIX = "Calc"; @@ -328,7 +332,7 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator { if (calcMap == null) buildCalcMap(configuration); - + Re = conditions.getVelocity() * configuration.getLength() / conditions.getAtmosphericConditions().getKinematicViscosity(); From 796d245bbe5a42af45f61e02dcef1b1af74b431e Mon Sep 17 00:00:00 2001 From: JoePfeiffer Date: Sat, 26 Sep 2020 17:42:57 -0600 Subject: [PATCH 2/3] fireChangeEvent() when activating/deactivating a stage to force recalculation of bounds on stage separation --- .../net/sf/openrocket/rocketcomponent/FlightConfiguration.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java index 3848d88de..b131bec1e 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java @@ -182,6 +182,7 @@ public class FlightConfiguration implements FlightConfigurableParameter Date: Wed, 30 Sep 2020 20:40:28 -0600 Subject: [PATCH 3/3] Check that next symmetric component, if non-null, is active --- .../sf/openrocket/aerodynamics/BarrowmanCalculator.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java b/core/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java index 40af97cf2..b8812a7ee 100644 --- a/core/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java +++ b/core/src/net/sf/openrocket/aerodynamics/BarrowmanCalculator.java @@ -641,7 +641,7 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator { if (!(c instanceof SymmetricComponent)) continue; - + SymmetricComponent s = (SymmetricComponent) c; // iterate across component instances @@ -671,8 +671,10 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator { // if I'm the last component, set my base CD // note: the iterator *should* serve up the next component.... buuuut .... - // this code has is tested, and there's no compelling reason to change. - if (s.getNextSymmetricComponent() == null) { + // this code has is tested, and there's no compelling reason to change. + final SymmetricComponent n = s.getNextSymmetricComponent(); + if ((n == null) || + !configuration.isStageActive(n.getStageNumber())) { double area = Math.PI * pow2(s.getAftRadius()); double cd = base * area / conditions.getRefArea(); total += cd;