import net.sf.openrocket.gui.components.StyledLabel.Style;
import net.sf.openrocket.gui.dialogs.motor.CloseableDialog;
import net.sf.openrocket.gui.dialogs.motor.MotorSelector;
+import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.logging.LogHelper;
import net.sf.openrocket.motor.Motor;
import net.sf.openrocket.motor.MotorDigest;
public class ThrustCurveMotorSelectionPanel extends JPanel implements MotorSelector {
private static final LogHelper log = Application.getLogger();
-
+ private static final Translator trans = Application.getTranslator();
+
private static final double MOTOR_SIMILARITY_THRESHOLD = 0.95;
private static final int SHOW_ALL = 0;
// Selection label
+ //// Select rocket motor:
label = new StyledLabel("Select rocket motor:", Style.BOLD);
panel.add(label, "spanx, wrap para");
});
panel.add(filterComboBox, "spanx, growx, wrap rel");
-
+ //// Hide very similar thrust curves
hideSimilarBox = new JCheckBox("Hide very similar thrust curves");
GUIUtil.changeFontSize(hideSimilarBox, -1);
hideSimilarBox.setSelected(Prefs.getBoolean(Prefs.MOTOR_HIDE_SIMILAR, true));
// Motor mount diameter label
+ //// Motor mount diameter:
label = new StyledLabel("Motor mount diameter: " +
UnitGroup.UNITS_MOTOR_DIMENSIONS.getDefaultUnit().toStringUnit(diameter));
panel.add(label, "gapright 30lp, spanx, split");
// Search field
+ //// Search:
label = new StyledLabel("Search:");
panel.add(label, "");
// Thrust curve selection
+ //// Select thrust curve:
curveSelectionLabel = new JLabel("Select thrust curve:");
panel.add(curveSelectionLabel);
- // Ejection charge delay
+ // Ejection charge delay:
panel.add(new JLabel("Ejection charge delay:"));
delayBox = new JComboBox();
}
});
panel.add(delayBox, "growx, wrap rel");
+ //// (Number of seconds or \"None\")
panel.add(new StyledLabel("(Number of seconds or \"None\")", -3), "skip, wrap para");
setDelays(false);
// Thrust curve info
+ //// Total impulse:
panel.add(new JLabel("Total impulse:"));
totalImpulseLabel = new JLabel();
panel.add(totalImpulseLabel, "wrap");
+ //// Avg. thrust:
panel.add(new JLabel("Avg. thrust:"));
avgThrustLabel = new JLabel();
panel.add(avgThrustLabel, "wrap");
+ //// Max. thrust:
panel.add(new JLabel("Max. thrust:"));
maxThrustLabel = new JLabel();
panel.add(maxThrustLabel, "wrap");
+ //// Burn time:
panel.add(new JLabel("Burn time:"));
burnTimeLabel = new JLabel();
panel.add(burnTimeLabel, "wrap");
+ //// Launch mass:
panel.add(new JLabel("Launch mass:"));
launchMassLabel = new JLabel();
panel.add(launchMassLabel, "wrap");
+ //// Empty mass:
panel.add(new JLabel("Empty mass:"));
emptyMassLabel = new JLabel();
panel.add(emptyMassLabel, "wrap");
+ //// Data points:
panel.add(new JLabel("Data points:"));
dataPointsLabel = new JLabel();
panel.add(dataPointsLabel, "wrap para");
if (System.getProperty("openrocket.debug.motordigest") != null) {
+ //// Digest:
panel.add(new JLabel("Digest:"));
digestLabel = new JLabel();
panel.add(digestLabel, "w :300:, wrap para");
changeLabelFont(plot.getRangeAxis(), -2);
changeLabelFont(plot.getDomainAxis(), -2);
+ //// Thrust curve:
chart.setTitle(new TextTitle("Thrust curve:", this.getFont()));
chart.setBackgroundPaint(this.getBackground());
plot.setBackgroundPaint(Color.WHITE);
for (int i = 0; i < motors.size(); i++) {
ThrustCurveMotor m = motors.get(i);
+ //// Thrust
XYSeries series = new XYSeries("Thrust");
double[] time = m.getTimePoints();
double[] thrust = m.getThrustPoints();