commit
62d0305e86
@ -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
|
||||||
|
@ -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"));
|
||||||
}
|
}
|
||||||
|
@ -147,6 +147,34 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
|||||||
updateActiveInstances();
|
updateActiveInstances();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method clears a stage and all stages below (higher stage number)
|
||||||
|
*
|
||||||
|
* @param stageNumber first stage number to turn off
|
||||||
|
*/
|
||||||
|
public void clearStagesBelow(int stageNumber) {
|
||||||
|
// I can't just use _setStageActive(stageNumber, false, true)
|
||||||
|
// because that won't clear side boosters' active flags (should it?)
|
||||||
|
for (int i = stageNumber; i < rocket.getStageCount(); i++) {
|
||||||
|
_setStageActive(i, false, false);
|
||||||
|
}
|
||||||
|
updateMotors();
|
||||||
|
updateActiveInstances();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method clears all stages above (but not including) a stage
|
||||||
|
*
|
||||||
|
* @param stageNumber first stage number to stay active
|
||||||
|
*/
|
||||||
|
public void clearStagesAbove(int stageNumber) {
|
||||||
|
for (int i = 0; i < stageNumber; i++) {
|
||||||
|
_setStageActive(i, false, false);
|
||||||
|
}
|
||||||
|
updateMotors();
|
||||||
|
updateActiveInstances();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activates all stages as active starting from the specified component
|
* Activates all stages as active starting from the specified component
|
||||||
* to the top-most stage in the rocket. Active stages are those stages
|
* to the top-most stage in the rocket. Active stages are those stages
|
||||||
@ -187,7 +215,7 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method flags the specified stage as requested. Other stages are unaffected.
|
* This method flags the specified stage as requested. Substages may be affected, depending on third parameter
|
||||||
*
|
*
|
||||||
* @param stageNumber stage number to flag
|
* @param stageNumber stage number to flag
|
||||||
* @param _active inactive (<code>false</code>) or active (<code>true</code>)
|
* @param _active inactive (<code>false</code>) or active (<code>true</code>)
|
||||||
|
@ -305,6 +305,9 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
if (event.getSource() != null && event.getSource().getParent() != null &&
|
if (event.getSource() != null && event.getSource().getParent() != null &&
|
||||||
!currentStatus.getConfiguration().isComponentActive(event.getSource())) {
|
!currentStatus.getConfiguration().isComponentActive(event.getSource())) {
|
||||||
log.trace("Ignoring event from unattached component");
|
log.trace("Ignoring event from unattached component");
|
||||||
|
log.debug(" source " + event.getSource());
|
||||||
|
log.debug(" parent " + event.getSource().getParent());
|
||||||
|
log.debug(" active " + currentStatus.getConfiguration().isComponentActive(event.getSource()));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -381,7 +384,6 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// and queue up the burnout for this motor, as well.
|
// and queue up the burnout for this motor, as well.
|
||||||
// double duration = motorState.getMotor().getBurnTimeEstimate();
|
|
||||||
double duration = motorState.getBurnTime();
|
double duration = motorState.getBurnTime();
|
||||||
double burnout = currentStatus.getSimulationTime() + duration;
|
double burnout = currentStatus.getSimulationTime() + duration;
|
||||||
addEvent(new FlightEvent(FlightEvent.Type.BURNOUT, burnout,
|
addEvent(new FlightEvent(FlightEvent.Type.BURNOUT, burnout,
|
||||||
@ -436,19 +438,36 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
case STAGE_SEPARATION: {
|
case STAGE_SEPARATION: {
|
||||||
RocketComponent boosterStage = event.getSource();
|
RocketComponent boosterStage = event.getSource();
|
||||||
final int stageNumber = boosterStage.getStageNumber();
|
final int stageNumber = boosterStage.getStageNumber();
|
||||||
|
log.debug("separating at stage " + stageNumber);
|
||||||
|
|
||||||
if (currentStatus.getConfiguration().isStageActive(stageNumber-1)) {
|
if (currentStatus.getConfiguration().isStageActive(stageNumber-1)) {
|
||||||
// Record the event.
|
// Record the event.
|
||||||
currentStatus.getFlightData().addEvent(event);
|
currentStatus.getFlightData().addEvent(event);
|
||||||
|
|
||||||
// Mark the status as having dropped the booster
|
// If I've got something other than one active stage below the separation point,
|
||||||
currentStatus.getConfiguration().clearStage( stageNumber);
|
// 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);
|
||||||
|
}
|
||||||
|
|
||||||
// Prepare the simulation branch
|
// Create a new simulation branch for the booster
|
||||||
SimulationStatus boosterStatus = new SimulationStatus(currentStatus);
|
SimulationStatus boosterStatus = new SimulationStatus(currentStatus);
|
||||||
|
|
||||||
|
// Prepare the new simulation branch
|
||||||
boosterStatus.setFlightData(new FlightDataBranch(boosterStage.getName(), FlightDataType.TYPE_TIME));
|
boosterStatus.setFlightData(new FlightDataBranch(boosterStage.getName(), FlightDataType.TYPE_TIME));
|
||||||
// Mark the booster status as only having the booster.
|
|
||||||
boosterStatus.getConfiguration().setOnlyStage(stageNumber);
|
// Mark the current status as having dropped the current stage and all stages below it
|
||||||
|
currentStatus.getConfiguration().clearStagesBelow( stageNumber);
|
||||||
|
|
||||||
|
// Mark the booster status as having no active stages above
|
||||||
|
boosterStatus.getConfiguration().clearStagesAbove(stageNumber);
|
||||||
|
|
||||||
toSimulate.push(boosterStatus);
|
toSimulate.push(boosterStatus);
|
||||||
log.info(String.format("==>> @ %g; from Branch: %s ---- Branching: %s ---- \n",
|
log.info(String.format("==>> @ %g; from Branch: %s ---- Branching: %s ---- \n",
|
||||||
currentStatus.getSimulationTime(),
|
currentStatus.getSimulationTime(),
|
||||||
|
@ -13,8 +13,11 @@ public class BasicTumbleStepper extends AbstractSimulationStepper {
|
|||||||
private static final double RECOVERY_TIME_STEP = 0.5;
|
private static final double RECOVERY_TIME_STEP = 0.5;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SimulationStatus initialize(SimulationStatus status) {
|
public SimulationStatus initialize(SimulationStatus original) {
|
||||||
return new BasicTumbleStatus(status);
|
BasicTumbleStatus status = new BasicTumbleStatus(original);
|
||||||
|
status.setWarnings(original.getWarnings());
|
||||||
|
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user