Use burnout for non-last stage in multi-staged rocket

This commit is contained in:
SiboVG 2023-03-13 23:39:44 +01:00
parent 00ea1c496e
commit ed59b64fd8

View File

@ -6,6 +6,7 @@ import net.sf.openrocket.file.DocumentLoadingContext;
import net.sf.openrocket.file.simplesax.AbstractElementHandler; import net.sf.openrocket.file.simplesax.AbstractElementHandler;
import net.sf.openrocket.file.simplesax.ElementHandler; import net.sf.openrocket.file.simplesax.ElementHandler;
import net.sf.openrocket.file.simplesax.PlainTextHandler; import net.sf.openrocket.file.simplesax.PlainTextHandler;
import net.sf.openrocket.motor.IgnitionEvent;
import net.sf.openrocket.motor.Motor; import net.sf.openrocket.motor.Motor;
import net.sf.openrocket.motor.MotorConfiguration; import net.sf.openrocket.motor.MotorConfiguration;
import net.sf.openrocket.motor.ThrustCurveMotor; import net.sf.openrocket.motor.ThrustCurveMotor;
@ -164,6 +165,11 @@ public class SimulationListHandler extends AbstractElementHandler {
motorConfig.setMotor(motor); motorConfig.setMotor(motor);
double delay = ignitionDelay != null ? ignitionDelay : 0.0; double delay = ignitionDelay != null ? ignitionDelay : 0.0;
motorConfig.setIgnitionDelay(delay); motorConfig.setIgnitionDelay(delay);
if (stageNr < rocket.getStageCount() - 1) { // Use burnout non-last if multi-staged rocket
motorConfig.setIgnitionEvent(IgnitionEvent.BURNOUT);
} else {
motorConfig.setIgnitionEvent(IgnitionEvent.AUTOMATIC);
}
mount.setMotorConfig(motorConfig, id); mount.setMotorConfig(motorConfig, id);
} }