TODO
This commit is contained in:
parent
cc6a39c34d
commit
2c64e83a6f
@ -12,6 +12,7 @@ import net.sf.openrocket.models.wind.WindModel;
|
|||||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||||
import net.sf.openrocket.simulation.listeners.SimulationListener;
|
import net.sf.openrocket.simulation.listeners.SimulationListener;
|
||||||
import net.sf.openrocket.util.BugException;
|
import net.sf.openrocket.util.BugException;
|
||||||
|
import net.sf.openrocket.util.Coordinate;
|
||||||
import net.sf.openrocket.util.GeodeticComputationStrategy;
|
import net.sf.openrocket.util.GeodeticComputationStrategy;
|
||||||
import net.sf.openrocket.util.Monitorable;
|
import net.sf.openrocket.util.Monitorable;
|
||||||
import net.sf.openrocket.util.WorldCoordinate;
|
import net.sf.openrocket.util.WorldCoordinate;
|
||||||
@ -38,11 +39,14 @@ public class SimulationConditions implements Monitorable, Cloneable {
|
|||||||
/** Launch rod direction, 0 = upwind, PI = downwind. */
|
/** Launch rod direction, 0 = upwind, PI = downwind. */
|
||||||
private double launchRodDirection = 0;
|
private double launchRodDirection = 0;
|
||||||
|
|
||||||
// TODO: Depreciate these and use worldCoordinate only.
|
// Launch site location (lat, lon, alt)
|
||||||
//private double launchAltitude = 0;
|
|
||||||
//private double launchLatitude = 45;
|
|
||||||
//private double launchLongitude = 0;
|
|
||||||
private WorldCoordinate launchSite = new WorldCoordinate(0, 0, 0);
|
private WorldCoordinate launchSite = new WorldCoordinate(0, 0, 0);
|
||||||
|
|
||||||
|
// Launch location in simulation coordinates (normally always 0, air-start would override this)
|
||||||
|
private Coordinate launchPosition = Coordinate.NUL;
|
||||||
|
|
||||||
|
private Coordinate launchVelocity = Coordinate.NUL;
|
||||||
|
|
||||||
private GeodeticComputationStrategy geodeticComputation = GeodeticComputationStrategy.SPHERICAL;
|
private GeodeticComputationStrategy geodeticComputation = GeodeticComputationStrategy.SPHERICAL;
|
||||||
|
|
||||||
|
|
||||||
@ -166,6 +170,29 @@ public class SimulationConditions implements Monitorable, Cloneable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Coordinate getLaunchPosition() {
|
||||||
|
return launchPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLaunchPosition(Coordinate launchPosition) {
|
||||||
|
if (this.launchPosition.equals(launchPosition))
|
||||||
|
return;
|
||||||
|
this.launchPosition = launchPosition;
|
||||||
|
this.modID++;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Coordinate getLaunchVelocity() {
|
||||||
|
return launchVelocity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLaunchVelocity(Coordinate launchVelocity) {
|
||||||
|
if (this.launchVelocity.equals(launchVelocity))
|
||||||
|
return;
|
||||||
|
this.launchVelocity = launchVelocity;
|
||||||
|
this.modID++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public GeodeticComputationStrategy getGeodeticComputation() {
|
public GeodeticComputationStrategy getGeodeticComputation() {
|
||||||
return geodeticComputation;
|
return geodeticComputation;
|
||||||
}
|
}
|
||||||
@ -268,7 +295,7 @@ public class SimulationConditions implements Monitorable, Cloneable {
|
|||||||
this.simulation = sim;
|
this.simulation = sim;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Simulation getSimulation(){
|
public Simulation getSimulation() {
|
||||||
return this.simulation;
|
return this.simulation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,9 +87,9 @@ public class SimulationStatus implements Monitorable {
|
|||||||
private int modID = 0;
|
private int modID = 0;
|
||||||
private int modIDadd = 0;
|
private int modIDadd = 0;
|
||||||
|
|
||||||
public SimulationStatus( Configuration configuration,
|
public SimulationStatus(Configuration configuration,
|
||||||
MotorInstanceConfiguration motorConfiguration,
|
MotorInstanceConfiguration motorConfiguration,
|
||||||
SimulationConditions simulationConditions ) {
|
SimulationConditions simulationConditions) {
|
||||||
|
|
||||||
this.simulationConditions = simulationConditions;
|
this.simulationConditions = simulationConditions;
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
@ -97,8 +97,8 @@ public class SimulationStatus implements Monitorable {
|
|||||||
|
|
||||||
this.time = 0;
|
this.time = 0;
|
||||||
this.previousTimeStep = this.simulationConditions.getTimeStep();
|
this.previousTimeStep = this.simulationConditions.getTimeStep();
|
||||||
this.position = Coordinate.NUL;
|
this.position = this.simulationConditions.getLaunchPosition();
|
||||||
this.velocity = Coordinate.NUL;
|
this.velocity = this.simulationConditions.getLaunchVelocity();
|
||||||
this.worldPosition = this.simulationConditions.getLaunchSite();
|
this.worldPosition = this.simulationConditions.getLaunchSite();
|
||||||
|
|
||||||
// Initialize to roll angle with least stability w.r.t. the wind
|
// Initialize to roll angle with least stability w.r.t. the wind
|
||||||
@ -163,7 +163,7 @@ public class SimulationStatus implements Monitorable {
|
|||||||
*
|
*
|
||||||
* @param orig the object from which to copy
|
* @param orig the object from which to copy
|
||||||
*/
|
*/
|
||||||
public SimulationStatus( SimulationStatus orig ) {
|
public SimulationStatus(SimulationStatus orig) {
|
||||||
this.simulationConditions = orig.simulationConditions.clone();
|
this.simulationConditions = orig.simulationConditions.clone();
|
||||||
this.configuration = orig.configuration.clone();
|
this.configuration = orig.configuration.clone();
|
||||||
this.motorConfiguration = orig.motorConfiguration.clone();
|
this.motorConfiguration = orig.motorConfiguration.clone();
|
||||||
@ -292,7 +292,7 @@ public class SimulationStatus implements Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean addBurntOutMotor( MotorId motor ) {
|
public boolean addBurntOutMotor(MotorId motor) {
|
||||||
return motorBurntOut.add(motor);
|
return motorBurntOut.add(motor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -384,7 +384,7 @@ public class SimulationStatus implements Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setTumbling( boolean tumbling ) {
|
public void setTumbling(boolean tumbling) {
|
||||||
this.tumbling = tumbling;
|
this.tumbling = tumbling;
|
||||||
this.modID++;
|
this.modID++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user