commit
9c396f2f7b
@ -33,6 +33,7 @@ import net.sf.openrocket.l10n.Translator;
|
|||||||
import net.sf.openrocket.logging.Markers;
|
import net.sf.openrocket.logging.Markers;
|
||||||
import net.sf.openrocket.rocketcomponent.BodyComponent;
|
import net.sf.openrocket.rocketcomponent.BodyComponent;
|
||||||
import net.sf.openrocket.rocketcomponent.BodyTube;
|
import net.sf.openrocket.rocketcomponent.BodyTube;
|
||||||
|
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
|
||||||
import net.sf.openrocket.rocketcomponent.EllipticalFinSet;
|
import net.sf.openrocket.rocketcomponent.EllipticalFinSet;
|
||||||
import net.sf.openrocket.rocketcomponent.FinSet;
|
import net.sf.openrocket.rocketcomponent.FinSet;
|
||||||
import net.sf.openrocket.rocketcomponent.FreeformFinSet;
|
import net.sf.openrocket.rocketcomponent.FreeformFinSet;
|
||||||
@ -400,18 +401,22 @@ public class ScaleDialog extends JDialog {
|
|||||||
panel.add(scaleMassValues, "span, wrap para*3");
|
panel.add(scaleMassValues, "span, wrap para*3");
|
||||||
|
|
||||||
|
|
||||||
// Buttons
|
// Scale / Accept Buttons
|
||||||
|
|
||||||
JButton scale = new JButton(trans.get("button.scale"));
|
JButton scale = new JButton(trans.get("button.scale"));
|
||||||
scale.addActionListener(new ActionListener() {
|
scale.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
doScale();
|
doScale();
|
||||||
|
|
||||||
|
ScaleDialog.this.document.getRocket().fireComponentChangeEvent( ComponentChangeEvent.AEROMASS_CHANGE);
|
||||||
|
|
||||||
ScaleDialog.this.setVisible(false);
|
ScaleDialog.this.setVisible(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
panel.add(scale, "span, split, right, gap para");
|
panel.add(scale, "span, split, right, gap para");
|
||||||
|
|
||||||
|
// Cancel Button
|
||||||
JButton cancel = new JButton(trans.get("button.cancel"));
|
JButton cancel = new JButton(trans.get("button.cancel"));
|
||||||
cancel.addActionListener(new ActionListener() {
|
cancel.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -106,7 +106,7 @@ public class ComponentPresetChooserDialog extends JDialog {
|
|||||||
sub.add(filterLabel, "gapright para");
|
sub.add(filterLabel, "gapright para");
|
||||||
|
|
||||||
filterText = new JTextField();
|
filterText = new JTextField();
|
||||||
sub.add(filterText, "growx");
|
sub.add(filterText, "width 50:320, growx");
|
||||||
filterText.getDocument().addDocumentListener(new DocumentListener() {
|
filterText.getDocument().addDocumentListener(new DocumentListener() {
|
||||||
@Override
|
@Override
|
||||||
public void changedUpdate(DocumentEvent e) {
|
public void changedUpdate(DocumentEvent e) {
|
||||||
@ -174,7 +174,7 @@ public class ComponentPresetChooserDialog extends JDialog {
|
|||||||
private JPanel getFilterCheckboxes() {
|
private JPanel getFilterCheckboxes() {
|
||||||
SymmetricComponent sc;
|
SymmetricComponent sc;
|
||||||
|
|
||||||
JPanel panel = new JPanel(new MigLayout("fill, ins 0"));
|
JPanel panel = new JPanel(new MigLayout("ins 0"));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add show all compatible check box.
|
* Add show all compatible check box.
|
||||||
|
@ -684,30 +684,33 @@ public class BasicFrame extends JFrame {
|
|||||||
menu.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.analyze.desc"));
|
menu.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.analyze.desc"));
|
||||||
menubar.add(menu);
|
menubar.add(menu);
|
||||||
|
|
||||||
//// Component analysis
|
|
||||||
item = new JMenuItem(trans.get("main.menu.analyze.componentAnalysis"), KeyEvent.VK_C);
|
|
||||||
//// Analyze the rocket components separately
|
|
||||||
item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.analyze.componentAnalysis.desc"));
|
|
||||||
item.addActionListener(new ActionListener() {
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
log.info(Markers.USER_MARKER, "Component analysis selected");
|
|
||||||
ComponentAnalysisDialog.showDialog(rocketpanel);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
menu.add(item);
|
|
||||||
|
|
||||||
//// Optimize
|
// TODO: reimplement this
|
||||||
item = new JMenuItem(trans.get("main.menu.analyze.optimization"), KeyEvent.VK_O);
|
// //// Component analysis
|
||||||
item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.analyze.optimization.desc"));
|
// item = new JMenuItem(trans.get("main.menu.analyze.componentAnalysis"), KeyEvent.VK_C);
|
||||||
item.addActionListener(new ActionListener() {
|
// //// Analyze the rocket components separately
|
||||||
@Override
|
// item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.analyze.componentAnalysis.desc"));
|
||||||
public void actionPerformed(ActionEvent e) {
|
// item.addActionListener(new ActionListener() {
|
||||||
log.info(Markers.USER_MARKER, "Rocket optimization selected");
|
// @Override
|
||||||
new GeneralOptimizationDialog(document, BasicFrame.this).setVisible(true);
|
// public void actionPerformed(ActionEvent e) {
|
||||||
}
|
// log.info(Markers.USER_MARKER, "Component analysis selected");
|
||||||
});
|
// ComponentAnalysisDialog.showDialog(rocketpanel);
|
||||||
menu.add(item);
|
// }
|
||||||
|
// });
|
||||||
|
// menu.add(item);
|
||||||
|
|
||||||
|
// TODO: reimplement this dialog
|
||||||
|
// //// Optimize
|
||||||
|
// item = new JMenuItem(trans.get("main.menu.analyze.optimization"), KeyEvent.VK_O);
|
||||||
|
// item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.analyze.optimization.desc"));
|
||||||
|
// item.addActionListener(new ActionListener() {
|
||||||
|
// @Override
|
||||||
|
// public void actionPerformed(ActionEvent e) {
|
||||||
|
// log.info(Markers.USER_MARKER, "Rocket optimization selected");
|
||||||
|
// new GeneralOptimizationDialog(document, BasicFrame.this).setVisible(true);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// menu.add(item);
|
||||||
|
|
||||||
//// Custom expressions
|
//// Custom expressions
|
||||||
item = new JMenuItem(trans.get("main.menu.analyze.customExpressions"), KeyEvent.VK_E);
|
item = new JMenuItem(trans.get("main.menu.analyze.customExpressions"), KeyEvent.VK_E);
|
||||||
|
@ -50,11 +50,14 @@ public class ExampleDesignFile implements Comparable<ExampleDesignFile> {
|
|||||||
logger.debug("Cannot find jar file, trying to load from directory");
|
logger.debug("Cannot find jar file, trying to load from directory");
|
||||||
designs = getDirFileNames();
|
designs = getDirFileNames();
|
||||||
}
|
}
|
||||||
if (designs == null || designs.length == 0) {
|
|
||||||
return null;
|
if (designs == null ){
|
||||||
|
return new ExampleDesignFile[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if( 0 < designs.length ) {
|
||||||
|
Arrays.sort(designs);
|
||||||
}
|
}
|
||||||
|
|
||||||
Arrays.sort(designs);
|
|
||||||
|
|
||||||
return designs;
|
return designs;
|
||||||
}
|
}
|
||||||
|
@ -120,10 +120,7 @@ public class IntegrationTest {
|
|||||||
checkUndoState(null, null);
|
checkUndoState(null, null);
|
||||||
|
|
||||||
InnerTube mmt = (InnerTube)config.getRocket().getChild(0).getChild(1).getChild(2);
|
InnerTube mmt = (InnerTube)config.getRocket().getChild(0).getChild(1).getChild(2);
|
||||||
System.err.println(String.format("IntegrationTest::testSimpleRocket(...)...."));
|
|
||||||
System.err.println(String.format(" Config: %s", config.toDebug() ));
|
|
||||||
System.err.println(String.format(" motor config: %s", mmt.getMotorConfig( config.getId() ).toDescription() ));
|
|
||||||
|
|
||||||
// Compute cg+cp + altitude
|
// Compute cg+cp + altitude
|
||||||
// double cgx, double mass, double cpx, double cna)
|
// double cgx, double mass, double cpx, double cna)
|
||||||
checkCgCp(0.248, 0.0645, 0.320, 12.0);
|
checkCgCp(0.248, 0.0645, 0.320, 12.0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user