Make copy of rocket when starting simulation
This commit is contained in:
parent
5cfdb3959e
commit
58ac3e4a1d
@ -323,7 +323,7 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator {
|
|||||||
// radius = 0;
|
// radius = 0;
|
||||||
//}
|
//}
|
||||||
//componentX = component.toAbsolute(new Coordinate(component.getLengthAerodynamic()))[0].x;
|
//componentX = component.toAbsolute(new Coordinate(component.getLengthAerodynamic()))[0].x;
|
||||||
|
|
||||||
}else if( comp instanceof ComponentAssembly ){
|
}else if( comp instanceof ComponentAssembly ){
|
||||||
checkGeometry(configuration, comp, warnings);
|
checkGeometry(configuration, comp, warnings);
|
||||||
}
|
}
|
||||||
|
@ -840,11 +840,9 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
|||||||
* - configurables
|
* - configurables
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Override
|
public FlightConfiguration clone(Rocket rocket) {
|
||||||
public FlightConfiguration clone() {
|
|
||||||
|
|
||||||
// Note the stages are updated in the constructor call.
|
// Note the stages are updated in the constructor call.
|
||||||
FlightConfiguration clone = new FlightConfiguration( this.rocket, this.fcid );
|
FlightConfiguration clone = new FlightConfiguration( rocket, this.fcid );
|
||||||
clone.setName(configurationName);
|
clone.setName(configurationName);
|
||||||
clone.copyStageActiveness(this);
|
clone.copyStageActiveness(this);
|
||||||
clone.preloadStageActiveness = this.preloadStageActiveness == null ? null : new HashMap<>(this.preloadStageActiveness);
|
clone.preloadStageActiveness = this.preloadStageActiveness == null ? null : new HashMap<>(this.preloadStageActiveness);
|
||||||
@ -856,6 +854,11 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
|||||||
clone.refLengthModID = -1;
|
clone.refLengthModID = -1;
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FlightConfiguration clone() {
|
||||||
|
return this.clone(this.rocket);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy all available information attached to this, and attached copies to the
|
* Copy all available information attached to this, and attached copies to the
|
||||||
|
@ -464,7 +464,6 @@ public class Rocket extends ComponentAssembly {
|
|||||||
|
|
||||||
|
|
||||||
public void printListeners() {
|
public void printListeners() {
|
||||||
System.out.println("" + this + " has " + listenerList.size() + " listeners:");
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (EventListener l : listenerList) {
|
for (EventListener l : listenerList) {
|
||||||
System.out.println(" " + (i) + ": " + l);
|
System.out.println(" " + (i) + ": " + l);
|
||||||
|
@ -72,7 +72,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
// Set up rocket configuration
|
// Set up rocket configuration
|
||||||
this.fcid = simulationConditions.getFlightConfigurationID();
|
this.fcid = simulationConditions.getFlightConfigurationID();
|
||||||
FlightConfiguration origConfig = simulationConditions.getRocket().getFlightConfiguration(this.fcid);
|
FlightConfiguration origConfig = simulationConditions.getRocket().getFlightConfiguration(this.fcid);
|
||||||
FlightConfiguration simulationConfig = origConfig.clone();
|
FlightConfiguration simulationConfig = origConfig.clone(simulationConditions.getRocket().copyWithOriginalID());
|
||||||
simulationConfig.copyStages(origConfig); // Clone the stage activation configuration
|
simulationConfig.copyStages(origConfig); // Clone the stage activation configuration
|
||||||
|
|
||||||
currentStatus = new SimulationStatus(simulationConfig, simulationConditions);
|
currentStatus = new SimulationStatus(simulationConfig, simulationConditions);
|
||||||
|
@ -146,7 +146,6 @@ public class RollControl extends AbstractSimulationExtension {
|
|||||||
if (finset == null) {
|
if (finset == null) {
|
||||||
throw new SimulationException("A fin set with name '" + getControlFinName() + "' was not found");
|
throw new SimulationException("A fin set with name '" + getControlFinName() + "' was not found");
|
||||||
}
|
}
|
||||||
System.out.println("fin set found at " + finset.hashCode());
|
|
||||||
|
|
||||||
// remember the initial fin position so we can set it back after running the simulation
|
// remember the initial fin position so we can set it back after running the simulation
|
||||||
initialFinPosition = finset.getCantAngle();
|
initialFinPosition = finset.getCantAngle();
|
||||||
@ -166,8 +165,6 @@ public class RollControl extends AbstractSimulationExtension {
|
|||||||
prevTime = status.getSimulationTime();
|
prevTime = status.getSimulationTime();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
System.out.println("using fin set at " + finset.hashCode());
|
|
||||||
|
|
||||||
|
|
||||||
// Determine time step
|
// Determine time step
|
||||||
double deltaT = status.getSimulationTime() - prevTime;
|
double deltaT = status.getSimulationTime() - prevTime;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user