only consider active components in Barrowman equations

This commit is contained in:
JoePfeiffer 2018-10-04 14:36:00 -06:00
parent c7b3466dd5
commit 904f32d0ba

View File

@ -785,24 +785,20 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator {
private void buildCalcMap(FlightConfiguration configuration) { private void buildCalcMap(FlightConfiguration configuration) {
Iterator<RocketComponent> iterator; Iterator<RocketComponent> iterator;
//System.err.println("> Building Calc Map.");
calcMap = new HashMap<RocketComponent, RocketComponentCalc>(); calcMap = new HashMap<RocketComponent, RocketComponentCalc>();
iterator = configuration.getRocket().iterator(); for (RocketComponent comp: configuration.getActiveComponents()) {
while (iterator.hasNext()) { if (!comp.isAerodynamic())
RocketComponent c = iterator.next();
if (!c.isAerodynamic())
continue; continue;
RocketComponentCalc calcObj = (RocketComponentCalc) Reflection.construct(BARROWMAN_PACKAGE, c, BARROWMAN_SUFFIX, c);
RocketComponentCalc calcObj = (RocketComponentCalc) Reflection.construct(BARROWMAN_PACKAGE, comp, BARROWMAN_SUFFIX, comp);
//String isNull = (null==calcObj?"null":"valid"); //String isNull = (null==calcObj?"null":"valid");
//System.err.println(" >> At component: "+c.getName() +"=="+c.getID()+". CalcObj is "+isNull); //System.err.println(" >> At component: "+c.getName() +"=="+c.getID()+". CalcObj is "+isNull);
calcMap.put(c, calcObj ); calcMap.put(comp, calcObj );
} }
} }
@Override @Override
public int getModID() { public int getModID() {
// Only cached data is stored, return constant mod ID // Only cached data is stored, return constant mod ID