Add a warning to the WarningSet when stage separation order is unreasonable
This commit is contained in:
parent
0f3fffb21d
commit
756ae90f9d
@ -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.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.SEPARATION_ORDER = Stages separated in an unreasonable order
|
||||
|
||||
! Scale dialog
|
||||
ScaleDialog.lbl.scaleRocket = Entire rocket
|
||||
|
@ -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_OVERLAP = new Other(trans.get("Warning.TUBE_OVERLAP"));
|
||||
|
||||
public static final Warning SEPARATION_ORDER = new Other(trans.get("Warning.SEPARATION_ORDER"));
|
||||
}
|
||||
|
@ -444,6 +444,18 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
||||
// Record the 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
|
||||
SimulationStatus boosterStatus = new SimulationStatus(currentStatus);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user