fixed extra capitalization of FlightConfigurationId
This commit is contained in:
parent
c3b2316cbf
commit
b6c30a59ba
@ -22,7 +22,7 @@ import net.sf.openrocket.logging.Markers;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeListener;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
import net.sf.openrocket.simulation.FlightDataType;
|
||||
@ -252,7 +252,7 @@ public class OpenRocketDocument implements ComponentChangeListener {
|
||||
|
||||
public void addSimulation(Simulation simulation) {
|
||||
simulations.add(simulation);
|
||||
FlightConfigurationID simId = simulation.getId();
|
||||
FlightConfigurationId simId = simulation.getId();
|
||||
if( !rocket.containsFlightConfigurationID( simId )){
|
||||
rocket.createFlightConfiguration(simId);
|
||||
}
|
||||
@ -275,7 +275,7 @@ public class OpenRocketDocument implements ComponentChangeListener {
|
||||
return simulation;
|
||||
}
|
||||
|
||||
public void removeFlightConfigurationAndSimulations(FlightConfigurationID configId) {
|
||||
public void removeFlightConfigurationAndSimulations(FlightConfigurationId configId) {
|
||||
if (configId == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ import net.sf.openrocket.formatting.RocketDescriptor;
|
||||
import net.sf.openrocket.masscalc.MassCalculator;
|
||||
import net.sf.openrocket.motor.MotorConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.simulation.BasicEventSimulationEngine;
|
||||
import net.sf.openrocket.simulation.DefaultSimulationOptionFactory;
|
||||
@ -116,7 +116,7 @@ public class Simulation implements ChangeSource, Cloneable {
|
||||
DefaultSimulationOptionFactory f = Application.getInjector().getInstance(DefaultSimulationOptionFactory.class);
|
||||
options.copyConditionsFrom(f.getDefault());
|
||||
|
||||
FlightConfigurationID fcid = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
FlightConfigurationId fcid = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
options.setFlightConfigurationId(fcid);
|
||||
options.addChangeListener(new ConditionListener());
|
||||
}
|
||||
@ -174,7 +174,7 @@ public class Simulation implements ChangeSource, Cloneable {
|
||||
return rocket;
|
||||
}
|
||||
|
||||
public FlightConfigurationID getId(){
|
||||
public FlightConfigurationId getId(){
|
||||
return this.options.getFlightConfigurationId();
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ import net.sf.openrocket.rocketcomponent.DeploymentConfiguration.DeployEvent;
|
||||
import net.sf.openrocket.rocketcomponent.FinSet;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurableComponent;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||
import net.sf.openrocket.rocketcomponent.ParallelStage;
|
||||
import net.sf.openrocket.rocketcomponent.PodSet;
|
||||
|
||||
@ -12,7 +12,7 @@ import net.sf.openrocket.file.simplesax.ElementHandler;
|
||||
import net.sf.openrocket.file.simplesax.PlainTextHandler;
|
||||
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration.DeployEvent;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.RecoveryDevice;
|
||||
|
||||
class DeploymentConfigurationHandler extends AbstractElementHandler {
|
||||
@ -73,7 +73,7 @@ class DeploymentConfigurationHandler extends AbstractElementHandler {
|
||||
|
||||
@Override
|
||||
public void endHandler(String element, HashMap<String, String> attributes, String content, WarningSet warnings) throws SAXException {
|
||||
FlightConfigurationID configId = new FlightConfigurationID(attributes.get("configid"));
|
||||
FlightConfigurationId configId = new FlightConfigurationId(attributes.get("configid"));
|
||||
DeploymentConfiguration def = recoveryDevice.getDeploymentConfigurations().getDefault();
|
||||
recoveryDevice.getDeploymentConfigurations().set(configId, getConfiguration(def));
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ import net.sf.openrocket.file.simplesax.AbstractElementHandler;
|
||||
import net.sf.openrocket.file.simplesax.ElementHandler;
|
||||
import net.sf.openrocket.file.simplesax.PlainTextHandler;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
|
||||
@ -50,7 +50,7 @@ class MotorConfigurationHandler extends AbstractElementHandler {
|
||||
public void endHandler(String element, HashMap<String, String> attributes,
|
||||
String content, WarningSet warnings) throws SAXException {
|
||||
|
||||
FlightConfigurationID fcid = new FlightConfigurationID(attributes.remove("configid"));
|
||||
FlightConfigurationId fcid = new FlightConfigurationId(attributes.remove("configid"));
|
||||
if (!fcid.isValid()) {
|
||||
warnings.add(Warning.FILE_INVALID_PARAMETER);
|
||||
return;
|
||||
|
||||
@ -13,7 +13,7 @@ import net.sf.openrocket.file.simplesax.PlainTextHandler;
|
||||
import net.sf.openrocket.motor.Motor;
|
||||
import net.sf.openrocket.motor.MotorConfiguration;
|
||||
import net.sf.openrocket.motor.MotorInstanceId;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.IgnitionEvent;
|
||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
@ -66,7 +66,7 @@ class MotorMountHandler extends AbstractElementHandler {
|
||||
|
||||
if (element.equals("motor")) {
|
||||
// yes, this is confirmed to be the FLIGHT config id == motor instance id.
|
||||
FlightConfigurationID fcid = new FlightConfigurationID(attributes.get("configid"));
|
||||
FlightConfigurationId fcid = new FlightConfigurationId(attributes.get("configid"));
|
||||
if (!fcid.isValid()) {
|
||||
warnings.add(Warning.fromString("Illegal motor specification, ignoring."));
|
||||
return;
|
||||
@ -89,7 +89,7 @@ class MotorMountHandler extends AbstractElementHandler {
|
||||
}
|
||||
|
||||
if (element.equals("ignitionconfiguration")) {
|
||||
FlightConfigurationID fcid = new FlightConfigurationID(attributes.get("configid"));
|
||||
FlightConfigurationId fcid = new FlightConfigurationId(attributes.get("configid"));
|
||||
if ( ! fcid.isValid()){
|
||||
warnings.add(Warning.fromString("Illegal motor specification, ignoring."));
|
||||
return;
|
||||
|
||||
@ -7,7 +7,7 @@ import net.sf.openrocket.file.DocumentLoadingContext;
|
||||
import net.sf.openrocket.file.simplesax.AbstractElementHandler;
|
||||
import net.sf.openrocket.file.simplesax.ElementHandler;
|
||||
import net.sf.openrocket.file.simplesax.PlainTextHandler;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.simulation.SimulationOptions;
|
||||
import net.sf.openrocket.util.GeodeticComputationStrategy;
|
||||
@ -51,7 +51,7 @@ class SimulationConditionsHandler extends AbstractElementHandler {
|
||||
|
||||
if (element.equals("configid")) {
|
||||
// the ID constructor is designed to always return a valid value
|
||||
FlightConfigurationID idToSet= new FlightConfigurationID(content);
|
||||
FlightConfigurationId idToSet= new FlightConfigurationId(content);
|
||||
conditions.setFlightConfigurationId(idToSet);
|
||||
} else if (element.equals("launchrodlength")) {
|
||||
if (Double.isNaN(d)) {
|
||||
|
||||
@ -11,7 +11,7 @@ import net.sf.openrocket.file.simplesax.AbstractElementHandler;
|
||||
import net.sf.openrocket.file.simplesax.ElementHandler;
|
||||
import net.sf.openrocket.file.simplesax.PlainTextHandler;
|
||||
import net.sf.openrocket.rocketcomponent.AxialStage;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration.SeparationEvent;
|
||||
|
||||
@ -67,7 +67,7 @@ class StageSeparationConfigurationHandler extends AbstractElementHandler {
|
||||
|
||||
@Override
|
||||
public void endHandler(String element, HashMap<String, String> attributes, String content, WarningSet warnings) throws SAXException {
|
||||
FlightConfigurationID fcid = new FlightConfigurationID(attributes.get("configid"));
|
||||
FlightConfigurationId fcid = new FlightConfigurationId(attributes.get("configid"));
|
||||
StageSeparationConfiguration sepConfig = stage.getSeparationConfigurations().get(fcid);
|
||||
|
||||
// copy and update to the file-read values
|
||||
|
||||
@ -7,7 +7,7 @@ import java.util.Locale;
|
||||
import net.sf.openrocket.rocketcomponent.AxialStage;
|
||||
import net.sf.openrocket.rocketcomponent.ParallelStage;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration;
|
||||
@ -52,7 +52,7 @@ public class AxialStageSaver extends ComponentAssemblySaver {
|
||||
// is null and means "default".
|
||||
|
||||
for (FlightConfiguration curConfig : rocket.getConfigSet()){
|
||||
FlightConfigurationID fcid = curConfig.getFlightConfigurationID();
|
||||
FlightConfigurationId fcid = curConfig.getFlightConfigurationID();
|
||||
if (fcid == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ import java.util.Locale;
|
||||
|
||||
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet;
|
||||
import net.sf.openrocket.rocketcomponent.RecoveryDevice;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
@ -38,7 +38,7 @@ public class RecoveryDeviceSaver extends MassObjectSaver {
|
||||
// DEBUG
|
||||
|
||||
FlightConfigurableParameterSet<FlightConfiguration> configList = rocket.getConfigSet();
|
||||
for (FlightConfigurationID fcid : configList.getSortedConfigurationIDs()) {
|
||||
for (FlightConfigurationId fcid : configList.getSortedConfigurationIDs()) {
|
||||
//System.err.println("checking FlightConfiguration:"+fcid.getShortKey()+ " save?");
|
||||
|
||||
if (dev.getDeploymentConfigurations().isDefault(fcid)) {
|
||||
|
||||
@ -16,7 +16,7 @@ import net.sf.openrocket.motor.ThrustCurveMotor;
|
||||
import net.sf.openrocket.preset.ComponentPreset;
|
||||
import net.sf.openrocket.rocketcomponent.Clusterable;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentAssembly;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Instanceable;
|
||||
import net.sf.openrocket.rocketcomponent.LineInstanceable;
|
||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||
@ -190,7 +190,7 @@ public class RocketComponentSaver {
|
||||
elements.add(" <ignitiondelay>" + defaultInstance.getIgnitionDelay() + "</ignitiondelay>");
|
||||
elements.add(" <overhang>" + mount.getMotorOverhang() + "</overhang>");
|
||||
|
||||
for( FlightConfigurationID fcid : rkt.getSortedConfigurationIDs()){
|
||||
for( FlightConfigurationId fcid : rkt.getSortedConfigurationIDs()){
|
||||
|
||||
MotorConfiguration motorInstance = mount.getMotorInstance(fcid);
|
||||
// Nothing is stored if no motor loaded
|
||||
|
||||
@ -5,7 +5,7 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet;
|
||||
import net.sf.openrocket.rocketcomponent.ReferenceType;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
@ -44,7 +44,7 @@ public class RocketSaver extends RocketComponentSaver {
|
||||
|
||||
// Motor configurations
|
||||
FlightConfigurableParameterSet<FlightConfiguration> allConfigs = rocket.getConfigSet();
|
||||
for (FlightConfigurationID fcid : allConfigs.getSortedConfigurationIDs()) {
|
||||
for (FlightConfigurationId fcid : allConfigs.getSortedConfigurationIDs()) {
|
||||
FlightConfiguration flightConfig = allConfigs.get(fcid);
|
||||
if (fcid == null)
|
||||
continue;
|
||||
|
||||
@ -13,7 +13,7 @@ import net.sf.openrocket.motor.Motor;
|
||||
import net.sf.openrocket.motor.MotorConfiguration;
|
||||
import net.sf.openrocket.plugin.Plugin;
|
||||
import net.sf.openrocket.rocketcomponent.AxialStage;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
@ -33,7 +33,7 @@ public class MotorDescriptionSubstitutor implements RocketSubstitutor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String substitute(String str, Rocket rocket, FlightConfigurationID configId) {
|
||||
public String substitute(String str, Rocket rocket, FlightConfigurationId configId) {
|
||||
String description = getMotorConfigurationDescription(rocket, configId);
|
||||
return str.replace(SUBSTITUTION, description);
|
||||
}
|
||||
@ -47,7 +47,7 @@ public class MotorDescriptionSubstitutor implements RocketSubstitutor {
|
||||
|
||||
|
||||
|
||||
public String getMotorConfigurationDescription(Rocket rocket, FlightConfigurationID fcid) {
|
||||
public String getMotorConfigurationDescription(Rocket rocket, FlightConfigurationId fcid) {
|
||||
String name;
|
||||
int motorCount = 0;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package net.sf.openrocket.formatting;
|
||||
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
|
||||
/**
|
||||
@ -14,13 +14,13 @@ public interface RocketDescriptor {
|
||||
* of the rocket. This uses the default flight configuration name
|
||||
* as the basis.
|
||||
*/
|
||||
public String format(Rocket rocket, FlightConfigurationID configId);
|
||||
public String format(Rocket rocket, FlightConfigurationId configId);
|
||||
|
||||
|
||||
/**
|
||||
* Return a string describing a particular flight configuration
|
||||
* of the rocket. This uses a custom-provided name as the basis.
|
||||
*/
|
||||
public String format(String name, Rocket rocket, FlightConfigurationID configId);
|
||||
public String format(String name, Rocket rocket, FlightConfigurationId configId);
|
||||
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ import java.util.Set;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
|
||||
public class RocketDescriptorImpl implements RocketDescriptor {
|
||||
@ -13,13 +13,13 @@ public class RocketDescriptorImpl implements RocketDescriptor {
|
||||
private Set<RocketSubstitutor> substitutors;
|
||||
|
||||
@Override
|
||||
public String format(final Rocket rocket, final FlightConfigurationID configId) {
|
||||
public String format(final Rocket rocket, final FlightConfigurationId configId) {
|
||||
String name = rocket.getFlightConfiguration(configId).getName();
|
||||
return format(name, rocket, configId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String format(String name, final Rocket rocket, final FlightConfigurationID configId) {
|
||||
public String format(String name, final Rocket rocket, final FlightConfigurationId configId) {
|
||||
for (RocketSubstitutor s : substitutors) {
|
||||
while (s.containsSubstitution(name)) {
|
||||
name = s.substitute(name, rocket, configId);
|
||||
|
||||
@ -3,7 +3,7 @@ package net.sf.openrocket.formatting;
|
||||
import java.util.Map;
|
||||
|
||||
import net.sf.openrocket.plugin.Plugin;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
|
||||
/**
|
||||
@ -14,7 +14,7 @@ public interface RocketSubstitutor {
|
||||
|
||||
public boolean containsSubstitution(String str);
|
||||
|
||||
public String substitute(String str, Rocket rocket, FlightConfigurationID configId);
|
||||
public String substitute(String str, Rocket rocket, FlightConfigurationId configId);
|
||||
|
||||
public Map<String, String> getDescriptions();
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package net.sf.openrocket.motor;
|
||||
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
|
||||
@ -40,7 +40,7 @@ public class MotorConfigurationSet extends FlightConfigurableParameterSet<MotorC
|
||||
MotorConfiguration emptyInstance = this.getDefault();
|
||||
buffer.append(" >> (["+emptyInstance.toString()+"]= @ "+ emptyInstance.getIgnitionEvent().name +" +"+emptyInstance.getIgnitionDelay()+"sec )\n");
|
||||
|
||||
for( FlightConfigurationID loopFCID : this.map.keySet()){
|
||||
for( FlightConfigurationId loopFCID : this.map.keySet()){
|
||||
String shortKey = loopFCID.toShortKey();
|
||||
|
||||
MotorConfiguration curInstance = this.map.get(loopFCID);
|
||||
|
||||
@ -73,7 +73,7 @@ public class AxialStage extends ComponentAssembly implements FlightConfigurableC
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cloneFlightConfiguration(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId) {
|
||||
public void cloneFlightConfiguration(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId) {
|
||||
separations.cloneFlightConfiguration(oldConfigId, newConfigId);
|
||||
}
|
||||
|
||||
|
||||
@ -369,12 +369,12 @@ public class BodyTube extends SymmetricComponent implements MotorMount, Coaxial
|
||||
}
|
||||
|
||||
@Override
|
||||
public MotorConfiguration getMotorInstance( final FlightConfigurationID fcid){
|
||||
public MotorConfiguration getMotorInstance( final FlightConfigurationId fcid){
|
||||
return this.motors.get(fcid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMotorInstance(final FlightConfigurationID fcid, final MotorConfiguration newMotorInstance){
|
||||
public void setMotorInstance(final FlightConfigurationId fcid, final MotorConfiguration newMotorInstance){
|
||||
if((null == newMotorInstance)){
|
||||
this.motors.set( fcid, null);
|
||||
}else{
|
||||
@ -400,7 +400,7 @@ public class BodyTube extends SymmetricComponent implements MotorMount, Coaxial
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cloneFlightConfiguration(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId) {
|
||||
public void cloneFlightConfiguration(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId) {
|
||||
motors.cloneFlightConfiguration(oldConfigId, newConfigId);
|
||||
}
|
||||
|
||||
@ -450,7 +450,7 @@ public class BodyTube extends SymmetricComponent implements MotorMount, Coaxial
|
||||
|
||||
|
||||
@Override
|
||||
public Coordinate getMotorPosition(FlightConfigurationID id) {
|
||||
public Coordinate getMotorPosition(FlightConfigurationId id) {
|
||||
Motor motor = this.motors.get(id).getMotor();
|
||||
if (motor == null) {
|
||||
throw new IllegalArgumentException("No motor with id " + id + " defined.");
|
||||
|
||||
@ -41,7 +41,7 @@ public interface FlightConfigurable<E extends ChangeSource> extends FlightConfig
|
||||
* @param id the flight configuration ID
|
||||
* @return the parameter to use (never null)
|
||||
*/
|
||||
public E get(FlightConfigurationID id);
|
||||
public E get(FlightConfigurationId id);
|
||||
|
||||
/**
|
||||
* Return the parameter value for the provided flight configuration ID.
|
||||
@ -51,7 +51,7 @@ public interface FlightConfigurable<E extends ChangeSource> extends FlightConfig
|
||||
* @param value the parameter to find
|
||||
* @return the flight configuration ID
|
||||
*/
|
||||
public FlightConfigurationID get(E value);
|
||||
public FlightConfigurationId get(E value);
|
||||
|
||||
/**
|
||||
* Set the parameter value for the provided flight configuration ID.
|
||||
@ -60,13 +60,13 @@ public interface FlightConfigurable<E extends ChangeSource> extends FlightConfig
|
||||
* @param id the flight configuration ID
|
||||
* @param value the parameter value (null not allowed)
|
||||
*/
|
||||
public void set(FlightConfigurationID id, E value);
|
||||
public void set(FlightConfigurationId id, E value);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return a sorted list of all the contained FlightConfigurationIDs
|
||||
*/
|
||||
public List<FlightConfigurationID> getSortedConfigurationIDs();
|
||||
public List<FlightConfigurationId> getSortedConfigurationIDs();
|
||||
|
||||
/**
|
||||
* Return whether a specific flight configuration ID is using the
|
||||
@ -75,14 +75,14 @@ public interface FlightConfigurable<E extends ChangeSource> extends FlightConfig
|
||||
* @param id the flight configuration ID
|
||||
* @return whether the default is being used
|
||||
*/
|
||||
public boolean isDefault(FlightConfigurationID id);
|
||||
public boolean isDefault(FlightConfigurationId id);
|
||||
|
||||
/**
|
||||
* Reset a specific flight configuration ID to use the default parameter value.
|
||||
*
|
||||
* @param id the flight configuration ID
|
||||
*/
|
||||
public void reset(FlightConfigurationID id);
|
||||
public void reset(FlightConfigurationId id);
|
||||
|
||||
/**
|
||||
* Return the number of specific flight configurations other than the default.
|
||||
|
||||
@ -14,6 +14,6 @@ public interface FlightConfigurableComponent {
|
||||
* @param oldConfigId the old configuration ID
|
||||
* @param newConfigId the new configuration ID
|
||||
*/
|
||||
public void cloneFlightConfiguration(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId);
|
||||
public void cloneFlightConfiguration(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId);
|
||||
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ import net.sf.openrocket.util.Utils;
|
||||
public class FlightConfigurableParameterSet<E extends FlightConfigurableParameter<E>> implements FlightConfigurable<E> {
|
||||
|
||||
//private static final Logger log = LoggerFactory.getLogger(ParameterSet.class);
|
||||
protected final HashMap<FlightConfigurationID, E> map = new HashMap<FlightConfigurationID, E>();
|
||||
protected final HashMap<FlightConfigurationId, E> map = new HashMap<FlightConfigurationId, E>();
|
||||
|
||||
protected E defaultValue;
|
||||
protected final RocketComponent component;
|
||||
@ -56,13 +56,13 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
|
||||
this.eventType = eventType;
|
||||
|
||||
this.defaultValue= configSet.getDefault().clone();
|
||||
for (FlightConfigurationID key : configSet.map.keySet()) {
|
||||
for (FlightConfigurationId key : configSet.map.keySet()) {
|
||||
E cloneConfig = configSet.map.get(key).clone();
|
||||
this.map.put(key, cloneConfig);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean containsKey( final FlightConfigurationID fcid ){
|
||||
public boolean containsKey( final FlightConfigurationId fcid ){
|
||||
return this.map.containsKey(fcid);
|
||||
}
|
||||
|
||||
@ -94,12 +94,12 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
|
||||
}
|
||||
|
||||
@Override
|
||||
public FlightConfigurationID get(E testValue) {
|
||||
public FlightConfigurationId get(E testValue) {
|
||||
if( null == testValue ){
|
||||
return null;
|
||||
}
|
||||
for( Entry<FlightConfigurationID, E> curEntry : this.map.entrySet()){
|
||||
FlightConfigurationID curKey = curEntry.getKey();
|
||||
for( Entry<FlightConfigurationId, E> curEntry : this.map.entrySet()){
|
||||
FlightConfigurationId curKey = curEntry.getKey();
|
||||
E curValue = curEntry.getValue();
|
||||
|
||||
if( testValue.equals(curValue)){
|
||||
@ -119,13 +119,13 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
|
||||
+" than the stored values: "+index+"/"+this.map.size());
|
||||
}
|
||||
|
||||
List<FlightConfigurationID> ids = this.getSortedConfigurationIDs();
|
||||
FlightConfigurationID selectedId = ids.get(index);
|
||||
List<FlightConfigurationId> ids = this.getSortedConfigurationIDs();
|
||||
FlightConfigurationId selectedId = ids.get(index);
|
||||
return this.map.get(selectedId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E get(FlightConfigurationID id) {
|
||||
public E get(FlightConfigurationId id) {
|
||||
if( id.hasError() ){
|
||||
throw new NullPointerException("Attempted to retrieve a parameter with an error key!");
|
||||
}
|
||||
@ -139,8 +139,8 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FlightConfigurationID> getSortedConfigurationIDs(){
|
||||
ArrayList<FlightConfigurationID> toReturn = new ArrayList<FlightConfigurationID>();
|
||||
public List<FlightConfigurationId> getSortedConfigurationIDs(){
|
||||
ArrayList<FlightConfigurationId> toReturn = new ArrayList<FlightConfigurationId>();
|
||||
|
||||
toReturn.addAll( this.map.keySet() );
|
||||
// Java 1.8:
|
||||
@ -152,12 +152,12 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
public List<FlightConfigurationID> getIDs(){
|
||||
public List<FlightConfigurationId> getIDs(){
|
||||
return this.getSortedConfigurationIDs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(FlightConfigurationID fcid, E nextValue) {
|
||||
public void set(FlightConfigurationId fcid, E nextValue) {
|
||||
if ( nextValue == null) {
|
||||
// null value means to delete this fcid
|
||||
E previousValue = this.map.remove(fcid);
|
||||
@ -176,12 +176,12 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefault( FlightConfigurationID fcid) {
|
||||
public boolean isDefault( FlightConfigurationId fcid) {
|
||||
return ( this.getDefault() == this.map.get(fcid));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset( FlightConfigurationID fcid) {
|
||||
public void reset( FlightConfigurationId fcid) {
|
||||
if( fcid.isValid() ){
|
||||
set( fcid, null);
|
||||
}
|
||||
@ -193,7 +193,7 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
|
||||
|
||||
|
||||
@Override
|
||||
public void cloneFlightConfiguration(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId) {
|
||||
public void cloneFlightConfiguration(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId) {
|
||||
// clones the ENTRIES for the given fcid's.
|
||||
E oldValue = this.get(oldConfigId);
|
||||
this.set(newConfigId, oldValue.clone());
|
||||
@ -226,7 +226,7 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
|
||||
buf.append(String.format(" >> ParameterSet<%s> (%d configurations)\n", this.defaultValue.getClass().getSimpleName(), this.size() ));
|
||||
|
||||
buf.append(String.format(" >> [%s]= %s\n", "DEFAULT", this.getDefault().toString() ));
|
||||
for( FlightConfigurationID loopFCID : this.getSortedConfigurationIDs()){
|
||||
for( FlightConfigurationId loopFCID : this.getSortedConfigurationIDs()){
|
||||
String shortKey = loopFCID.toShortKey();
|
||||
|
||||
E inst = this.map.get(loopFCID);
|
||||
|
||||
@ -37,7 +37,7 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
||||
protected String configurationName;
|
||||
|
||||
protected final Rocket rocket;
|
||||
protected final FlightConfigurationID fcid;
|
||||
protected final FlightConfigurationId fcid;
|
||||
|
||||
protected static int instanceCount=0;
|
||||
public final int instanceNumber;
|
||||
@ -85,9 +85,9 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
||||
* @param _fcid the ID this configuration should have.
|
||||
* @param rocket the rocket
|
||||
*/
|
||||
public FlightConfiguration(final Rocket rocket, final FlightConfigurationID _fcid ) {
|
||||
public FlightConfiguration(final Rocket rocket, final FlightConfigurationId _fcid ) {
|
||||
if( null == _fcid){
|
||||
this.fcid = new FlightConfigurationID();
|
||||
this.fcid = new FlightConfigurationId();
|
||||
}else{
|
||||
this.fcid = _fcid;
|
||||
}
|
||||
@ -269,11 +269,11 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
||||
return Math.PI * MathUtil.pow2(getReferenceLength() / 2);
|
||||
}
|
||||
|
||||
public FlightConfigurationID getFlightConfigurationID() {
|
||||
public FlightConfigurationId getFlightConfigurationID() {
|
||||
return fcid;
|
||||
}
|
||||
|
||||
public FlightConfigurationID getId() {
|
||||
public FlightConfigurationId getId() {
|
||||
return getFlightConfigurationID();
|
||||
}
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ import java.util.UUID;
|
||||
* It is intended to provide better visibility and traceability by more specific type safety -- this class replaces a
|
||||
* straight-up <code>String</code> Key in previous implementations.
|
||||
*/
|
||||
public final class FlightConfigurationID implements Comparable<FlightConfigurationID> {
|
||||
public final class FlightConfigurationId implements Comparable<FlightConfigurationId> {
|
||||
final public UUID key;
|
||||
|
||||
private final static long DEFAULT_MOST_SIG_BITS = 0xF4F2F1F0;
|
||||
@ -15,14 +15,14 @@ public final class FlightConfigurationID implements Comparable<FlightConfigurati
|
||||
private final static String ERROR_KEY_NAME = "<Error_Key>";
|
||||
private final static UUID DEFAULT_VALUE_UUID = new UUID( DEFAULT_MOST_SIG_BITS, 5676);
|
||||
|
||||
public final static FlightConfigurationID ERROR_CONFIGURATION_FCID = new FlightConfigurationID( FlightConfigurationID.ERROR_CONFIGURATION_UUID);
|
||||
public final static FlightConfigurationID DEFAULT_VALUE_FCID = new FlightConfigurationID( FlightConfigurationID.DEFAULT_VALUE_UUID );
|
||||
public final static FlightConfigurationId ERROR_CONFIGURATION_FCID = new FlightConfigurationId( FlightConfigurationId.ERROR_CONFIGURATION_UUID);
|
||||
public final static FlightConfigurationId DEFAULT_VALUE_FCID = new FlightConfigurationId( FlightConfigurationId.DEFAULT_VALUE_UUID );
|
||||
|
||||
public FlightConfigurationID() {
|
||||
public FlightConfigurationId() {
|
||||
this(UUID.randomUUID());
|
||||
}
|
||||
|
||||
public FlightConfigurationID(final String _str) {
|
||||
public FlightConfigurationId(final String _str) {
|
||||
UUID candidate;
|
||||
if(_str == null || "".equals(_str)){
|
||||
candidate = UUID.randomUUID();
|
||||
@ -36,9 +36,9 @@ public final class FlightConfigurationID implements Comparable<FlightConfigurati
|
||||
this.key = candidate;
|
||||
}
|
||||
|
||||
public FlightConfigurationID(final UUID _val) {
|
||||
public FlightConfigurationId(final UUID _val) {
|
||||
if (null == _val){
|
||||
this.key = FlightConfigurationID.ERROR_CONFIGURATION_UUID;
|
||||
this.key = FlightConfigurationId.ERROR_CONFIGURATION_UUID;
|
||||
} else {
|
||||
this.key = _val;
|
||||
}
|
||||
@ -46,11 +46,11 @@ public final class FlightConfigurationID implements Comparable<FlightConfigurati
|
||||
|
||||
@Override
|
||||
public boolean equals(Object anObject) {
|
||||
if (!(anObject instanceof FlightConfigurationID)) {
|
||||
if (!(anObject instanceof FlightConfigurationId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
FlightConfigurationID otherFCID = (FlightConfigurationID) anObject;
|
||||
FlightConfigurationId otherFCID = (FlightConfigurationId) anObject;
|
||||
return this.key.equals(otherFCID.key);
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ public final class FlightConfigurationID implements Comparable<FlightConfigurati
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(FlightConfigurationID other) {
|
||||
public int compareTo(FlightConfigurationId other) {
|
||||
return (this.key.compareTo( other.key));
|
||||
}
|
||||
|
||||
@ -277,12 +277,12 @@ public class InnerTube extends ThicknessRingComponent implements Clusterable, Ra
|
||||
}
|
||||
|
||||
@Override
|
||||
public MotorConfiguration getMotorInstance( final FlightConfigurationID fcid){
|
||||
public MotorConfiguration getMotorInstance( final FlightConfigurationId fcid){
|
||||
return this.motors.get(fcid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMotorInstance(final FlightConfigurationID fcid, final MotorConfiguration newMotorInstance){
|
||||
public void setMotorInstance(final FlightConfigurationId fcid, final MotorConfiguration newMotorInstance){
|
||||
if((null == newMotorInstance)){
|
||||
this.motors.set( fcid, null);
|
||||
}else{
|
||||
@ -307,7 +307,7 @@ public class InnerTube extends ThicknessRingComponent implements Clusterable, Ra
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cloneFlightConfiguration(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId) {
|
||||
public void cloneFlightConfiguration(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId) {
|
||||
motors.cloneFlightConfiguration(oldConfigId, newConfigId);
|
||||
}
|
||||
|
||||
@ -355,7 +355,7 @@ public class InnerTube extends ThicknessRingComponent implements Clusterable, Ra
|
||||
}
|
||||
|
||||
@Override
|
||||
public Coordinate getMotorPosition(FlightConfigurationID id) {
|
||||
public Coordinate getMotorPosition(FlightConfigurationId id) {
|
||||
Motor motor = motors.get(id).getMotor();
|
||||
if (motor == null) {
|
||||
throw new IllegalArgumentException("No motor with id " + id + " defined.");
|
||||
@ -412,7 +412,7 @@ public class InnerTube extends ThicknessRingComponent implements Clusterable, Ra
|
||||
|
||||
Coordinate[] relCoords = this.getInstanceOffsets();
|
||||
Coordinate[] absCoords = this.getLocations();
|
||||
FlightConfigurationID curId = this.getRocket().getDefaultConfiguration().getFlightConfigurationID();
|
||||
FlightConfigurationId curId = this.getRocket().getDefaultConfiguration().getFlightConfigurationID();
|
||||
final int intanceCount = this.getInstanceCount();
|
||||
MotorConfiguration curInstance = this.motors.get(curId);
|
||||
if( curInstance.isEmpty() ){
|
||||
|
||||
@ -59,14 +59,14 @@ public interface MotorMount extends ChangeSource, FlightConfigurableComponent {
|
||||
* @param fcid id for which to return the motor (null retrieves the default)
|
||||
* @return requested motorInstance (which may also be the default motor instance)
|
||||
*/
|
||||
public MotorConfiguration getMotorInstance( final FlightConfigurationID fcid);
|
||||
public MotorConfiguration getMotorInstance( final FlightConfigurationId fcid);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param fcid index the supplied motor against this flight configuration
|
||||
* @param newMotorInstance motor instance to store
|
||||
*/
|
||||
public void setMotorInstance(final FlightConfigurationID fcid, final MotorConfiguration newMotorInstance);
|
||||
public void setMotorInstance(final FlightConfigurationId fcid, final MotorConfiguration newMotorInstance);
|
||||
|
||||
/**
|
||||
* Get the number of motors available for all flight configurations
|
||||
@ -106,7 +106,7 @@ public interface MotorMount extends ChangeSource, FlightConfigurableComponent {
|
||||
* @return the position of the motor relative to this component.
|
||||
* @throws IllegalArgumentException if a motor with the specified ID does not exist.
|
||||
*/
|
||||
public Coordinate getMotorPosition(FlightConfigurationID id);
|
||||
public Coordinate getMotorPosition(FlightConfigurationId id);
|
||||
|
||||
/**
|
||||
* Development / Debug method.
|
||||
|
||||
@ -81,7 +81,7 @@ public class ParallelStage extends AxialStage implements FlightConfigurableCompo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cloneFlightConfiguration(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId) {
|
||||
public void cloneFlightConfiguration(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId) {
|
||||
this.separations.cloneFlightConfiguration(oldConfigId, newConfigId);
|
||||
}
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@ public abstract class RecoveryDevice extends MassObject implements FlightConfigu
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cloneFlightConfiguration(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId) {
|
||||
public void cloneFlightConfiguration(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId) {
|
||||
deploymentConfigurations.cloneFlightConfiguration(oldConfigId, newConfigId);
|
||||
}
|
||||
|
||||
|
||||
@ -534,7 +534,7 @@ public class Rocket extends RocketComponent {
|
||||
return this.configSet.getDefault();
|
||||
}
|
||||
|
||||
public FlightConfiguration createFlightConfiguration( final FlightConfigurationID fcid) {
|
||||
public FlightConfiguration createFlightConfiguration( final FlightConfigurationId fcid) {
|
||||
checkState();
|
||||
if( fcid.hasError() ){
|
||||
throw new NullPointerException("Attempted to create a flightConfiguration from an error key!");
|
||||
@ -558,7 +558,7 @@ public class Rocket extends RocketComponent {
|
||||
return this.configSet;
|
||||
}
|
||||
|
||||
public List<FlightConfigurationID> getSortedConfigurationIDs(){
|
||||
public List<FlightConfigurationId> getSortedConfigurationIDs(){
|
||||
return configSet.getSortedConfigurationIDs();
|
||||
}
|
||||
|
||||
@ -569,7 +569,7 @@ public class Rocket extends RocketComponent {
|
||||
*
|
||||
* @param id the flight configuration ID to remove
|
||||
*/
|
||||
public void removeFlightConfigurationID(FlightConfigurationID fcid) {
|
||||
public void removeFlightConfigurationID(FlightConfigurationId fcid) {
|
||||
checkState();
|
||||
if( fcid.hasError() ){
|
||||
return;
|
||||
@ -587,7 +587,7 @@ public class Rocket extends RocketComponent {
|
||||
* @param id the configuration ID.
|
||||
* @return whether a motor configuration with that ID exists.
|
||||
*/
|
||||
public boolean containsFlightConfigurationID(FlightConfigurationID id) {
|
||||
public boolean containsFlightConfigurationID(FlightConfigurationId id) {
|
||||
checkState();
|
||||
if( id.hasError() ){
|
||||
return false;
|
||||
@ -602,7 +602,7 @@ public class Rocket extends RocketComponent {
|
||||
* @param id the FlightConfigurationID containing the motor (may be invalid).
|
||||
* @return whether any motors are defined for it.
|
||||
*/
|
||||
public boolean hasMotors(FlightConfigurationID fcid) {
|
||||
public boolean hasMotors(FlightConfigurationId fcid) {
|
||||
checkState();
|
||||
if( fcid.hasError() ){
|
||||
return false;
|
||||
@ -631,7 +631,7 @@ public class Rocket extends RocketComponent {
|
||||
* @param id the flight configuration id
|
||||
* @return a FlightConfiguration instance
|
||||
*/
|
||||
public FlightConfiguration getFlightConfiguration(final FlightConfigurationID fcid) {
|
||||
public FlightConfiguration getFlightConfiguration(final FlightConfigurationId fcid) {
|
||||
checkState();
|
||||
return this.createFlightConfiguration(fcid);
|
||||
}
|
||||
@ -648,7 +648,7 @@ public class Rocket extends RocketComponent {
|
||||
}
|
||||
|
||||
|
||||
public void setDefaultConfiguration(final FlightConfigurationID fcid) {
|
||||
public void setDefaultConfiguration(final FlightConfigurationId fcid) {
|
||||
checkState();
|
||||
|
||||
if( fcid.hasError() ){
|
||||
@ -667,7 +667,7 @@ public class Rocket extends RocketComponent {
|
||||
* @param id the flight configuration id
|
||||
* @param name the name for the flight configuration
|
||||
*/
|
||||
public void setFlightConfiguration(final FlightConfigurationID fcid, FlightConfiguration newConfig) {
|
||||
public void setFlightConfiguration(final FlightConfigurationId fcid, FlightConfiguration newConfig) {
|
||||
checkState();
|
||||
if( fcid.hasError() ){
|
||||
log.error("attempt to set a 'fcid = config' with a error fcid. Ignored.", new IllegalArgumentException("error id:"+fcid));
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
package net.sf.openrocket.rocketvisitors;
|
||||
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurableComponent;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
|
||||
public class CopyFlightConfigurationVisitor extends DepthFirstRecusiveVisitor<Void> {
|
||||
|
||||
private final FlightConfigurationID oldConfigId;
|
||||
private final FlightConfigurationID newConfigId;
|
||||
private final FlightConfigurationId oldConfigId;
|
||||
private final FlightConfigurationId newConfigId;
|
||||
|
||||
public CopyFlightConfigurationVisitor(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId) {
|
||||
public CopyFlightConfigurationVisitor(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId) {
|
||||
super();
|
||||
this.oldConfigId = oldConfigId;
|
||||
this.newConfigId = newConfigId;
|
||||
|
||||
@ -15,7 +15,7 @@ import net.sf.openrocket.motor.MotorInstanceId;
|
||||
import net.sf.openrocket.rocketcomponent.AxialStage;
|
||||
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.IgnitionEvent;
|
||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||
import net.sf.openrocket.rocketcomponent.RecoveryDevice;
|
||||
@ -55,7 +55,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
||||
|
||||
private SimulationStatus currentStatus;
|
||||
|
||||
private FlightConfigurationID fcid;
|
||||
private FlightConfigurationId fcid;
|
||||
|
||||
// this is just a list of simulation branches to
|
||||
Deque<SimulationStatus> toSimulate = new ArrayDeque<SimulationStatus>();
|
||||
|
||||
@ -9,7 +9,7 @@ import net.sf.openrocket.masscalc.MassCalculator;
|
||||
import net.sf.openrocket.models.atmosphere.AtmosphericModel;
|
||||
import net.sf.openrocket.models.gravity.GravityModel;
|
||||
import net.sf.openrocket.models.wind.WindModel;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.simulation.listeners.SimulationListener;
|
||||
import net.sf.openrocket.util.BugException;
|
||||
@ -28,7 +28,7 @@ import net.sf.openrocket.util.WorldCoordinate;
|
||||
public class SimulationConditions implements Monitorable, Cloneable {
|
||||
|
||||
private Rocket rocket;
|
||||
private FlightConfigurationID configId= null;
|
||||
private FlightConfigurationId configId= null;
|
||||
|
||||
private Simulation simulation; // The parent simulation
|
||||
|
||||
@ -115,15 +115,15 @@ public class SimulationConditions implements Monitorable, Cloneable {
|
||||
}
|
||||
|
||||
|
||||
public FlightConfigurationID getMotorConfigurationID() {
|
||||
public FlightConfigurationId getMotorConfigurationID() {
|
||||
return configId;
|
||||
}
|
||||
|
||||
public FlightConfigurationID getFlightConfigurationID() {
|
||||
public FlightConfigurationId getFlightConfigurationID() {
|
||||
return configId;
|
||||
}
|
||||
|
||||
public void setFlightConfigurationID(FlightConfigurationID _fcid) {
|
||||
public void setFlightConfigurationID(FlightConfigurationId _fcid) {
|
||||
this.configId = _fcid;
|
||||
this.modID++;
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ import net.sf.openrocket.models.atmosphere.ExtendedISAModel;
|
||||
import net.sf.openrocket.models.gravity.GravityModel;
|
||||
import net.sf.openrocket.models.gravity.WGSGravityModel;
|
||||
import net.sf.openrocket.models.wind.PinkNoiseWindModel;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.startup.Preferences;
|
||||
@ -51,7 +51,7 @@ public class SimulationOptions implements ChangeSource, Cloneable {
|
||||
protected final Preferences preferences = Application.getPreferences();
|
||||
|
||||
private final Rocket rocket;
|
||||
private FlightConfigurationID configId = new FlightConfigurationID();
|
||||
private FlightConfigurationId configId = new FlightConfigurationId();
|
||||
|
||||
/*
|
||||
* NOTE: When adding/modifying parameters, they must also be added to the
|
||||
@ -100,11 +100,11 @@ public class SimulationOptions implements ChangeSource, Cloneable {
|
||||
return rocket;
|
||||
}
|
||||
|
||||
public FlightConfigurationID getFlightConfigurationId() {
|
||||
public FlightConfigurationId getFlightConfigurationId() {
|
||||
return getId();
|
||||
}
|
||||
|
||||
public FlightConfigurationID getId() {
|
||||
public FlightConfigurationId getId() {
|
||||
return this.configId;
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ public class SimulationOptions implements ChangeSource, Cloneable {
|
||||
*
|
||||
* @param id the configuration to set.
|
||||
*/
|
||||
public void setFlightConfigurationId(FlightConfigurationID fcid) {
|
||||
public void setFlightConfigurationId(FlightConfigurationId fcid) {
|
||||
if ( null == fcid ){
|
||||
throw new NullPointerException("Attempted to set a null Config id in simulation options. Not allowed!");
|
||||
}else if ( fcid.hasError() ){
|
||||
@ -449,9 +449,9 @@ public class SimulationOptions implements ChangeSource, Cloneable {
|
||||
MotorDescriptionSubstitutor formatter = Application.getInjector().getInstance(MotorDescriptionSubstitutor.class);
|
||||
|
||||
String motorDesc = formatter.getMotorConfigurationDescription(src.rocket, src.configId);
|
||||
FlightConfigurationID matchID = null;
|
||||
FlightConfigurationId matchID = null;
|
||||
|
||||
for (FlightConfigurationID fcid : this.rocket.getSortedConfigurationIDs()){
|
||||
for (FlightConfigurationId fcid : this.rocket.getSortedConfigurationIDs()){
|
||||
String motorDesc2 = formatter.getMotorConfigurationDescription(this.rocket, fcid);
|
||||
if (motorDesc.equals(motorDesc2)) {
|
||||
matchID = fcid;
|
||||
|
||||
@ -31,7 +31,7 @@ import net.sf.openrocket.rocketcomponent.ExternalComponent;
|
||||
import net.sf.openrocket.rocketcomponent.ExternalComponent.Finish;
|
||||
import net.sf.openrocket.rocketcomponent.FinSet.CrossSection;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.FreeformFinSet;
|
||||
import net.sf.openrocket.rocketcomponent.IllegalFinPointException;
|
||||
import net.sf.openrocket.rocketcomponent.InnerTube;
|
||||
@ -465,7 +465,7 @@ public class TestRockets {
|
||||
finset.setMaterial(material);
|
||||
|
||||
FlightConfiguration config = rocket.getDefaultConfiguration();
|
||||
FlightConfigurationID fcid = config.getFlightConfigurationID();
|
||||
FlightConfigurationId fcid = config.getFlightConfigurationID();
|
||||
|
||||
ThrustCurveMotor motor = getTestMotor();
|
||||
MotorConfiguration instance = new MotorConfiguration(motor);
|
||||
@ -810,7 +810,7 @@ public class TestRockets {
|
||||
MotorConfiguration motorInstance = TestRockets.generateMotorInstance_M1350_75mm();
|
||||
motorInstance.setID( new MotorInstanceId( coreBody.getName(), 1) );
|
||||
coreBody.setMotorMount( true);
|
||||
FlightConfigurationID motorConfigId = config.getFlightConfigurationID();
|
||||
FlightConfigurationId motorConfigId = config.getFlightConfigurationID();
|
||||
coreBody.setMotorInstance( motorConfigId, motorInstance);
|
||||
}
|
||||
|
||||
@ -868,7 +868,7 @@ public class TestRockets {
|
||||
boosterMotorTubes.setClusterScale(1.0);
|
||||
boosterBody.addChild( boosterMotorTubes);
|
||||
|
||||
FlightConfigurationID motorConfigId = config.getFlightConfigurationID();
|
||||
FlightConfigurationId motorConfigId = config.getFlightConfigurationID();
|
||||
MotorConfiguration motorInstance = TestRockets.generateMotorInstance_G77_29mm();
|
||||
motorInstance.setID( new MotorInstanceId( boosterMotorTubes.getName(), 1) );
|
||||
boosterMotorTubes.setMotorInstance( motorConfigId, motorInstance);
|
||||
@ -964,7 +964,7 @@ public class TestRockets {
|
||||
Rocket rocket = new Rocket();
|
||||
rocket.setName("v104_withMotorConfig");
|
||||
FlightConfiguration config = rocket.getDefaultConfiguration();
|
||||
FlightConfigurationID fcid = config.getFlightConfigurationID();
|
||||
FlightConfigurationId fcid = config.getFlightConfigurationID();
|
||||
config.setName("F12X");
|
||||
|
||||
// make stage
|
||||
@ -999,7 +999,7 @@ public class TestRockets {
|
||||
Rocket rocket = new Rocket();
|
||||
rocket.setName("v104_withSimulationData");
|
||||
FlightConfiguration config = rocket.getDefaultConfiguration();
|
||||
FlightConfigurationID fcid = config.getFlightConfigurationID();
|
||||
FlightConfigurationId fcid = config.getFlightConfigurationID();
|
||||
config.setName("F12X");
|
||||
|
||||
// make stage
|
||||
@ -1158,7 +1158,7 @@ public class TestRockets {
|
||||
public static OpenRocketDocument makeTestRocket_v106_withMotorMountIgnitionConfig() {
|
||||
Rocket rocket = new Rocket();
|
||||
rocket.setName("v106_withwithMotorMountIgnitionConfig");
|
||||
FlightConfigurationID fcid = new FlightConfigurationID();
|
||||
FlightConfigurationId fcid = new FlightConfigurationId();
|
||||
|
||||
// make stage
|
||||
AxialStage stage = new AxialStage();
|
||||
@ -1190,7 +1190,7 @@ public class TestRockets {
|
||||
public static OpenRocketDocument makeTestRocket_v106_withRecoveryDeviceDeploymentConfig() {
|
||||
Rocket rocket = new Rocket();
|
||||
rocket.setName("v106_withRecoveryDeviceDeploymentConfig");
|
||||
FlightConfigurationID testFCID = new FlightConfigurationID("testParachute");
|
||||
FlightConfigurationId testFCID = new FlightConfigurationId("testParachute");
|
||||
|
||||
// make stage
|
||||
AxialStage stage = new AxialStage();
|
||||
@ -1217,7 +1217,7 @@ public class TestRockets {
|
||||
public static OpenRocketDocument makeTestRocket_v106_withStageSeparationConfig() {
|
||||
Rocket rocket = new Rocket();
|
||||
rocket.setName("v106_withStageSeparationConfig");
|
||||
FlightConfigurationID fcid = new FlightConfigurationID("3SecondDelay");
|
||||
FlightConfigurationId fcid = new FlightConfigurationId("3SecondDelay");
|
||||
// make 1st stage
|
||||
AxialStage stage1 = new AxialStage();
|
||||
stage1.setName("Stage1");
|
||||
|
||||
@ -14,7 +14,7 @@ import net.sf.openrocket.ServicesForTesting;
|
||||
import net.sf.openrocket.motor.MotorConfiguration;
|
||||
import net.sf.openrocket.plugin.PluginModule;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.InnerTube;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
@ -64,7 +64,7 @@ public class BarrowmanCalculatorTest {
|
||||
public void testCPSimpleWithMotor() {
|
||||
Rocket rkt = TestRockets.makeEstesAlphaIII();
|
||||
FlightConfiguration config = rkt.getDefaultConfiguration();
|
||||
FlightConfigurationID fcid = config.getFlightConfigurationID();
|
||||
FlightConfigurationId fcid = config.getFlightConfigurationID();
|
||||
AerodynamicCalculator calc = new BarrowmanCalculator();
|
||||
FlightConditions conditions = new FlightConditions(config);
|
||||
WarningSet warnings = new WarningSet();
|
||||
|
||||
@ -10,7 +10,7 @@ import net.sf.openrocket.masscalc.MassCalculator.MassCalcType;
|
||||
import net.sf.openrocket.motor.MotorConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.ParallelStage;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.InnerTube;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
|
||||
@ -543,7 +543,7 @@ public class ConfigurationTest extends BaseTestCase {
|
||||
|
||||
public static Rocket makeTwoStageMotorRocket() {
|
||||
Rocket rocket = makeTwoStageTestRocket();
|
||||
FlightConfigurationID fcid = rocket.getDefaultConfiguration().getId();
|
||||
FlightConfigurationId fcid = rocket.getDefaultConfiguration().getId();
|
||||
|
||||
{
|
||||
// public ThrustCurveMotor(Manufacturer manufacturer, String designation, String description,
|
||||
|
||||
@ -12,7 +12,7 @@ import javax.swing.event.ListDataListener;
|
||||
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurableParameter;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet;
|
||||
import net.sf.openrocket.util.StateChangeListener;
|
||||
|
||||
@ -29,7 +29,7 @@ public class ParameterSetModel<T extends FlightConfigurableParameter<T>> impleme
|
||||
|
||||
private Object selected;
|
||||
private final FlightConfigurableParameterSet<T> sourceSet;
|
||||
List<FlightConfigurationID> idList= new Vector<FlightConfigurationID>();
|
||||
List<FlightConfigurationId> idList= new Vector<FlightConfigurationId>();
|
||||
|
||||
public ParameterSetModel(FlightConfigurableParameterSet<T> set ) {
|
||||
this.sourceSet = set;
|
||||
@ -41,7 +41,7 @@ public class ParameterSetModel<T extends FlightConfigurableParameter<T>> impleme
|
||||
if((index < 0)||( index >= this.idList.size())){
|
||||
return sourceSet.getDefault();
|
||||
}
|
||||
FlightConfigurationID fcid = this.idList.get(index);
|
||||
FlightConfigurationId fcid = this.idList.get(index);
|
||||
return this.sourceSet.get( fcid);
|
||||
}
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ import net.sf.openrocket.gui.util.GUIUtil;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration.DeployEvent;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.RecoveryDevice;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
@ -48,7 +48,7 @@ public class DeploymentSelectionDialog extends JDialog {
|
||||
public DeploymentSelectionDialog(Window parent, final Rocket rocket, final RecoveryDevice component) {
|
||||
super(parent, trans.get("edtmotorconfdlg.title.Selectdeploymentconf"), Dialog.ModalityType.APPLICATION_MODAL);
|
||||
|
||||
final FlightConfigurationID id = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
final FlightConfigurationId id = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
|
||||
newConfiguration = component.getDeploymentConfigurations().get(id).clone();
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ import net.sf.openrocket.gui.adaptors.EnumModel;
|
||||
import net.sf.openrocket.gui.util.GUIUtil;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.motor.MotorConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.IgnitionEvent;
|
||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
@ -44,7 +44,7 @@ public class IgnitionSelectionDialog extends JDialog {
|
||||
private IgnitionEvent startIgnitionEvent;
|
||||
private double startIgnitionDelay;
|
||||
|
||||
public IgnitionSelectionDialog(Window parent, final FlightConfigurationID curFCID, MotorMount _mount) {
|
||||
public IgnitionSelectionDialog(Window parent, final FlightConfigurationId curFCID, MotorMount _mount) {
|
||||
super(parent, trans.get("edtmotorconfdlg.title.Selectignitionconf"), Dialog.ModalityType.APPLICATION_MODAL);
|
||||
curMount = _mount;
|
||||
curMotorInstance = curMount.getMotorInstance(curFCID);
|
||||
|
||||
@ -14,7 +14,7 @@ import javax.swing.JTextField;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import net.sf.openrocket.gui.util.GUIUtil;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
|
||||
@ -22,7 +22,7 @@ public class RenameConfigDialog extends JDialog {
|
||||
private static final long serialVersionUID = -5423008694485357248L;
|
||||
private static final Translator trans = Application.getTranslator();
|
||||
|
||||
public RenameConfigDialog(final Window parent, final Rocket rocket, final FlightConfigurationID fcid) {
|
||||
public RenameConfigDialog(final Window parent, final Rocket rocket, final FlightConfigurationId fcid) {
|
||||
super(parent, trans.get("RenameConfigDialog.title"), Dialog.ModalityType.APPLICATION_MODAL);
|
||||
|
||||
JPanel panel = new JPanel(new MigLayout("fill"));
|
||||
|
||||
@ -22,7 +22,7 @@ import net.sf.openrocket.gui.adaptors.EnumModel;
|
||||
import net.sf.openrocket.gui.util.GUIUtil;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.rocketcomponent.AxialStage;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration;
|
||||
@ -42,7 +42,7 @@ public class SeparationSelectionDialog extends JDialog {
|
||||
|
||||
public SeparationSelectionDialog(Window parent, final Rocket rocket, final AxialStage stage) {
|
||||
super(parent, trans.get("edtmotorconfdlg.title.Selectseparationconf"), Dialog.ModalityType.APPLICATION_MODAL);
|
||||
final FlightConfigurationID id = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
final FlightConfigurationId id = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
|
||||
newConfiguration = stage.getSeparationConfigurations().get(id);
|
||||
if( stage.getSeparationConfigurations().isDefault( newConfiguration )){
|
||||
|
||||
@ -17,7 +17,7 @@ import net.sf.openrocket.gui.dialogs.motor.thrustcurve.ThrustCurveMotorSelection
|
||||
import net.sf.openrocket.gui.util.GUIUtil;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.motor.Motor;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
|
||||
@ -30,7 +30,7 @@ public class MotorChooserDialog extends JDialog implements CloseableDialog {
|
||||
private boolean okClicked = false;
|
||||
private static final Translator trans = Application.getTranslator();
|
||||
|
||||
public MotorChooserDialog(MotorMount mount, FlightConfigurationID currentConfigID, Window owner) {
|
||||
public MotorChooserDialog(MotorMount mount, FlightConfigurationId currentConfigID, Window owner) {
|
||||
this(owner);
|
||||
setMotorMountAndConfig( currentConfigID, mount);
|
||||
}
|
||||
@ -84,7 +84,7 @@ public class MotorChooserDialog extends JDialog implements CloseableDialog {
|
||||
selectionPanel.setCloseableDialog(this);
|
||||
}
|
||||
|
||||
public void setMotorMountAndConfig( FlightConfigurationID _fcid, MotorMount _mount ) {
|
||||
public void setMotorMountAndConfig( FlightConfigurationId _fcid, MotorMount _mount ) {
|
||||
selectionPanel.setMotorMountAndConfig( _fcid, _mount );
|
||||
}
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ import net.sf.openrocket.motor.Manufacturer;
|
||||
import net.sf.openrocket.motor.Motor;
|
||||
import net.sf.openrocket.motor.MotorConfiguration;
|
||||
import net.sf.openrocket.motor.ThrustCurveMotor;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.util.BugException;
|
||||
@ -98,7 +98,7 @@ public class ThrustCurveMotorSelectionPanel extends JPanel implements MotorSelec
|
||||
private ThrustCurveMotorSet selectedMotorSet;
|
||||
private double selectedDelay;
|
||||
|
||||
public ThrustCurveMotorSelectionPanel( final FlightConfigurationID fcid, MotorMount mount ) {
|
||||
public ThrustCurveMotorSelectionPanel( final FlightConfigurationId fcid, MotorMount mount ) {
|
||||
this();
|
||||
setMotorMountAndConfig( fcid, mount );
|
||||
|
||||
@ -311,7 +311,7 @@ public class ThrustCurveMotorSelectionPanel extends JPanel implements MotorSelec
|
||||
|
||||
}
|
||||
|
||||
public void setMotorMountAndConfig( final FlightConfigurationID _fcid, MotorMount mountToEdit ) {
|
||||
public void setMotorMountAndConfig( final FlightConfigurationId _fcid, MotorMount mountToEdit ) {
|
||||
if ( null == _fcid ){
|
||||
throw new NullPointerException(" attempted to set mount with a null FCID. bug. ");
|
||||
}else if ( null == mountToEdit ){
|
||||
|
||||
@ -89,7 +89,7 @@ import net.sf.openrocket.optimization.rocketoptimization.goals.MinimizationGoal;
|
||||
import net.sf.openrocket.optimization.rocketoptimization.goals.ValueSeekGoal;
|
||||
import net.sf.openrocket.optimization.services.OptimizationServiceHelper;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
@ -954,14 +954,14 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
|
||||
for (Simulation s : documentCopy.getSimulations()) {
|
||||
//FlightConfigurationID id = s.getConfiguration().getFlightConfigurationID();
|
||||
FlightConfigurationID id = new FlightConfigurationID( "stub id value - General Optimizer");
|
||||
FlightConfigurationId id = new FlightConfigurationId( "stub id value - General Optimizer");
|
||||
|
||||
String name = createSimulationName(s.getName(), descriptor.format(rocket, id));
|
||||
simulations.add(new Named<Simulation>(s, name));
|
||||
}
|
||||
|
||||
for (FlightConfiguration config : rocket.getConfigSet()) {
|
||||
FlightConfigurationID fcid = config.getFlightConfigurationID();
|
||||
FlightConfigurationId fcid = config.getFlightConfigurationID();
|
||||
if ( fcid == null) {
|
||||
throw new NullPointerException(" flightconfiguration has a null id... bug.");
|
||||
}
|
||||
@ -1164,7 +1164,7 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
}
|
||||
|
||||
// Update the active configuration
|
||||
FlightConfigurationID fcid = getSelectedSimulation().getOptions().getId();
|
||||
FlightConfigurationId fcid = getSelectedSimulation().getOptions().getId();
|
||||
getSelectedSimulation().getRocket().setDefaultConfiguration(fcid);
|
||||
|
||||
updating = false;
|
||||
|
||||
@ -20,7 +20,7 @@ import net.sf.openrocket.gui.figure3d.geometry.Geometry.Surface;
|
||||
import net.sf.openrocket.motor.Motor;
|
||||
import net.sf.openrocket.motor.MotorConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
import net.sf.openrocket.util.Coordinate;
|
||||
@ -166,7 +166,7 @@ public abstract class RocketRenderer {
|
||||
}
|
||||
|
||||
private void renderMotors(GL2 gl, FlightConfiguration configuration) {
|
||||
FlightConfigurationID motorID = configuration.getFlightConfigurationID();
|
||||
FlightConfigurationId motorID = configuration.getFlightConfigurationID();
|
||||
|
||||
// for( RocketComponent comp : configuration.getActiveComponents()){
|
||||
// if( comp instanceof MotorMount){
|
||||
|
||||
@ -46,7 +46,7 @@ import net.sf.openrocket.gui.figure3d.photo.exhaust.FlameRenderer;
|
||||
import net.sf.openrocket.gui.main.Splash;
|
||||
import net.sf.openrocket.motor.Motor;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
@ -419,7 +419,7 @@ public class PhotoPanel extends JPanel implements GLEventListener {
|
||||
//final int currentStageNumber = configuration.getActiveStages()[configuration.getActiveStages().length-1];
|
||||
//final AxialStage currentStage = (AxialStage)configuration.getRocket().getChild( bottomStageNumber);
|
||||
|
||||
final FlightConfigurationID motorID = configuration.getFlightConfigurationID();
|
||||
final FlightConfigurationId motorID = configuration.getFlightConfigurationID();
|
||||
|
||||
|
||||
final Iterator<RocketComponent> iter = configuration.getActiveComponents().iterator();
|
||||
|
||||
@ -49,7 +49,7 @@ import net.sf.openrocket.gui.simulation.SimulationWarningDialog;
|
||||
import net.sf.openrocket.gui.util.Icons;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeListener;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
@ -341,7 +341,7 @@ public class SimulationPanel extends JPanel {
|
||||
}
|
||||
|
||||
Rocket rkt = document.getRocket();
|
||||
FlightConfigurationID fcid = document.getSimulation(row).getId();
|
||||
FlightConfigurationId fcid = document.getSimulation(row).getId();
|
||||
return descriptor.format( rkt, fcid);
|
||||
}
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ import net.sf.openrocket.formatting.RocketDescriptor;
|
||||
import net.sf.openrocket.gui.util.GUIUtil;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurableComponent;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.util.Pair;
|
||||
@ -64,8 +64,8 @@ public abstract class FlightConfigurablePanel<T extends FlightConfigurableCompon
|
||||
protected abstract void updateButtonState();
|
||||
|
||||
protected final void synchronizeConfigurationSelection() {
|
||||
FlightConfigurationID defaultFCID = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
FlightConfigurationID selectedFCID = getSelectedConfigurationId();
|
||||
FlightConfigurationId defaultFCID = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
FlightConfigurationId selectedFCID = getSelectedConfigurationId();
|
||||
|
||||
if ( selectedFCID == null ) {
|
||||
// need to unselect
|
||||
@ -78,9 +78,9 @@ public abstract class FlightConfigurablePanel<T extends FlightConfigurableCompon
|
||||
col = (table.getColumnCount() > 1) ? 1 : 0;
|
||||
}
|
||||
|
||||
java.util.List<FlightConfigurationID> ids = rocket.getSortedConfigurationIDs();
|
||||
java.util.List<FlightConfigurationId> ids = rocket.getSortedConfigurationIDs();
|
||||
for( int rowNum = 0; rowNum < table.getRowCount(); rowNum++ ) {
|
||||
FlightConfigurationID rowFCID = ids.get(rowNum );
|
||||
FlightConfigurationId rowFCID = ids.get(rowNum );
|
||||
if ( rowFCID.equals(selectedFCID) ) {
|
||||
table.changeSelection(rowNum, col, true, false);
|
||||
break;
|
||||
@ -146,7 +146,7 @@ public abstract class FlightConfigurablePanel<T extends FlightConfigurableCompon
|
||||
return null;
|
||||
}
|
||||
|
||||
protected FlightConfigurationID getSelectedConfigurationId() {
|
||||
protected FlightConfigurationId getSelectedConfigurationId() {
|
||||
int col = table.convertColumnIndexToModel(table.getSelectedColumn());
|
||||
int row = table.convertRowIndexToModel(table.getSelectedRow());
|
||||
if ( row < 0 || col < 0 || row >= table.getRowCount() || col >= table.getColumnCount() ) {
|
||||
@ -154,13 +154,13 @@ public abstract class FlightConfigurablePanel<T extends FlightConfigurableCompon
|
||||
}
|
||||
Object tableValue = table.getModel().getValueAt(row, col);
|
||||
if ( tableValue instanceof Pair ) {
|
||||
Pair<FlightConfigurationID,T> selectedComponent = (Pair<FlightConfigurationID,T>) tableValue;
|
||||
FlightConfigurationID fcid = selectedComponent.getU();
|
||||
Pair<FlightConfigurationId,T> selectedComponent = (Pair<FlightConfigurationId,T>) tableValue;
|
||||
FlightConfigurationId fcid = selectedComponent.getU();
|
||||
return fcid;
|
||||
} else if ( tableValue instanceof FlightConfigurationID ){
|
||||
return (FlightConfigurationID) tableValue;
|
||||
} else if ( tableValue instanceof FlightConfigurationId ){
|
||||
return (FlightConfigurationId) tableValue;
|
||||
}
|
||||
return FlightConfigurationID.ERROR_CONFIGURATION_FCID;
|
||||
return FlightConfigurationId.ERROR_CONFIGURATION_FCID;
|
||||
}
|
||||
|
||||
protected abstract class FlightConfigurableCellRenderer extends DefaultTableCellRenderer {
|
||||
@ -174,17 +174,17 @@ public abstract class FlightConfigurablePanel<T extends FlightConfigurableCompon
|
||||
column = table.convertColumnIndexToModel(column);
|
||||
switch (column) {
|
||||
case 0: {
|
||||
label.setText(descriptor.format(rocket, (FlightConfigurationID) value));
|
||||
label.setText(descriptor.format(rocket, (FlightConfigurationId) value));
|
||||
regular(label);
|
||||
setSelected(label, table, isSelected, hasFocus);
|
||||
return label;
|
||||
}
|
||||
default: {
|
||||
@SuppressWarnings("unchecked")
|
||||
Pair<FlightConfigurationID, T> v = (Pair<FlightConfigurationID, T>) value;
|
||||
Pair<FlightConfigurationId, T> v = (Pair<FlightConfigurationId, T>) value;
|
||||
|
||||
if(v!=null){
|
||||
FlightConfigurationID fcid = v.getU();
|
||||
FlightConfigurationId fcid = v.getU();
|
||||
T component = v.getV();
|
||||
label = format(component, fcid, label );
|
||||
}
|
||||
@ -224,7 +224,7 @@ public abstract class FlightConfigurablePanel<T extends FlightConfigurableCompon
|
||||
label.setForeground(Color.BLACK);
|
||||
}
|
||||
|
||||
protected abstract JLabel format( T component, FlightConfigurationID configId, JLabel label );
|
||||
protected abstract JLabel format( T component, FlightConfigurationId configId, JLabel label );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeListener;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurableComponent;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
@ -25,7 +25,7 @@ public class FlightConfigurableTableModel<T extends FlightConfigurableComponent>
|
||||
protected final Rocket rocket;
|
||||
protected final Class<T> clazz;
|
||||
private final List<T> components = new ArrayList<T>();
|
||||
private List<FlightConfigurationID> ids = new Vector<FlightConfigurationID>();
|
||||
private List<FlightConfigurationId> ids = new Vector<FlightConfigurationId>();
|
||||
|
||||
public FlightConfigurableTableModel(Class<T> clazz, Rocket rocket) {
|
||||
super();
|
||||
@ -75,7 +75,7 @@ public class FlightConfigurableTableModel<T extends FlightConfigurableComponent>
|
||||
|
||||
@Override
|
||||
public Object getValueAt(int row, int column) {
|
||||
FlightConfigurationID fcid = getConfigurationID(row);
|
||||
FlightConfigurationId fcid = getConfigurationID(row);
|
||||
|
||||
switch (column) {
|
||||
case 0: {
|
||||
@ -84,7 +84,7 @@ public class FlightConfigurableTableModel<T extends FlightConfigurableComponent>
|
||||
default: {
|
||||
int index = column - 1;
|
||||
T d = components.get(index);
|
||||
return new Pair<FlightConfigurationID, T>(fcid, d);
|
||||
return new Pair<FlightConfigurationId, T>(fcid, d);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -104,7 +104,7 @@ public class FlightConfigurableTableModel<T extends FlightConfigurableComponent>
|
||||
}
|
||||
}
|
||||
|
||||
private FlightConfigurationID getConfigurationID(int rowNum) {
|
||||
private FlightConfigurationId getConfigurationID(int rowNum) {
|
||||
if( rocket.getConfigurationCount() != (ids.size() ) ){
|
||||
this.ids = rocket.getSortedConfigurationIDs();
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ import net.sf.openrocket.gui.main.BasicFrame;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurableComponent;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.RecoveryDevice;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
@ -123,7 +123,7 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe
|
||||
}
|
||||
|
||||
private void addConfiguration() {
|
||||
FlightConfigurationID newFCID = new FlightConfigurationID();
|
||||
FlightConfigurationId newFCID = new FlightConfigurationId();
|
||||
FlightConfiguration newConfig = new FlightConfiguration( rocket, newFCID );
|
||||
|
||||
rocket.setFlightConfiguration(newFCID, newConfig);
|
||||
@ -137,8 +137,8 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe
|
||||
private void copyConfiguration() {
|
||||
FlightConfiguration oldConfig = rocket.getDefaultConfiguration();
|
||||
FlightConfiguration newConfig = oldConfig.clone();
|
||||
FlightConfigurationID oldId = oldConfig.getFlightConfigurationID();
|
||||
FlightConfigurationID newId = newConfig.getFlightConfigurationID();
|
||||
FlightConfigurationId oldId = oldConfig.getFlightConfigurationID();
|
||||
FlightConfigurationId newId = newConfig.getFlightConfigurationID();
|
||||
|
||||
for (RocketComponent c : rocket) {
|
||||
if (c instanceof FlightConfigurableComponent) {
|
||||
@ -155,12 +155,12 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe
|
||||
}
|
||||
|
||||
private void renameConfiguration() {
|
||||
FlightConfigurationID currentId = this.motorConfigurationPanel.getSelectedConfigurationId();
|
||||
FlightConfigurationId currentId = this.motorConfigurationPanel.getSelectedConfigurationId();
|
||||
new RenameConfigDialog(SwingUtilities.getWindowAncestor(this), rocket, currentId).setVisible(true);
|
||||
}
|
||||
|
||||
private void removeConfiguration() {
|
||||
FlightConfigurationID currentId = this.motorConfigurationPanel.getSelectedConfigurationId();
|
||||
FlightConfigurationId currentId = this.motorConfigurationPanel.getSelectedConfigurationId();
|
||||
if (currentId == null)
|
||||
return;
|
||||
document.removeFlightConfigurationAndSimulations(currentId);
|
||||
@ -185,7 +185,7 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe
|
||||
}
|
||||
|
||||
private void updateButtonState() {
|
||||
FlightConfigurationID currentId = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
FlightConfigurationId currentId = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
// Enable the remove/rename/copy buttons only when a configuration is selected.
|
||||
removeConfButton.setEnabled(currentId.isValid());
|
||||
renameConfButton.setEnabled(currentId.isValid());
|
||||
|
||||
@ -27,7 +27,7 @@ import net.sf.openrocket.gui.dialogs.flightconfiguration.MotorMountConfiguration
|
||||
import net.sf.openrocket.gui.dialogs.motor.MotorChooserDialog;
|
||||
import net.sf.openrocket.motor.Motor;
|
||||
import net.sf.openrocket.motor.MotorConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.IgnitionEvent;
|
||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
@ -199,7 +199,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
||||
|
||||
private void selectMotor() {
|
||||
MotorMount curMount = getSelectedComponent();
|
||||
FlightConfigurationID fcid= getSelectedConfigurationId();
|
||||
FlightConfigurationId fcid= getSelectedConfigurationId();
|
||||
if ( (null == fcid )||( null == curMount )){
|
||||
return;
|
||||
}
|
||||
@ -226,7 +226,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
||||
|
||||
private void removeMotor() {
|
||||
MotorMount curMount = getSelectedComponent();
|
||||
FlightConfigurationID fcid= getSelectedConfigurationId();
|
||||
FlightConfigurationId fcid= getSelectedConfigurationId();
|
||||
if ( (null == fcid )||( null == curMount )){
|
||||
return;
|
||||
}
|
||||
@ -238,7 +238,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
||||
|
||||
private void selectIgnition() {
|
||||
MotorMount curMount = getSelectedComponent();
|
||||
FlightConfigurationID fcid= getSelectedConfigurationId();
|
||||
FlightConfigurationId fcid= getSelectedConfigurationId();
|
||||
if ( (null == fcid )||( null == curMount )){
|
||||
return;
|
||||
}
|
||||
@ -256,7 +256,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
||||
|
||||
private void resetIgnition() {
|
||||
MotorMount curMount = getSelectedComponent();
|
||||
FlightConfigurationID fcid= getSelectedConfigurationId();
|
||||
FlightConfigurationId fcid= getSelectedConfigurationId();
|
||||
if ( (null == fcid )||( null == curMount )){
|
||||
return;
|
||||
}
|
||||
@ -272,7 +272,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
||||
private static final long serialVersionUID = -7462331042920067984L;
|
||||
|
||||
@Override
|
||||
protected JLabel format( MotorMount mount, FlightConfigurationID configId, JLabel l ) {
|
||||
protected JLabel format( MotorMount mount, FlightConfigurationId configId, JLabel l ) {
|
||||
JLabel label = new JLabel();
|
||||
label.setLayout(new BoxLayout(label, BoxLayout.X_AXIS));
|
||||
|
||||
@ -307,7 +307,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
||||
return str;
|
||||
}
|
||||
|
||||
private JLabel getIgnitionEventString(FlightConfigurationID id, MotorMount mount) {
|
||||
private JLabel getIgnitionEventString(FlightConfigurationId id, MotorMount mount) {
|
||||
MotorConfiguration defInstance = mount.getDefaultMotorInstance();
|
||||
MotorConfiguration curInstance = mount.getMotorInstance(id);
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ import net.sf.openrocket.gui.dialogs.flightconfiguration.DeploymentSelectionDial
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration.DeployEvent;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.RecoveryDevice;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
@ -102,7 +102,7 @@ public class RecoveryConfigurationPanel extends FlightConfigurablePanel<Recovery
|
||||
if (c == null) {
|
||||
return;
|
||||
}
|
||||
FlightConfigurationID id = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
FlightConfigurationId id = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
c.getDeploymentConfigurations().reset(id);
|
||||
fireTableDataChanged();
|
||||
}
|
||||
@ -116,7 +116,7 @@ public class RecoveryConfigurationPanel extends FlightConfigurablePanel<Recovery
|
||||
class RecoveryTableCellRenderer extends FlightConfigurablePanel<RecoveryDevice>.FlightConfigurableCellRenderer {
|
||||
|
||||
@Override
|
||||
protected JLabel format(RecoveryDevice recovery, FlightConfigurationID configId, JLabel label) {
|
||||
protected JLabel format(RecoveryDevice recovery, FlightConfigurationId configId, JLabel label) {
|
||||
DeploymentConfiguration deployConfig = recovery.getDeploymentConfigurations().get(configId);
|
||||
String spec = getDeploymentSpecification(deployConfig);
|
||||
label.setText(spec);
|
||||
|
||||
@ -17,7 +17,7 @@ import net.sf.openrocket.formatting.RocketDescriptor;
|
||||
import net.sf.openrocket.gui.dialogs.flightconfiguration.SeparationSelectionDialog;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.rocketcomponent.AxialStage;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
@ -111,7 +111,7 @@ public class SeparationConfigurationPanel extends FlightConfigurablePanel<AxialS
|
||||
}
|
||||
|
||||
// why?
|
||||
FlightConfigurationID id = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
FlightConfigurationId id = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
stage.getSeparationConfigurations().reset(id);
|
||||
|
||||
fireTableDataChanged();
|
||||
@ -126,7 +126,7 @@ public class SeparationConfigurationPanel extends FlightConfigurablePanel<AxialS
|
||||
private static final long serialVersionUID = -7066580803931938686L;
|
||||
|
||||
@Override
|
||||
protected JLabel format(AxialStage stage, FlightConfigurationID configId, JLabel label) {
|
||||
protected JLabel format(AxialStage stage, FlightConfigurationId configId, JLabel label) {
|
||||
StageSeparationConfiguration sepConfig = stage.getSeparationConfigurations().get(configId);
|
||||
String spec = getSeparationSpecification(sepConfig);
|
||||
label.setText(spec);
|
||||
|
||||
@ -32,7 +32,7 @@ import net.sf.openrocket.masscalc.MassCalculator.MassCalcType;
|
||||
import net.sf.openrocket.motor.Motor;
|
||||
import net.sf.openrocket.rocketcomponent.AxialStage;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
@ -226,7 +226,7 @@ public class DesignReport {
|
||||
|
||||
int motorNumber = 0;
|
||||
for( FlightConfiguration curConfig : rocket.getConfigSet()){
|
||||
FlightConfigurationID fcid = curConfig.getFlightConfigurationID();
|
||||
FlightConfigurationId fcid = curConfig.getFlightConfigurationID();
|
||||
|
||||
PdfPTable parent = new PdfPTable(2);
|
||||
parent.setWidthPercentage(100);
|
||||
@ -308,7 +308,7 @@ public class DesignReport {
|
||||
* @param motorId the motor ID to output
|
||||
* @param parent the parent to which the motor data will be added
|
||||
*/
|
||||
private void addMotorData(Rocket rocket, FlightConfigurationID motorId, final PdfPTable parent) {
|
||||
private void addMotorData(Rocket rocket, FlightConfigurationId motorId, final PdfPTable parent) {
|
||||
|
||||
PdfPTable motorTable = new PdfPTable(8);
|
||||
motorTable.setWidthPercentage(68);
|
||||
@ -443,7 +443,7 @@ public class DesignReport {
|
||||
* @param parent the parent to which the simulation flight data will be added
|
||||
* @param leading the number of points for the leading
|
||||
*/
|
||||
private void addFlightData(final FlightData flight, final Rocket theRocket, final FlightConfigurationID motorId, final PdfPTable parent, int leading) {
|
||||
private void addFlightData(final FlightData flight, final Rocket theRocket, final FlightConfigurationId motorId, final PdfPTable parent, int leading) {
|
||||
|
||||
// Output the flight data
|
||||
if (flight != null) {
|
||||
@ -509,7 +509,7 @@ public class DesignReport {
|
||||
*
|
||||
* @return the flight data from the simulation for the specified motor id, or null if not found
|
||||
*/
|
||||
private FlightData findSimulation(final FlightConfigurationID motorId, List<Simulation> simulations) {
|
||||
private FlightData findSimulation(final FlightConfigurationId motorId, List<Simulation> simulations) {
|
||||
// Perform flight simulation
|
||||
FlightData flight = null;
|
||||
try {
|
||||
|
||||
@ -58,7 +58,7 @@ import net.sf.openrocket.masscalc.MassCalculator.MassCalcType;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
|
||||
import net.sf.openrocket.rocketcomponent.ComponentChangeListener;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
import net.sf.openrocket.rocketcomponent.SymmetricComponent;
|
||||
@ -141,7 +141,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
||||
|
||||
// The functional ID of the rocket that was simulated
|
||||
private int flightDataFunctionalID = -1;
|
||||
private FlightConfigurationID flightDataMotorID = null;
|
||||
private FlightConfigurationId flightDataMotorID = null;
|
||||
|
||||
private SimulationWorker backgroundSimulationWorker = null;
|
||||
|
||||
@ -316,7 +316,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
||||
Object source = ae.getSource();
|
||||
if( source instanceof JComboBox ){
|
||||
@SuppressWarnings("unchecked")
|
||||
JComboBox<FlightConfigurationID> box = (JComboBox<FlightConfigurationID>) source;
|
||||
JComboBox<FlightConfigurationId> box = (JComboBox<FlightConfigurationId>) source;
|
||||
FlightConfiguration newConfig = (FlightConfiguration)box.getSelectedItem();
|
||||
document.getRocket().getConfigSet().setDefault( newConfig);
|
||||
updateExtras();
|
||||
|
||||
@ -25,7 +25,7 @@ import net.sf.openrocket.gui.adaptors.ParameterSetModel;
|
||||
import net.sf.openrocket.gui.util.GUIUtil;
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationID;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.simulation.SimulationOptions;
|
||||
import net.sf.openrocket.simulation.extension.SimulationExtension;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
@ -160,7 +160,7 @@ public class SimulationEditDialog extends JDialog {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
FlightConfiguration config = (FlightConfiguration) configCombo.getSelectedItem();
|
||||
FlightConfigurationID id = config.getFlightConfigurationID();
|
||||
FlightConfigurationId id = config.getFlightConfigurationID();
|
||||
conditions.setFlightConfigurationId( id );
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user