- BaseHandler.setOverride(finSet, override, mass, cg);
- if (!override && finSet.getCrossSection().equals(FinSet.CrossSection.AIRFOIL)) {
- //Override mass anyway. This is done only for AIRFOIL because Rocksim does not compute different
- //mass/cg for different cross sections, but OpenRocket does. This can lead to drastic differences
- //in mass. To counteract that, the cross section value is retained but the mass/cg is overridden
- //with the calculated values from Rocksim. This will best approximate the Rocksim design in OpenRocket.
- BaseHandler.setOverride(finSet, true, calcMass, calcCg);
+ if (component.isCompatible(finSet)) {
+ BaseHandler.setOverride(finSet, override, mass, cg);
+ if (!override && finSet.getCrossSection().equals(FinSet.CrossSection.AIRFOIL)) {
+ //Override mass anyway. This is done only for AIRFOIL because Rocksim does not compute different
+ //mass/cg for different cross sections, but OpenRocket does. This can lead to drastic differences
+ //in mass. To counteract that, the cross section value is retained but the mass/cg is overridden
+ //with the calculated values from Rocksim. This will best approximate the Rocksim design in OpenRocket.
+ BaseHandler.setOverride(finSet, true, calcMass, calcCg);
+ }
+ BaseHandler.updateComponentMaterial(finSet, materialName, Material.Type.BULK, density);
+ component.addChild(finSet);
+ }
+ else {
+ warnings.add(finSet.getComponentName() + " can not be attached to "
+ + component.getComponentName() + ", ignoring component.");