From ed59b64fd8884dd4b5455126ad12a11c4c3fef0a Mon Sep 17 00:00:00 2001 From: SiboVG Date: Mon, 13 Mar 2023 23:39:44 +0100 Subject: [PATCH] Use burnout for non-last stage in multi-staged rocket --- .../file/rasaero/importt/SimulationListHandler.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/net/sf/openrocket/file/rasaero/importt/SimulationListHandler.java b/core/src/net/sf/openrocket/file/rasaero/importt/SimulationListHandler.java index 194b63420..64ba2035e 100644 --- a/core/src/net/sf/openrocket/file/rasaero/importt/SimulationListHandler.java +++ b/core/src/net/sf/openrocket/file/rasaero/importt/SimulationListHandler.java @@ -6,6 +6,7 @@ import net.sf.openrocket.file.DocumentLoadingContext; import net.sf.openrocket.file.simplesax.AbstractElementHandler; import net.sf.openrocket.file.simplesax.ElementHandler; import net.sf.openrocket.file.simplesax.PlainTextHandler; +import net.sf.openrocket.motor.IgnitionEvent; import net.sf.openrocket.motor.Motor; import net.sf.openrocket.motor.MotorConfiguration; import net.sf.openrocket.motor.ThrustCurveMotor; @@ -164,6 +165,11 @@ public class SimulationListHandler extends AbstractElementHandler { motorConfig.setMotor(motor); double delay = ignitionDelay != null ? ignitionDelay : 0.0; 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); }