Add a warning to the WarningSet when stage separation order is unreasonable

This commit is contained in:
JoePfeiffer 2022-10-03 12:39:15 -06:00
parent 0f3fffb21d
commit 756ae90f9d
3 changed files with 15 additions and 0 deletions

View File

@ -1827,6 +1827,7 @@ Warning.ZERO_LENGTH_BODY = Zero length bodies may not result in accurate simulat
Warning.ZERO_RADIUS_BODY = Zero length bodies may not result in accurate simulations. Warning.ZERO_RADIUS_BODY = Zero length bodies may not result in accurate simulations.
Warning.TUBE_SEPARATION = Space between tube fins may not result in accurate simulations. Warning.TUBE_SEPARATION = Space between tube fins may not result in accurate simulations.
Warning.TUBE_OVERLAP = Overlapping tube fins may not result in accurate simulations. Warning.TUBE_OVERLAP = Overlapping tube fins may not result in accurate simulations.
Warning.SEPARATION_ORDER = Stages separated in an unreasonable order
! Scale dialog ! Scale dialog
ScaleDialog.lbl.scaleRocket = Entire rocket ScaleDialog.lbl.scaleRocket = Entire rocket

View File

@ -396,4 +396,6 @@ public abstract class Warning {
public static final Warning TUBE_SEPARATION = new Other(trans.get("Warning.TUBE_SEPARATION")); public static final Warning TUBE_SEPARATION = new Other(trans.get("Warning.TUBE_SEPARATION"));
public static final Warning TUBE_OVERLAP = new Other(trans.get("Warning.TUBE_OVERLAP")); public static final Warning TUBE_OVERLAP = new Other(trans.get("Warning.TUBE_OVERLAP"));
public static final Warning SEPARATION_ORDER = new Other(trans.get("Warning.SEPARATION_ORDER"));
} }

View File

@ -444,6 +444,18 @@ public class BasicEventSimulationEngine implements SimulationEngine {
// Record the event. // Record the event.
currentStatus.getFlightData().addEvent(event); currentStatus.getFlightData().addEvent(event);
// If I've got something other than one active stage below the separation point,
// flag a warning
int numActiveBelow = 0;
for (int i = stageNumber; i < currentStatus.getConfiguration().getStageCount(); i++) {
if (currentStatus.getConfiguration().isStageActive(i)) {
numActiveBelow++;
}
}
if (numActiveBelow != 1) {
currentStatus.getWarnings().add(Warning.SEPARATION_ORDER);
}
// Create a new simulation branch for the booster // Create a new simulation branch for the booster
SimulationStatus boosterStatus = new SimulationStatus(currentStatus); SimulationStatus boosterStatus = new SimulationStatus(currentStatus);