Added UNITS_WINDSPEED so the preferred units for entering wind speed can be configured separately from rocket velocities.

This commit is contained in:
Kevin Ruland 2012-05-16 06:36:58 +00:00
parent 4fa4217665
commit 7420f5c18b
4 changed files with 16 additions and 3 deletions

View File

@ -230,6 +230,7 @@ pref.dlg.tab.Miscellaneousoptions = Miscellaneous options
pref.dlg.lbl.Positiontoinsert = Position to insert new body components:
pref.dlg.lbl.Confirmdeletion = Confirm deletion of simulations:
pref.dlg.lbl.User-definedthrust = User-defined thrust curves:
pref.dlg.lbl.Windspeed = Windspeed
pref.dlg.Allthrustcurvefiles = All thrust curve files (*.eng; *.rse; *.zip; directories)
pref.dlg.RASPfiles = RASP motor files (*.eng)
pref.dlg.RockSimfiles = RockSim engine files (*.rse)

View File

@ -388,7 +388,6 @@ public class PreferencesDialog extends JDialog {
combo = new JComboBox(new DefaultUnitSelector(UnitGroup.UNITS_TEMPERATURE));
panel.add(combo, "sizegroup boxes, wrap");
//// Moment of inertia:
panel.add(new JLabel(trans.get("pref.dlg.lbl.Momentofinertia")));
combo = new JComboBox(new DefaultUnitSelector(UnitGroup.UNITS_INERTIA));
@ -403,10 +402,16 @@ public class PreferencesDialog extends JDialog {
//// Stability:
panel.add(new JLabel(trans.get("pref.dlg.lbl.Stability")));
combo = new JComboBox(new DefaultUnitSelector(UnitGroup.UNITS_STABILITY));
panel.add(combo, "sizegroup boxes");
//// Windspeed:
panel.add(new JLabel(trans.get("pref.dlg.lbl.Windspeed")));
combo = new JComboBox(new DefaultUnitSelector(UnitGroup.UNITS_WINDSPEED));
panel.add(combo, "sizegroup boxes, wrap para");
//// Default metric button
JButton button = new JButton(trans.get("pref.dlg.but.defaultmetric"));
button.addActionListener(new ActionListener() {

View File

@ -241,7 +241,7 @@ public class SimulationEditDialog extends JDialog {
label.setToolTipText(tip);
sub.add(label);
m = new DoubleModel(conditions, "WindSpeedAverage", UnitGroup.UNITS_VELOCITY, 0);
m = new DoubleModel(conditions, "WindSpeedAverage", UnitGroup.UNITS_WINDSPEED, 0);
spin = new JSpinner(m.getSpinnerModel());
spin.setEditor(new SpinnerEditor(spin));
@ -266,7 +266,7 @@ public class SimulationEditDialog extends JDialog {
label.setToolTipText(tip);
sub.add(label);
m = new DoubleModel(conditions, "WindSpeedDeviation", UnitGroup.UNITS_VELOCITY, 0);
m = new DoubleModel(conditions, "WindSpeedDeviation", UnitGroup.UNITS_WINDSPEED, 0);
DoubleModel m2 = new DoubleModel(conditions, "WindSpeedAverage", 0.25,
UnitGroup.UNITS_COEFFICIENT, 0);

View File

@ -37,6 +37,7 @@ public class UnitGroup {
*/
public static final UnitGroup UNITS_STABILITY_CALIBERS;
public static final UnitGroup UNITS_VELOCITY;
public static final UnitGroup UNITS_WINDSPEED;
public static final UnitGroup UNITS_ACCELERATION;
public static final UnitGroup UNITS_MASS;
public static final UnitGroup UNITS_INERTIA;
@ -128,6 +129,12 @@ public class UnitGroup {
UNITS_VELOCITY.addUnit(new GeneralUnit(0.3048, "ft/s"));
UNITS_VELOCITY.addUnit(new GeneralUnit(0.44704, "mph"));
UNITS_WINDSPEED = new UnitGroup();
UNITS_WINDSPEED.addUnit(new GeneralUnit(1, "m/s"));
UNITS_WINDSPEED.addUnit(new GeneralUnit(1 / 3.6, "km/h"));
UNITS_WINDSPEED.addUnit(new GeneralUnit(0.3048, "ft/s"));
UNITS_WINDSPEED.addUnit(new GeneralUnit(0.44704, "mph"));
UNITS_ACCELERATION = new UnitGroup();
UNITS_ACCELERATION.addUnit(new GeneralUnit(1, "m/s" + SQUARED));
UNITS_ACCELERATION.addUnit(new GeneralUnit(0.3048, "ft/s" + SQUARED));