Merge pull request #449 from JoePfeiffer/fix-staging

Fix staging
This commit is contained in:
Wes Cravens 2018-09-29 14:57:17 -05:00 committed by GitHub
commit 09fca29aab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -109,6 +109,11 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
cur.active = _active;
}
}
public void copyStages(FlightConfiguration other) {
for (StageFlags cur : other.stages.values())
stages.put(cur.stageNumber, new StageFlags(cur.stageNumber, cur.active));
}
/**
* This method flags a stage inactive. Other stages are unaffected.

View File

@ -417,7 +417,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
// Mark the status as having dropped the booster
currentStatus.getConfiguration().clearStage( stageNumber);
// Prepare the simulation branch
SimulationStatus boosterStatus = new SimulationStatus(currentStatus);
boosterStatus.setFlightData(new FlightDataBranch(boosterStage.getName(), FlightDataType.TYPE_TIME));

View File

@ -105,8 +105,6 @@ public class SimulationStatus implements Monitorable {
double angle = -cond.getTheta() - (Math.PI / 2.0 - this.simulationConditions.getLaunchRodDirection());
o = Quaternion.rotation(new Coordinate(0, 0, angle));
// Launch rod angle and direction
o = o.multiplyLeft(Quaternion.rotation(new Coordinate(0, this.simulationConditions.getLaunchRodAngle(), 0)));
o = o.multiplyLeft(Quaternion.rotation(new Coordinate(0, 0, Math.PI / 2.0 - this.simulationConditions.getLaunchRodDirection())));
@ -182,6 +180,8 @@ public class SimulationStatus implements Monitorable {
this.apogeeReached = orig.apogeeReached;
this.tumbling = orig.tumbling;
this.configuration.copyStages(orig.configuration);
this.deployedRecoveryDevices.clear();
this.deployedRecoveryDevices.addAll(orig.deployedRecoveryDevices);