Inhibit reignition of already ignited motor

If a later stage motor's ignition event is triggered by burnout of earlier stage motors, an ignition even gets queued for every burnout in the earlier stage. This checks to see if a motor is already burning when an ignition event is processed for it, and ignores the event if so.
This commit is contained in:
JoePfeiffer 2023-01-04 09:21:15 -07:00
parent ede9dfe700
commit a4fdc333ad

View File

@ -396,7 +396,13 @@ public class BasicEventSimulationEngine implements SimulationEngine {
case IGNITION: {
MotorClusterState motorState = (MotorClusterState) event.getData();
// If there are multiple ignition events (as is the case if the preceding stage has several burnout events, for instance)
// We get multiple ignition events for the upper stage motor. Ignore are all after the first.
if (motorState.getIgnitionTime() < currentStatus.getSimulationTime()) {
log.info("Ignoring motor " +motorState.toDescription()+" ignition event @"+currentStatus.getSimulationTime());
continue;
}
log.info(" Igniting motor: "+motorState.toDescription()+" @"+currentStatus.getSimulationTime());
motorState.ignite( event.getTime());