X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=core%2Fsrc%2Fnet%2Fsf%2Fopenrocket%2Fdocument%2FSimulation.java;h=edb093c3b9b016c813ce61ba1ddf0858f42340ff;hb=77f2457dc781c8c517ddef157c18491ad770f6c6;hp=c947e23d9ac61fed5869b02d47ecbf989310ffa8;hpb=953ac8ca75bc3bdcb9db8a382c7b3d63c795b27a;p=debian%2Fopenrocket diff --git a/core/src/net/sf/openrocket/document/Simulation.java b/core/src/net/sf/openrocket/document/Simulation.java index c947e23d..edb093c3 100644 --- a/core/src/net/sf/openrocket/document/Simulation.java +++ b/core/src/net/sf/openrocket/document/Simulation.java @@ -13,7 +13,6 @@ import net.sf.openrocket.masscalc.MassCalculator; import net.sf.openrocket.rocketcomponent.Configuration; import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.simulation.BasicEventSimulationEngine; -import net.sf.openrocket.simulation.CustomExpression; import net.sf.openrocket.simulation.FlightData; import net.sf.openrocket.simulation.RK4SimulationStepper; import net.sf.openrocket.simulation.SimulationConditions; @@ -61,7 +60,6 @@ public class Simulation implements ChangeSource, Cloneable { private SafetyMutex mutex = SafetyMutex.newInstance(); private final Rocket rocket; - private final OpenRocketDocument document; private String name = ""; @@ -72,7 +70,6 @@ public class Simulation implements ChangeSource, Cloneable { private SimulationOptions options; private ArrayList simulationListeners = new ArrayList(); - private ArrayList customExpressions = new ArrayList(); private final Class simulationEngineClass = BasicEventSimulationEngine.class; private Class simulationStepperClass = RK4SimulationStepper.class; @@ -96,11 +93,7 @@ public class Simulation implements ChangeSource, Cloneable { * * @param rocket the rocket associated with the simulation. */ - public Simulation(OpenRocketDocument doc, Rocket rocket) { - // It may seem silly to pass in the document and rocket, since usually when called we - // use doc.getRocket, but I guess there is some reason; when cloning a simulation + rocket we don't need - // to make a duplicate of the undo data etc stored in the document. --Richard - this.document = doc; + public Simulation(Rocket rocket) { this.rocket = rocket; this.status = Status.NOT_SIMULATED; @@ -111,7 +104,7 @@ public class Simulation implements ChangeSource, Cloneable { } - public Simulation(OpenRocketDocument doc, Rocket rocket, Status status, String name, SimulationOptions options, + public Simulation(Rocket rocket, Status status, String name, SimulationOptions options, List listeners, FlightData data) { if (rocket == null) @@ -124,7 +117,6 @@ public class Simulation implements ChangeSource, Cloneable { throw new IllegalArgumentException("options cannot be null"); this.rocket = rocket; - this.document = doc; if (status == Status.UPTODATE) { this.status = Status.LOADED; @@ -154,28 +146,6 @@ public class Simulation implements ChangeSource, Cloneable { } - /* - * Return the parent document for this simulation - */ - public OpenRocketDocument getDocument(){ - return document; - } - - public void addCustomExpression(CustomExpression expression){ - this.status = Simulation.Status.OUTDATED; - log.debug("Simulation must be run again to update custom expression."); - customExpressions.add(expression); - } - - public void removeCustomExpression(CustomExpression expression){ - customExpressions.remove(expression); - } - - public ArrayList getCustomExpressions(){ - return customExpressions; - } - - /** * Return the rocket associated with this simulation. * @@ -440,7 +410,7 @@ public class Simulation implements ChangeSource, Cloneable { public Simulation duplicateSimulation(Rocket newRocket) { mutex.lock("duplicateSimulation"); try { - Simulation copy = new Simulation(document, newRocket); + Simulation copy = new Simulation(newRocket); copy.name = this.name; copy.options.copyFrom(this.options);