Major renaming of methods and members changing "MotorConfig" to
"FlightConfig".
This commit is contained in:
parent
6e66aeac31
commit
a094b30c1d
@ -544,7 +544,7 @@ public class OpenRocketDocument implements ComponentChangeListener {
|
||||
public OpenRocketDocument copy() {
|
||||
Rocket rocketCopy = rocket.copyWithOriginalID();
|
||||
OpenRocketDocument documentCopy = new OpenRocketDocument(rocketCopy);
|
||||
documentCopy.getDefaultConfiguration().setMotorConfigurationID(configuration.getMotorConfigurationID());
|
||||
documentCopy.getDefaultConfiguration().setFlightConfigurationID(configuration.getFlightConfigurationID());
|
||||
for (Simulation s : simulations) {
|
||||
documentCopy.addSimulation(s.duplicateSimulation(rocketCopy));
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ public class Simulation implements ChangeSource, Cloneable {
|
||||
|
||||
options = new SimulationOptions(rocket);
|
||||
options.setMotorConfigurationID(
|
||||
rocket.getDefaultConfiguration().getMotorConfigurationID());
|
||||
rocket.getDefaultConfiguration().getFlightConfigurationID());
|
||||
options.addChangeListener(new ConditionListener());
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ public class Simulation implements ChangeSource, Cloneable {
|
||||
public Configuration getConfiguration() {
|
||||
mutex.verify();
|
||||
Configuration c = new Configuration(rocket);
|
||||
c.setMotorConfigurationID(options.getMotorConfigurationID());
|
||||
c.setFlightConfigurationID(options.getMotorConfigurationID());
|
||||
c.setAllStages();
|
||||
return c;
|
||||
}
|
||||
@ -304,7 +304,7 @@ public class Simulation implements ChangeSource, Cloneable {
|
||||
// Set simulated info after simulation, will not be set in case of exception
|
||||
simulatedConditions = options.clone();
|
||||
final Configuration configuration = getConfiguration();
|
||||
simulatedMotors = configuration.getMotorConfigurationDescription();
|
||||
simulatedMotors = configuration.getFlightConfigurationDescription();
|
||||
simulatedRocketID = rocket.getFunctionalModID();
|
||||
|
||||
status = Status.UPTODATE;
|
||||
@ -349,7 +349,7 @@ public class Simulation implements ChangeSource, Cloneable {
|
||||
*
|
||||
* @return a description of the motor configuration of the previous simulation, or
|
||||
* <code>null</code>.
|
||||
* @see Rocket#getMotorConfigurationNameOrDescription(String)
|
||||
* @see Rocket#getFlightConfigurationNameOrDescription(String)
|
||||
*/
|
||||
public String getSimulatedMotorDescription() {
|
||||
mutex.verify();
|
||||
|
||||
@ -272,7 +272,7 @@ public class OpenRocketSaver extends RocketSaver {
|
||||
continue;
|
||||
|
||||
MotorMount mount = (MotorMount) c;
|
||||
for (String id : document.getRocket().getMotorConfigurationIDs()) {
|
||||
for (String id : document.getRocket().getFlightConfigurationIDs()) {
|
||||
if (mount.getMotor(id) != null) {
|
||||
return FILE_VERSION_DIVISOR + 4;
|
||||
}
|
||||
|
||||
@ -1113,11 +1113,11 @@ class MotorConfigurationHandler extends AbstractElementHandler {
|
||||
}
|
||||
|
||||
if (name != null && name.trim().length() > 0) {
|
||||
rocket.setMotorConfigurationName(configid, name);
|
||||
rocket.setFlightConfigurationName(configid, name);
|
||||
}
|
||||
|
||||
if ("true".equals(attributes.remove("default"))) {
|
||||
rocket.getDefaultConfiguration().setMotorConfigurationID(configid);
|
||||
rocket.getDefaultConfiguration().setFlightConfigurationID(configid);
|
||||
}
|
||||
|
||||
super.closeElement(element, attributes, content, warnings);
|
||||
|
||||
@ -121,7 +121,7 @@ public class RocketComponentSaver {
|
||||
if (!mount.isMotorMount())
|
||||
return Collections.emptyList();
|
||||
|
||||
String[] motorConfigIDs = ((RocketComponent) mount).getRocket().getMotorConfigurationIDs();
|
||||
String[] motorConfigIDs = ((RocketComponent) mount).getRocket().getFlightConfigurationIDs();
|
||||
List<String> elements = new ArrayList<String>();
|
||||
|
||||
elements.add("<motormount>");
|
||||
|
||||
@ -40,8 +40,8 @@ public class RocketSaver extends RocketComponentSaver {
|
||||
|
||||
|
||||
// Motor configurations
|
||||
String defId = rocket.getDefaultConfiguration().getMotorConfigurationID();
|
||||
for (String id : rocket.getMotorConfigurationIDs()) {
|
||||
String defId = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
for (String id : rocket.getFlightConfigurationIDs()) {
|
||||
if (id == null)
|
||||
continue;
|
||||
|
||||
@ -49,10 +49,10 @@ public class RocketSaver extends RocketComponentSaver {
|
||||
if (id.equals(defId))
|
||||
str += " default=\"true\"";
|
||||
|
||||
if (rocket.getMotorConfigurationName(id) == "") {
|
||||
if (rocket.getFlightConfigurationName(id) == "") {
|
||||
str += "/>";
|
||||
} else {
|
||||
str += "><name>" + net.sf.openrocket.file.RocketSaver.escapeXML(rocket.getMotorConfigurationName(id))
|
||||
str += "><name>" + net.sf.openrocket.file.RocketSaver.escapeXML(rocket.getFlightConfigurationName(id))
|
||||
+ "</name></motorconfiguration>";
|
||||
}
|
||||
elements.add(str);
|
||||
|
||||
@ -20,7 +20,7 @@ import net.sf.openrocket.rocketcomponent.Rocket;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.util.StateChangeListener;
|
||||
|
||||
public class MotorConfigurationModel implements ComboBoxModel, StateChangeListener {
|
||||
public class FlightConfigurationModel implements ComboBoxModel, StateChangeListener {
|
||||
private static final Translator trans = Application.getTranslator();
|
||||
|
||||
private static final String EDIT = trans.get("MotorCfgModel.Editcfg");
|
||||
@ -34,7 +34,7 @@ public class MotorConfigurationModel implements ComboBoxModel, StateChangeListen
|
||||
private Map<String, ID> map = new HashMap<String, ID>();
|
||||
|
||||
|
||||
public MotorConfigurationModel(Configuration config) {
|
||||
public FlightConfigurationModel(Configuration config) {
|
||||
this.config = config;
|
||||
this.rocket = config.getRocket();
|
||||
config.addChangeListener(this);
|
||||
@ -44,7 +44,7 @@ public class MotorConfigurationModel implements ComboBoxModel, StateChangeListen
|
||||
|
||||
@Override
|
||||
public Object getElementAt(int index) {
|
||||
String[] ids = rocket.getMotorConfigurationIDs();
|
||||
String[] ids = rocket.getFlightConfigurationIDs();
|
||||
if (index < 0 || index > ids.length)
|
||||
return null;
|
||||
|
||||
@ -56,12 +56,12 @@ public class MotorConfigurationModel implements ComboBoxModel, StateChangeListen
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
return rocket.getMotorConfigurationIDs().length + 1;
|
||||
return rocket.getFlightConfigurationIDs().length + 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getSelectedItem() {
|
||||
return get(config.getMotorConfigurationID());
|
||||
return get(config.getFlightConfigurationID());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -88,7 +88,7 @@ public class MotorConfigurationModel implements ComboBoxModel, StateChangeListen
|
||||
}
|
||||
|
||||
ID idObject = (ID) item;
|
||||
config.setMotorConfigurationID(idObject.getID());
|
||||
config.setFlightConfigurationID(idObject.getID());
|
||||
}
|
||||
|
||||
|
||||
@ -162,7 +162,7 @@ public class MotorConfigurationModel implements ComboBoxModel, StateChangeListen
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return rocket.getMotorConfigurationNameOrDescription(id);
|
||||
return rocket.getFlightConfigurationNameOrDescription(id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ import net.sf.openrocket.gui.SpinnerEditor;
|
||||
import net.sf.openrocket.gui.adaptors.BooleanModel;
|
||||
import net.sf.openrocket.gui.adaptors.DoubleModel;
|
||||
import net.sf.openrocket.gui.adaptors.EnumModel;
|
||||
import net.sf.openrocket.gui.adaptors.MotorConfigurationModel;
|
||||
import net.sf.openrocket.gui.adaptors.FlightConfigurationModel;
|
||||
import net.sf.openrocket.gui.components.BasicSlider;
|
||||
import net.sf.openrocket.gui.components.StyledLabel;
|
||||
import net.sf.openrocket.gui.components.UnitSelector;
|
||||
@ -71,7 +71,7 @@ public class MotorConfig extends JPanel {
|
||||
//// Motor configuration:
|
||||
panel.add(new JLabel(trans.get("MotorCfg.lbl.Motorcfg")), "shrink");
|
||||
|
||||
JComboBox combo = new JComboBox(new MotorConfigurationModel(configuration));
|
||||
JComboBox combo = new JComboBox(new FlightConfigurationModel(configuration));
|
||||
panel.add(combo, "growx");
|
||||
|
||||
configuration.addChangeListener(new ChangeListener() {
|
||||
@ -86,8 +86,8 @@ public class MotorConfig extends JPanel {
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
String id = rocket.newMotorConfigurationID();
|
||||
configuration.setMotorConfigurationID(id);
|
||||
String id = rocket.newFlightConfigurationID();
|
||||
configuration.setFlightConfigurationID(id);
|
||||
}
|
||||
});
|
||||
panel.add(button, "wrap unrel");
|
||||
@ -166,7 +166,7 @@ public class MotorConfig extends JPanel {
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
String id = configuration.getMotorConfigurationID();
|
||||
String id = configuration.getFlightConfigurationID();
|
||||
|
||||
MotorChooserDialog dialog = new MotorChooserDialog(mount.getMotor(id),
|
||||
mount.getMotorDelay(id), mount.getMotorMountDiameter(),
|
||||
@ -177,8 +177,8 @@ public class MotorConfig extends JPanel {
|
||||
|
||||
if (m != null) {
|
||||
if (id == null) {
|
||||
id = rocket.newMotorConfigurationID();
|
||||
configuration.setMotorConfigurationID(id);
|
||||
id = rocket.newFlightConfigurationID();
|
||||
configuration.setFlightConfigurationID(id);
|
||||
}
|
||||
mount.setMotor(id, m);
|
||||
mount.setMotorDelay(id, d);
|
||||
@ -193,7 +193,7 @@ public class MotorConfig extends JPanel {
|
||||
button.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
mount.setMotor(configuration.getMotorConfigurationID(), null);
|
||||
mount.setMotor(configuration.getFlightConfigurationID(), null);
|
||||
updateFields();
|
||||
}
|
||||
});
|
||||
@ -216,7 +216,7 @@ public class MotorConfig extends JPanel {
|
||||
}
|
||||
|
||||
public void updateFields() {
|
||||
String id = configuration.getMotorConfigurationID();
|
||||
String id = configuration.getFlightConfigurationID();
|
||||
Motor m = mount.getMotor(id);
|
||||
if (m == null) {
|
||||
//// None
|
||||
|
||||
@ -44,7 +44,7 @@ import net.sf.openrocket.aerodynamics.WarningSet;
|
||||
import net.sf.openrocket.gui.adaptors.Column;
|
||||
import net.sf.openrocket.gui.adaptors.ColumnTableModel;
|
||||
import net.sf.openrocket.gui.adaptors.DoubleModel;
|
||||
import net.sf.openrocket.gui.adaptors.MotorConfigurationModel;
|
||||
import net.sf.openrocket.gui.adaptors.FlightConfigurationModel;
|
||||
import net.sf.openrocket.gui.components.BasicSlider;
|
||||
import net.sf.openrocket.gui.components.StageSelector;
|
||||
import net.sf.openrocket.gui.components.StyledLabel;
|
||||
@ -174,7 +174,7 @@ public class ComponentAnalysisDialog extends JDialog implements ChangeListener {
|
||||
JLabel label = new JLabel(trans.get("componentanalysisdlg.lbl.motorconf"));
|
||||
label.setHorizontalAlignment(JLabel.RIGHT);
|
||||
panel.add(label, "growx, right");
|
||||
panel.add(new JComboBox(new MotorConfigurationModel(configuration)), "wrap");
|
||||
panel.add(new JComboBox(new FlightConfigurationModel(configuration)), "wrap");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ public class FlightConfigurationDialog extends JDialog {
|
||||
//// Edit motor configurations
|
||||
super(parent, trans.get("edtmotorconfdlg.title.Editmotorconf"));
|
||||
|
||||
currentID = rocket.getDefaultConfiguration().getMotorConfigurationID();
|
||||
currentID = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
|
||||
if (parent != null)
|
||||
this.setModalityType(ModalityType.DOCUMENT_MODAL);
|
||||
@ -145,15 +145,15 @@ public class FlightConfigurationDialog extends JDialog {
|
||||
|
||||
public void selectConfiguration( String id ) {
|
||||
currentID = id;
|
||||
rocket.getDefaultConfiguration().setMotorConfigurationID(currentID);
|
||||
rocket.getDefaultConfiguration().setFlightConfigurationID(currentID);
|
||||
motorConfigurationPanel.fireTableDataChanged();
|
||||
// FIXME - update data in recovery configuration panel
|
||||
updateButtonState();
|
||||
}
|
||||
|
||||
public void addConfiguration() {
|
||||
currentID = rocket.newMotorConfigurationID();
|
||||
rocket.getDefaultConfiguration().setMotorConfigurationID(currentID);
|
||||
currentID = rocket.newFlightConfigurationID();
|
||||
rocket.getDefaultConfiguration().setFlightConfigurationID(currentID);
|
||||
motorConfigurationPanel.fireTableDataChanged();
|
||||
// FIXME - update data in recovery configuration panel
|
||||
flightConfigurationModel.fireContentsUpdated();
|
||||
@ -161,7 +161,7 @@ public class FlightConfigurationDialog extends JDialog {
|
||||
}
|
||||
|
||||
public void changeConfigurationName( String newName ) {
|
||||
rocket.setMotorConfigurationName(currentID, newName);
|
||||
rocket.setFlightConfigurationName(currentID, newName);
|
||||
motorConfigurationPanel.fireTableDataChanged();
|
||||
// FIXME - update data in recovery configuration panel
|
||||
flightConfigurationModel.fireContentsUpdated();
|
||||
@ -170,8 +170,8 @@ public class FlightConfigurationDialog extends JDialog {
|
||||
public void removeConfiguration() {
|
||||
if (currentID == null)
|
||||
return;
|
||||
rocket.removeMotorConfigurationID(currentID);
|
||||
rocket.getDefaultConfiguration().setMotorConfigurationID(null);
|
||||
rocket.removeFlightConfigurationID(currentID);
|
||||
rocket.getDefaultConfiguration().setFlightConfigurationID(null);
|
||||
motorConfigurationPanel.fireTableDataChanged();
|
||||
// FIXME - update data in recovery configuration panel
|
||||
flightConfigurationModel.fireContentsUpdated();
|
||||
|
||||
@ -24,12 +24,12 @@ public class FlightConfigurationModel extends DefaultComboBoxModel {
|
||||
}
|
||||
|
||||
void fireContentsUpdated() {
|
||||
fireContentsChanged(this, 0, rocket.getMotorConfigurationIDs().length);
|
||||
fireContentsChanged(this, 0, rocket.getFlightConfigurationIDs().length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getElementAt(int index) {
|
||||
String[] ids = rocket.getMotorConfigurationIDs();
|
||||
String[] ids = rocket.getFlightConfigurationIDs();
|
||||
if (index < 0 || index >= ids.length)
|
||||
return null;
|
||||
|
||||
@ -38,12 +38,12 @@ public class FlightConfigurationModel extends DefaultComboBoxModel {
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
return rocket.getMotorConfigurationIDs().length;
|
||||
return rocket.getFlightConfigurationIDs().length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getSelectedItem() {
|
||||
return get(config.getMotorConfigurationID());
|
||||
return get(config.getFlightConfigurationID());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -90,7 +90,7 @@ public class FlightConfigurationModel extends DefaultComboBoxModel {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return rocket.getMotorConfigurationNameOrDescription(id);
|
||||
return rocket.getFlightConfigurationNameOrDescription(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -139,14 +139,14 @@ public class MotorConfigurationPanel extends JPanel {
|
||||
}
|
||||
|
||||
public void updateButtonState() {
|
||||
String currentID = rocket.getDefaultConfiguration().getMotorConfigurationID();
|
||||
String currentID = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
selectMotorButton.setEnabled(currentMount != null && currentID != null);
|
||||
removeMotorButton.setEnabled(currentMount != null && currentID != null);
|
||||
}
|
||||
|
||||
|
||||
private void selectMotor() {
|
||||
String currentID = rocket.getDefaultConfiguration().getMotorConfigurationID();
|
||||
String currentID = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
if (currentID == null || currentMount == null)
|
||||
return;
|
||||
|
||||
@ -170,7 +170,7 @@ public class MotorConfigurationPanel extends JPanel {
|
||||
}
|
||||
|
||||
private void removeMotor() {
|
||||
String currentID = rocket.getDefaultConfiguration().getMotorConfigurationID();
|
||||
String currentID = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
if (currentID == null || currentMount == null)
|
||||
return;
|
||||
|
||||
@ -217,7 +217,7 @@ public class MotorConfigurationPanel extends JPanel {
|
||||
}
|
||||
|
||||
public String findMotorForDisplay( int column ) {
|
||||
String currentID = rocket.getDefaultConfiguration().getMotorConfigurationID();
|
||||
String currentID = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
MotorMount mount = findMount(column);
|
||||
Motor motor = mount.getMotor(currentID);
|
||||
if (motor == null)
|
||||
@ -232,7 +232,7 @@ public class MotorConfigurationPanel extends JPanel {
|
||||
}
|
||||
|
||||
public String findIgnitionForDisplay( int column ) {
|
||||
String currentID = rocket.getDefaultConfiguration().getMotorConfigurationID();
|
||||
String currentID = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
MotorMount mount = findMount(column);
|
||||
Motor motor = mount.getMotor(currentID);
|
||||
if (motor == null)
|
||||
|
||||
@ -95,7 +95,7 @@ public class RecoveryConfigurationPanel extends JPanel {
|
||||
}
|
||||
|
||||
private void resetDeployment() {
|
||||
selectedComponent.setDeploymentConfiguration(rocket.getDefaultConfiguration().getMotorConfigurationID(), null);
|
||||
selectedComponent.setDeploymentConfiguration(rocket.getDefaultConfiguration().getFlightConfigurationID(), null);
|
||||
}
|
||||
|
||||
private void updateButtonState() {
|
||||
@ -144,7 +144,7 @@ public class RecoveryConfigurationPanel extends JPanel {
|
||||
case 0:
|
||||
return d.getName();
|
||||
case 1:
|
||||
DeploymentConfiguration deployConfig = d.getDeploymentConfiguration(rocket.getDefaultConfiguration().getMotorConfigurationID());
|
||||
DeploymentConfiguration deployConfig = d.getDeploymentConfiguration(rocket.getDefaultConfiguration().getFlightConfigurationID());
|
||||
if ( deployConfig == null ) {
|
||||
return "[" + d.getDefaultDeploymentConfiguration().toString() + "]";
|
||||
} else {
|
||||
|
||||
@ -21,7 +21,7 @@ public class RenameConfigDialog extends JDialog {
|
||||
|
||||
JPanel panel = new JPanel(new MigLayout("fill"));
|
||||
|
||||
final JTextArea textbox = new JTextArea( config.getMotorConfigurationDescription() );
|
||||
final JTextArea textbox = new JTextArea( config.getFlightConfigurationDescription() );
|
||||
panel.add(textbox, "span, w 200lp, wrap");
|
||||
|
||||
JButton okButton = new JButton("Ok");
|
||||
|
||||
@ -31,7 +31,7 @@ public class SelectDeploymentConfigDialog extends JDialog {
|
||||
SelectDeploymentConfigDialog( JDialog parent, final Rocket rocket, final RecoveryDevice component ) {
|
||||
super(parent);
|
||||
super.setModal(true);
|
||||
final String configId = rocket.getDefaultConfiguration().getMotorConfigurationID();
|
||||
final String configId = rocket.getDefaultConfiguration().getFlightConfigurationID();
|
||||
|
||||
newConfiguration = component.getDeploymentConfiguration(configId);
|
||||
if ( newConfiguration == null ) {
|
||||
|
||||
@ -991,25 +991,25 @@ public class GeneralOptimizationDialog extends JDialog {
|
||||
Rocket rocket = documentCopy.getRocket();
|
||||
|
||||
for (Simulation s : documentCopy.getSimulations()) {
|
||||
String id = s.getConfiguration().getMotorConfigurationID();
|
||||
String name = createSimulationName(s.getName(), rocket.getMotorConfigurationNameOrDescription(id));
|
||||
String id = s.getConfiguration().getFlightConfigurationID();
|
||||
String name = createSimulationName(s.getName(), rocket.getFlightConfigurationNameOrDescription(id));
|
||||
simulations.add(new Named<Simulation>(s, name));
|
||||
}
|
||||
|
||||
for (String id : rocket.getMotorConfigurationIDs()) {
|
||||
for (String id : rocket.getFlightConfigurationIDs()) {
|
||||
if (id == null) {
|
||||
continue;
|
||||
}
|
||||
Simulation sim = new Simulation(rocket);
|
||||
sim.getConfiguration().setMotorConfigurationID(id);
|
||||
String name = createSimulationName(trans.get("basicSimulationName"), rocket.getMotorConfigurationNameOrDescription(id));
|
||||
sim.getConfiguration().setFlightConfigurationID(id);
|
||||
String name = createSimulationName(trans.get("basicSimulationName"), rocket.getFlightConfigurationNameOrDescription(id));
|
||||
simulations.add(new Named<Simulation>(sim, name));
|
||||
}
|
||||
|
||||
|
||||
Simulation sim = new Simulation(rocket);
|
||||
sim.getConfiguration().setMotorConfigurationID(null);
|
||||
String name = createSimulationName(trans.get("noSimulationName"), rocket.getMotorConfigurationNameOrDescription(null));
|
||||
sim.getConfiguration().setFlightConfigurationID(null);
|
||||
String name = createSimulationName(trans.get("noSimulationName"), rocket.getFlightConfigurationNameOrDescription(null));
|
||||
simulations.add(new Named<Simulation>(sim, name));
|
||||
|
||||
|
||||
|
||||
@ -205,7 +205,7 @@ public class RocketRenderer {
|
||||
}
|
||||
|
||||
private void renderMotors(GL2 gl, Configuration configuration) {
|
||||
String motorID = configuration.getMotorConfigurationID();
|
||||
String motorID = configuration.getFlightConfigurationID();
|
||||
Iterator<MotorMount> iterator = configuration.motorIterator();
|
||||
while (iterator.hasNext()) {
|
||||
MotorMount mount = iterator.next();
|
||||
|
||||
@ -36,7 +36,7 @@ import net.sf.openrocket.gui.SpinnerEditor;
|
||||
import net.sf.openrocket.gui.adaptors.BooleanModel;
|
||||
import net.sf.openrocket.gui.adaptors.DoubleModel;
|
||||
import net.sf.openrocket.gui.adaptors.EnumModel;
|
||||
import net.sf.openrocket.gui.adaptors.MotorConfigurationModel;
|
||||
import net.sf.openrocket.gui.adaptors.FlightConfigurationModel;
|
||||
import net.sf.openrocket.gui.components.BasicSlider;
|
||||
import net.sf.openrocket.gui.components.DescriptionArea;
|
||||
import net.sf.openrocket.gui.components.SimulationExportPanel;
|
||||
@ -215,13 +215,13 @@ public class SimulationEditDialog extends JDialog {
|
||||
label.setToolTipText(trans.get("simedtdlg.lbl.ttip.Motorcfg"));
|
||||
panel.add(label, "shrinkx, spanx, split 2");
|
||||
|
||||
JComboBox combo = new JComboBox(new MotorConfigurationModel(configuration));
|
||||
JComboBox combo = new JComboBox(new FlightConfigurationModel(configuration));
|
||||
//// Select the motor configuration to use.
|
||||
combo.setToolTipText(trans.get("simedtdlg.combo.ttip.motorconf"));
|
||||
combo.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
conditions.setMotorConfigurationID(configuration.getMotorConfigurationID());
|
||||
conditions.setMotorConfigurationID(configuration.getFlightConfigurationID());
|
||||
}
|
||||
});
|
||||
panel.add(combo, "growx, wrap para");
|
||||
|
||||
@ -302,7 +302,7 @@ public class SimulationPanel extends JPanel {
|
||||
if (row < 0 || row >= document.getSimulationCount())
|
||||
return null;
|
||||
return document.getSimulation(row).getConfiguration()
|
||||
.getMotorConfigurationDescription();
|
||||
.getFlightConfigurationDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -216,7 +216,7 @@ public class DesignReport {
|
||||
paragraph.setSpacingAfter(heightOfDiagramAndText);
|
||||
document.add(paragraph);
|
||||
|
||||
String[] motorIds = rocket.getMotorConfigurationIDs();
|
||||
String[] motorIds = rocket.getFlightConfigurationIDs();
|
||||
List<Simulation> simulations = rocketDocument.getSimulations();
|
||||
|
||||
for (int j = 0; j < motorIds.length; j++) {
|
||||
@ -321,7 +321,7 @@ public class DesignReport {
|
||||
MassCalculator massCalc = new BasicMassCalculator();
|
||||
|
||||
Configuration config = new Configuration(rocket);
|
||||
config.setMotorConfigurationID(motorId);
|
||||
config.setFlightConfigurationID(motorId);
|
||||
|
||||
int totalMotorCount = 0;
|
||||
double totalPropMass = 0;
|
||||
@ -444,7 +444,7 @@ public class DesignReport {
|
||||
PdfPTable labelTable = new PdfPTable(2);
|
||||
labelTable.setWidths(new int[] { 3, 2 });
|
||||
final Paragraph chunk = ITextHelper.createParagraph(stripBrackets(
|
||||
theRocket.getMotorConfigurationNameOrDescription(motorId)), PrintUtilities.BOLD);
|
||||
theRocket.getFlightConfigurationNameOrDescription(motorId)), PrintUtilities.BOLD);
|
||||
chunk.setLeading(leading);
|
||||
chunk.setSpacingAfter(3f);
|
||||
|
||||
|
||||
@ -347,7 +347,7 @@ public class RocketFigure extends AbstractScaleFigure {
|
||||
|
||||
|
||||
// Draw motors
|
||||
String motorID = configuration.getMotorConfigurationID();
|
||||
String motorID = configuration.getFlightConfigurationID();
|
||||
Color fillColor = ((SwingPreferences)Application.getPreferences()).getMotorFillColor();
|
||||
Color borderColor = ((SwingPreferences)Application.getPreferences()).getMotorBorderColor();
|
||||
Iterator<MotorMount> iterator = configuration.motorIterator();
|
||||
|
||||
@ -40,7 +40,7 @@ import net.sf.openrocket.aerodynamics.WarningSet;
|
||||
import net.sf.openrocket.document.OpenRocketDocument;
|
||||
import net.sf.openrocket.document.Simulation;
|
||||
import net.sf.openrocket.gui.adaptors.DoubleModel;
|
||||
import net.sf.openrocket.gui.adaptors.MotorConfigurationModel;
|
||||
import net.sf.openrocket.gui.adaptors.FlightConfigurationModel;
|
||||
import net.sf.openrocket.gui.components.BasicSlider;
|
||||
import net.sf.openrocket.gui.components.StageSelector;
|
||||
import net.sf.openrocket.gui.components.UnitSelector;
|
||||
@ -305,7 +305,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
||||
JLabel label = new JLabel(trans.get("RocketPanel.lbl.Motorcfg"));
|
||||
label.setHorizontalAlignment(JLabel.RIGHT);
|
||||
add(label, "growx, right");
|
||||
add(new JComboBox(new MotorConfigurationModel(configuration)), "wrap");
|
||||
add(new JComboBox(new FlightConfigurationModel(configuration)), "wrap");
|
||||
|
||||
|
||||
|
||||
@ -670,12 +670,12 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
||||
|
||||
// Check whether data is already up to date
|
||||
if (flightDataFunctionalID == configuration.getRocket().getFunctionalModID() &&
|
||||
flightDataMotorID == configuration.getMotorConfigurationID()) {
|
||||
flightDataMotorID == configuration.getFlightConfigurationID()) {
|
||||
return;
|
||||
}
|
||||
|
||||
flightDataFunctionalID = configuration.getRocket().getFunctionalModID();
|
||||
flightDataMotorID = configuration.getMotorConfigurationID();
|
||||
flightDataMotorID = configuration.getFlightConfigurationID();
|
||||
|
||||
// Stop previous computation (if any)
|
||||
stopBackgroundSimulation();
|
||||
@ -693,7 +693,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
||||
Rocket duplicate = (Rocket) configuration.getRocket().copy();
|
||||
Simulation simulation = ((SwingPreferences)Application.getPreferences()).getBackgroundSimulation(duplicate);
|
||||
simulation.getOptions().setMotorConfigurationID(
|
||||
configuration.getMotorConfigurationID());
|
||||
configuration.getFlightConfigurationID());
|
||||
|
||||
backgroundSimulationWorker = new BackgroundSimulationWorker(document, simulation);
|
||||
backgroundSimulationExecutor.execute(backgroundSimulationWorker);
|
||||
|
||||
@ -56,7 +56,7 @@ public class BasicMassCalculator extends AbstractMassCalculator {
|
||||
totalCG = Coordinate.NUL;
|
||||
|
||||
// Add motor CGs
|
||||
String motorId = configuration.getMotorConfigurationID();
|
||||
String motorId = configuration.getFlightConfigurationID();
|
||||
if (type != MassCalcType.NO_MOTORS && motorId != null) {
|
||||
Iterator<MotorMount> iterator = configuration.motorIterator();
|
||||
while (iterator.hasNext()) {
|
||||
|
||||
@ -127,7 +127,7 @@ public class DefaultSimulationModifierService implements SimulationModifierServi
|
||||
|
||||
// Simulation is used to calculate default min/max values
|
||||
Simulation simulation = new Simulation(rocket);
|
||||
simulation.getConfiguration().setMotorConfigurationID(null);
|
||||
simulation.getConfiguration().setFlightConfigurationID(null);
|
||||
|
||||
for (RocketComponent c : rocket) {
|
||||
|
||||
|
||||
@ -360,7 +360,7 @@ public class BodyTube extends SymmetricComponent implements MotorMount, Coaxial
|
||||
RocketComponent root = this.getRoot();
|
||||
if (!(root instanceof Rocket))
|
||||
return null;
|
||||
if (!((Rocket) root).isMotorConfigurationID(id))
|
||||
if (!((Rocket) root).isFlightConfigurationID(id))
|
||||
return null;
|
||||
|
||||
return motors.get(id);
|
||||
|
||||
@ -31,7 +31,7 @@ public class Configuration implements Cloneable, ChangeSource, ComponentChangeLi
|
||||
private Rocket rocket;
|
||||
private BitSet stages = new BitSet();
|
||||
|
||||
private String motorConfiguration = null;
|
||||
private String flightConfigurationId = null;
|
||||
|
||||
private List<EventListener> listenerList = new ArrayList<EventListener>();
|
||||
|
||||
@ -163,21 +163,21 @@ public class Configuration implements Cloneable, ChangeSource, ComponentChangeLi
|
||||
}
|
||||
|
||||
|
||||
public String getMotorConfigurationID() {
|
||||
return motorConfiguration;
|
||||
public String getFlightConfigurationID() {
|
||||
return flightConfigurationId;
|
||||
}
|
||||
|
||||
public void setMotorConfigurationID(String id) {
|
||||
if ((motorConfiguration == null && id == null) ||
|
||||
(id != null && id.equals(motorConfiguration)))
|
||||
public void setFlightConfigurationID(String id) {
|
||||
if ((flightConfigurationId == null && id == null) ||
|
||||
(id != null && id.equals(flightConfigurationId)))
|
||||
return;
|
||||
|
||||
motorConfiguration = id;
|
||||
flightConfigurationId = id;
|
||||
fireChangeEvent();
|
||||
}
|
||||
|
||||
public String getMotorConfigurationDescription() {
|
||||
return rocket.getMotorConfigurationNameOrDescription(motorConfiguration);
|
||||
public String getFlightConfigurationDescription() {
|
||||
return rocket.getFlightConfigurationNameOrDescription(flightConfigurationId);
|
||||
}
|
||||
|
||||
|
||||
@ -243,7 +243,7 @@ public class Configuration implements Cloneable, ChangeSource, ComponentChangeLi
|
||||
MotorMount mount = (MotorMount) c;
|
||||
if (!mount.isMotorMount())
|
||||
continue;
|
||||
if (mount.getMotor(this.motorConfiguration) != null) {
|
||||
if (mount.getMotor(this.flightConfigurationId) != null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -458,7 +458,7 @@ public class Configuration implements Cloneable, ChangeSource, ComponentChangeLi
|
||||
RocketComponent c = iterator.next();
|
||||
if (c instanceof MotorMount) {
|
||||
MotorMount mount = (MotorMount) c;
|
||||
if (mount.isMotorMount() && mount.getMotor(motorConfiguration) != null) {
|
||||
if (mount.isMotorMount() && mount.getMotor(flightConfigurationId) != null) {
|
||||
next = mount;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -244,7 +244,7 @@ public class InnerTube extends ThicknessRingComponent
|
||||
RocketComponent root = this.getRoot();
|
||||
if (!(root instanceof Rocket))
|
||||
return null;
|
||||
if (!((Rocket) root).isMotorConfigurationID(id))
|
||||
if (!((Rocket) root).isFlightConfigurationID(id))
|
||||
return null;
|
||||
|
||||
return motors.get(id);
|
||||
|
||||
@ -69,11 +69,11 @@ public class Rocket extends RocketComponent {
|
||||
private String revision = "";
|
||||
|
||||
|
||||
// Motor configuration list
|
||||
private ArrayList<String> motorConfigurationIDs = new ArrayList<String>();
|
||||
private HashMap<String, String> motorConfigurationNames = new HashMap<String, String>();
|
||||
// Flight configuration list
|
||||
private ArrayList<String> flightConfigurationIDs = new ArrayList<String>();
|
||||
private HashMap<String, String> flightConfigurationNames = new HashMap<String, String>();
|
||||
{
|
||||
motorConfigurationIDs.add(null);
|
||||
flightConfigurationIDs.add(null);
|
||||
}
|
||||
|
||||
|
||||
@ -266,9 +266,9 @@ public class Rocket extends RocketComponent {
|
||||
@Override
|
||||
public Rocket copyWithOriginalID() {
|
||||
Rocket copy = (Rocket) super.copyWithOriginalID();
|
||||
copy.motorConfigurationIDs = this.motorConfigurationIDs.clone();
|
||||
copy.motorConfigurationNames =
|
||||
(HashMap<String, String>) this.motorConfigurationNames.clone();
|
||||
copy.flightConfigurationIDs = this.flightConfigurationIDs.clone();
|
||||
copy.flightConfigurationNames =
|
||||
(HashMap<String, String>) this.flightConfigurationNames.clone();
|
||||
copy.resetListeners();
|
||||
|
||||
return copy;
|
||||
@ -306,14 +306,14 @@ public class Rocket extends RocketComponent {
|
||||
this.refType = r.refType;
|
||||
this.customReferenceLength = r.customReferenceLength;
|
||||
|
||||
this.motorConfigurationIDs = r.motorConfigurationIDs.clone();
|
||||
this.motorConfigurationNames =
|
||||
(HashMap<String, String>) r.motorConfigurationNames.clone();
|
||||
this.flightConfigurationIDs = r.flightConfigurationIDs.clone();
|
||||
this.flightConfigurationNames =
|
||||
(HashMap<String, String>) r.flightConfigurationNames.clone();
|
||||
this.perfectFinish = r.perfectFinish;
|
||||
|
||||
String id = defaultConfiguration.getMotorConfigurationID();
|
||||
if (!this.motorConfigurationIDs.contains(id))
|
||||
defaultConfiguration.setMotorConfigurationID(null);
|
||||
String id = defaultConfiguration.getFlightConfigurationID();
|
||||
if (!this.flightConfigurationIDs.contains(id))
|
||||
defaultConfiguration.setFlightConfigurationID(null);
|
||||
|
||||
this.checkComponentStructure();
|
||||
|
||||
@ -512,26 +512,26 @@ public class Rocket extends RocketComponent {
|
||||
|
||||
|
||||
/**
|
||||
* Return an array of the motor configuration IDs. This array is guaranteed
|
||||
* Return an array of the flight configuration IDs. This array is guaranteed
|
||||
* to contain the <code>null</code> ID as the first element.
|
||||
*
|
||||
* @return an array of the motor configuration IDs.
|
||||
* @return an array of the flight configuration IDs.
|
||||
*/
|
||||
public String[] getMotorConfigurationIDs() {
|
||||
public String[] getFlightConfigurationIDs() {
|
||||
checkState();
|
||||
return motorConfigurationIDs.toArray(new String[0]);
|
||||
return flightConfigurationIDs.toArray(new String[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new motor configuration ID to the motor configurations. The new ID
|
||||
* Add a new flight configuration ID to the flight configurations. The new ID
|
||||
* is returned.
|
||||
*
|
||||
* @return the new motor configuration ID.
|
||||
* @return the new flight configuration ID.
|
||||
*/
|
||||
public String newMotorConfigurationID() {
|
||||
public String newFlightConfigurationID() {
|
||||
checkState();
|
||||
String id = UUID.randomUUID().toString();
|
||||
motorConfigurationIDs.add(id);
|
||||
flightConfigurationIDs.add(id);
|
||||
fireComponentChangeEvent(ComponentChangeEvent.MOTOR_CHANGE);
|
||||
return id;
|
||||
}
|
||||
@ -544,24 +544,24 @@ public class Rocket extends RocketComponent {
|
||||
*/
|
||||
public boolean addMotorConfigurationID(String id) {
|
||||
checkState();
|
||||
if (id == null || motorConfigurationIDs.contains(id))
|
||||
if (id == null || flightConfigurationIDs.contains(id))
|
||||
return false;
|
||||
motorConfigurationIDs.add(id);
|
||||
flightConfigurationIDs.add(id);
|
||||
fireComponentChangeEvent(ComponentChangeEvent.MOTOR_CHANGE);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a motor configuration ID from the configuration IDs. The <code>null</code>
|
||||
* Remove a flight configuration ID from the configuration IDs. The <code>null</code>
|
||||
* ID cannot be removed, and an attempt to remove it will be silently ignored.
|
||||
*
|
||||
* @param id the motor configuration ID to remove
|
||||
* @param id the flight configuration ID to remove
|
||||
*/
|
||||
public void removeMotorConfigurationID(String id) {
|
||||
public void removeFlightConfigurationID(String id) {
|
||||
checkState();
|
||||
if (id == null)
|
||||
return;
|
||||
motorConfigurationIDs.remove(id);
|
||||
flightConfigurationIDs.remove(id);
|
||||
fireComponentChangeEvent(ComponentChangeEvent.MOTOR_CHANGE);
|
||||
}
|
||||
|
||||
@ -572,9 +572,9 @@ public class Rocket extends RocketComponent {
|
||||
* @param id the configuration ID.
|
||||
* @return whether a motor configuration with that ID exists.
|
||||
*/
|
||||
public boolean isMotorConfigurationID(String id) {
|
||||
public boolean isFlightConfigurationID(String id) {
|
||||
checkState();
|
||||
return motorConfigurationIDs.contains(id);
|
||||
return flightConfigurationIDs.contains(id);
|
||||
}
|
||||
|
||||
|
||||
@ -608,17 +608,17 @@ public class Rocket extends RocketComponent {
|
||||
|
||||
|
||||
/**
|
||||
* Return the user-set name of the motor configuration. If no name has been set,
|
||||
* Return the user-set name of the flight configuration. If no name has been set,
|
||||
* returns an empty string (not null).
|
||||
*
|
||||
* @param id the motor configuration id
|
||||
* @param id the flight configuration id
|
||||
* @return the configuration name
|
||||
*/
|
||||
public String getMotorConfigurationName(String id) {
|
||||
public String getFlightConfigurationName(String id) {
|
||||
checkState();
|
||||
if (!isMotorConfigurationID(id))
|
||||
if (!isFlightConfigurationID(id))
|
||||
return "";
|
||||
String s = motorConfigurationNames.get(id);
|
||||
String s = flightConfigurationNames.get(id);
|
||||
if (s == null)
|
||||
return "";
|
||||
return s;
|
||||
@ -626,45 +626,45 @@ public class Rocket extends RocketComponent {
|
||||
|
||||
|
||||
/**
|
||||
* Set the name of the motor configuration. A name can be unset by passing
|
||||
* Set the name of the flight configuration. A name can be unset by passing
|
||||
* <code>null</code> or an empty string.
|
||||
*
|
||||
* @param id the motor configuration id
|
||||
* @param name the name for the motor configuration
|
||||
* @param id the flight configuration id
|
||||
* @param name the name for the flight configuration
|
||||
*/
|
||||
public void setMotorConfigurationName(String id, String name) {
|
||||
public void setFlightConfigurationName(String id, String name) {
|
||||
checkState();
|
||||
motorConfigurationNames.put(id, name);
|
||||
flightConfigurationNames.put(id, name);
|
||||
fireComponentChangeEvent(ComponentChangeEvent.NONFUNCTIONAL_CHANGE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return either the motor configuration name (if set) or its description.
|
||||
* Return either the flight configuration name (if set) or its description.
|
||||
*
|
||||
* @param id the motor configuration ID.
|
||||
* @param id the flight configuration ID.
|
||||
* @return a textual representation of the configuration
|
||||
*/
|
||||
public String getMotorConfigurationNameOrDescription(String id) {
|
||||
public String getFlightConfigurationNameOrDescription(String id) {
|
||||
checkState();
|
||||
String name;
|
||||
|
||||
name = getMotorConfigurationName(id);
|
||||
name = getFlightConfigurationName(id);
|
||||
if (name != null && !name.equals(""))
|
||||
return name;
|
||||
|
||||
return getMotorConfigurationDescription(id);
|
||||
return getFlightConfigurationDescription(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a description for the motor configuration, generated from the motor
|
||||
* Return a description for the flight configuration, generated from the motor
|
||||
* designations of the components.
|
||||
*
|
||||
* @param id the motor configuration ID.
|
||||
* @param id the flight configuration ID.
|
||||
* @return a textual representation of the configuration
|
||||
*/
|
||||
@SuppressWarnings("null")
|
||||
public String getMotorConfigurationDescription(String id) {
|
||||
public String getFlightConfigurationDescription(String id) {
|
||||
checkState();
|
||||
String name;
|
||||
int motorCount = 0;
|
||||
|
||||
@ -56,7 +56,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
||||
|
||||
// Set up rocket configuration
|
||||
Configuration configuration = setupConfiguration(simulationConditions);
|
||||
flightConfigurationId = configuration.getMotorConfigurationID();
|
||||
flightConfigurationId = configuration.getFlightConfigurationID();
|
||||
MotorInstanceConfiguration motorConfiguration = setupMotorConfiguration(configuration);
|
||||
if (motorConfiguration.getMotorIDs().isEmpty()) {
|
||||
throw new MotorIgnitionException("No motors defined in the simulation.");
|
||||
@ -264,7 +264,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
||||
private Configuration setupConfiguration(SimulationConditions simulation) {
|
||||
Configuration configuration = new Configuration(simulation.getRocket());
|
||||
configuration.setAllStages();
|
||||
configuration.setMotorConfigurationID(simulation.getMotorConfigurationID());
|
||||
configuration.setFlightConfigurationID(simulation.getMotorConfigurationID());
|
||||
|
||||
return configuration;
|
||||
}
|
||||
@ -279,7 +279,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
||||
*/
|
||||
private MotorInstanceConfiguration setupMotorConfiguration(Configuration configuration) {
|
||||
MotorInstanceConfiguration motors = new MotorInstanceConfiguration();
|
||||
final String motorId = configuration.getMotorConfigurationID();
|
||||
final String motorId = configuration.getFlightConfigurationID();
|
||||
|
||||
Iterator<MotorMount> iterator = configuration.motorIterator();
|
||||
while (iterator.hasNext()) {
|
||||
@ -428,7 +428,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
||||
throw new SimulationLaunchException("Motor burnout without liftoff.");
|
||||
}
|
||||
// Add ejection charge event
|
||||
String id = status.getConfiguration().getMotorConfigurationID();
|
||||
String id = status.getConfiguration().getFlightConfigurationID();
|
||||
MotorMount mount = (MotorMount) event.getSource();
|
||||
double delay = mount.getMotorDelay(id);
|
||||
if (delay != Motor.PLUGGED) {
|
||||
|
||||
@ -116,7 +116,7 @@ public class SimulationOptions implements ChangeSource, Cloneable {
|
||||
public void setMotorConfigurationID(String id) {
|
||||
if (id != null)
|
||||
id = id.intern();
|
||||
if (!rocket.isMotorConfigurationID(id))
|
||||
if (!rocket.isFlightConfigurationID(id))
|
||||
id = null;
|
||||
if (id == motorID)
|
||||
return;
|
||||
@ -408,11 +408,11 @@ public class SimulationOptions implements ChangeSource, Cloneable {
|
||||
|
||||
if (src.rocket.hasMotors(src.motorID)) {
|
||||
// Try to find a matching motor ID
|
||||
String motorDesc = src.rocket.getMotorConfigurationDescription(src.motorID);
|
||||
String motorDesc = src.rocket.getFlightConfigurationDescription(src.motorID);
|
||||
String matchID = null;
|
||||
|
||||
for (String id : this.rocket.getMotorConfigurationIDs()) {
|
||||
if (motorDesc.equals(this.rocket.getMotorConfigurationDescription(id))) {
|
||||
for (String id : this.rocket.getFlightConfigurationIDs()) {
|
||||
if (motorDesc.equals(this.rocket.getFlightConfigurationDescription(id))) {
|
||||
matchID = id;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -275,13 +275,13 @@ public class TestRockets {
|
||||
bodytube.setMaterial(material);
|
||||
finset.setMaterial(material);
|
||||
|
||||
String id = rocket.newMotorConfigurationID();
|
||||
String id = rocket.newFlightConfigurationID();
|
||||
bodytube.setMotorMount(true);
|
||||
|
||||
Motor m = Application.getMotorSetDatabase().findMotors(null, null, "B4", Double.NaN, Double.NaN).get(0);
|
||||
bodytube.setMotor(id, m);
|
||||
bodytube.setMotorOverhang(0.005);
|
||||
rocket.getDefaultConfiguration().setMotorConfigurationID(id);
|
||||
rocket.getDefaultConfiguration().setFlightConfigurationID(id);
|
||||
|
||||
rocket.getDefaultConfiguration().setAllStages();
|
||||
|
||||
@ -346,13 +346,13 @@ public class TestRockets {
|
||||
// bodytube.setMaterial(material);
|
||||
// finset.setMaterial(material);
|
||||
|
||||
String id = rocket.newMotorConfigurationID();
|
||||
String id = rocket.newFlightConfigurationID();
|
||||
bodytube.setMotorMount(true);
|
||||
|
||||
// Motor m = Application.getMotorSetDatabase().findMotors(null, null, "F12J", Double.NaN, Double.NaN).get(0);
|
||||
// bodytube.setMotor(id, m);
|
||||
// bodytube.setMotorOverhang(0.005);
|
||||
rocket.getDefaultConfiguration().setMotorConfigurationID(id);
|
||||
rocket.getDefaultConfiguration().setFlightConfigurationID(id);
|
||||
|
||||
rocket.getDefaultConfiguration().setAllStages();
|
||||
|
||||
@ -549,13 +549,13 @@ public class TestRockets {
|
||||
|
||||
|
||||
|
||||
String id = rocket.newMotorConfigurationID();
|
||||
String id = rocket.newFlightConfigurationID();
|
||||
tube3.setMotorMount(true);
|
||||
|
||||
// Motor m = Application.getMotorSetDatabase().findMotors(null, null, "L540", Double.NaN, Double.NaN).get(0);
|
||||
// tube3.setMotor(id, m);
|
||||
// tube3.setMotorOverhang(0.02);
|
||||
rocket.getDefaultConfiguration().setMotorConfigurationID(id);
|
||||
rocket.getDefaultConfiguration().setFlightConfigurationID(id);
|
||||
|
||||
// tube3.setIgnitionEvent(MotorMount.IgnitionEvent.NEVER);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user