Merge pull request #453 from JoePfeiffer/fix-calcCP

Fix calc cp
This commit is contained in:
Wes Cravens 2018-10-21 11:23:21 -05:00 committed by GitHub
commit 7fa61bf2cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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