Merge branch 'master' into set-color-defaults-in-options

This commit is contained in:
Craig Earls 2014-12-23 19:48:12 -08:00
commit b8999349a9
10 changed files with 162 additions and 52 deletions

View File

@ -339,6 +339,8 @@ simedtdlg.lbl.Wind = Wind
simedtdlg.lbl.Averwindspeed = Average windspeed: simedtdlg.lbl.Averwindspeed = Average windspeed:
simedtdlg.lbl.ttip.Averwindspeed = The average windspeed relative to the ground. simedtdlg.lbl.ttip.Averwindspeed = The average windspeed relative to the ground.
simedtdlg.lbl.Stddeviation = Standard deviation: simedtdlg.lbl.Stddeviation = Standard deviation:
simedtdlg.lbl.Winddirection = Wind direction:
simedtdlg.lbl.ttip.Winddirection = <html>Wind direction, 0-360 degrees. <br>0 means from the north,<br> 90 is from the east
simedtdlg.lbl.ttip.Stddeviation = <html>The standard deviation of the windspeed.<br>The windspeed is within twice the standard deviation from the average for 95% of the time. simedtdlg.lbl.ttip.Stddeviation = <html>The standard deviation of the windspeed.<br>The windspeed is within twice the standard deviation from the average for 95% of the time.
simedtdlg.lbl.Turbulenceintensity = Turbulence intensity: simedtdlg.lbl.Turbulenceintensity = Turbulence intensity:
simedtdlg.lbl.ttip.Turbulenceintensity1 = <html>The turbulence intensity is the standard deviation divided by the average windspeed.<br> simedtdlg.lbl.ttip.Turbulenceintensity1 = <html>The turbulence intensity is the standard deviation divided by the average windspeed.<br>
@ -365,12 +367,17 @@ simedtdlg.lbl.ttip.Altitude = <html>The launch altitude above mean sea level.<br
simedtdlg.border.Launchrod = Launch rod simedtdlg.border.Launchrod = Launch rod
simedtdlg.lbl.Length = Length: simedtdlg.lbl.Length = Length:
simedtdlg.lbl.ttip.Length = The length of the launch rod. simedtdlg.lbl.ttip.Length = The length of the launch rod.
simedtdlg.checkbox.Intowind = Always launch directly up-wind or down-wind
simedtdlg.checkbox.ttip.Intowind1 = <html>Checking this box makes the launch rod point into the wind.<br>
simedtdlg.checkbox.ttip.Intowind2 = A zero launchrod angle will point directly up. <br>
simedtdlg.checkbox.ttip.Intowind3 = A negative launchrod angle will launch with the wind.<br>If you uncheck this box you can point the launchrod any direction you please.
simedtdlg.checkbox.ttip.Intowind4 = If you uncheck this box you can point the launchrod any direction you please.
simedtdlg.lbl.Angle = Angle: simedtdlg.lbl.Angle = Angle:
simedtdlg.lbl.ttip.Angle = The angle of the launch rod from vertical. simedtdlg.lbl.ttip.Angle = <html>The angle of the launch rod from vertical.<br> Positive angles point upwind.
simedtdlg.lbl.Direction = Direction: simedtdlg.lbl.Direction = Direction:
simedtdlg.lbl.ttip.Direction1 = <html>Direction of the launch rod relative to the wind.<br> simedtdlg.lbl.ttip.Direction1 = <html>Direction of the launch rod relative to the wind.<br>
simedtdlg.lbl.ttip.Direction2 = = towards the wind, simedtdlg.lbl.ttip.Direction2 = -
simedtdlg.lbl.ttip.Direction3 = = downwind. simedtdlg.lbl.ttip.Direction3 = 0 is North.
simedtdlg.border.Simopt = Simulator options simedtdlg.border.Simopt = Simulator options
simedtdlg.lbl.Calcmethod = Calculation method: simedtdlg.lbl.Calcmethod = Calculation method:
simedtdlg.lbl.ttip.Calcmethod = <html>The Extended Barrowman method calculates aerodynamic forces according <br>to the Barrowman equations extended to accommodate more components. simedtdlg.lbl.ttip.Calcmethod = <html>The Extended Barrowman method calculates aerodynamic forces according <br>to the Barrowman equations extended to accommodate more components.
@ -1484,8 +1491,8 @@ FlightDataType.TYPE_VELOCITY_Z = Vertical velocity
FlightDataType.TYPE_ACCELERATION_Z = Vertical acceleration FlightDataType.TYPE_ACCELERATION_Z = Vertical acceleration
FlightDataType.TYPE_VELOCITY_TOTAL = Total velocity FlightDataType.TYPE_VELOCITY_TOTAL = Total velocity
FlightDataType.TYPE_ACCELERATION_TOTAL = Total acceleration FlightDataType.TYPE_ACCELERATION_TOTAL = Total acceleration
FlightDataType.TYPE_POSITION_X = Position upwind FlightDataType.TYPE_POSITION_X = Position East of launch
FlightDataType.TYPE_POSITION_Y = Position parallel to wind FlightDataType.TYPE_POSITION_Y = Position North of launch
FlightDataType.TYPE_POSITION_XY = Lateral distance FlightDataType.TYPE_POSITION_XY = Lateral distance
FlightDataType.TYPE_POSITION_DIRECTION = Lateral direction FlightDataType.TYPE_POSITION_DIRECTION = Lateral direction
FlightDataType.TYPE_VELOCITY_XY = Lateral velocity FlightDataType.TYPE_VELOCITY_XY = Lateral velocity
@ -1543,6 +1550,7 @@ PlotConfiguration.Dragcoef = Drag coefficients vs. Mach number
PlotConfiguration.Rollcharacteristics = Roll characteristics PlotConfiguration.Rollcharacteristics = Roll characteristics
PlotConfiguration.Angleofattack = Angle of attack and orientation vs. time PlotConfiguration.Angleofattack = Angle of attack and orientation vs. time
PlotConfiguration.Simulationtime = Simulation time step and computation time PlotConfiguration.Simulationtime = Simulation time step and computation time
PlotConfiguration.Groundtrack = Ground track
! Warning ! Warning
Warning.LargeAOA.str1 = Large angle of attack encountered. Warning.LargeAOA.str1 = Large angle of attack encountered.

View File

@ -431,7 +431,7 @@ public class OpenRocketSaver extends RocketSaver {
writeElement("configid", cond.getMotorConfigurationID()); writeElement("configid", cond.getMotorConfigurationID());
writeElement("launchrodlength", cond.getLaunchRodLength()); writeElement("launchrodlength", cond.getLaunchRodLength());
writeElement("launchrodangle", cond.getLaunchRodAngle() * 180.0 / Math.PI); writeElement("launchrodangle", cond.getLaunchRodAngle() * 180.0 / Math.PI);
writeElement("launchroddirection", cond.getLaunchRodDirection() * 180.0 / Math.PI); writeElement("launchroddirection", cond.getLaunchRodDirection() * 360.0 / (2.0 * Math.PI));
writeElement("windaverage", cond.getWindSpeedAverage()); writeElement("windaverage", cond.getWindSpeedAverage());
writeElement("windturbulence", cond.getWindTurbulenceIntensity()); writeElement("windturbulence", cond.getWindTurbulenceIntensity());
writeElement("launchaltitude", cond.getLaunchAltitude()); writeElement("launchaltitude", cond.getLaunchAltitude());

View File

@ -70,7 +70,7 @@ class SimulationConditionsHandler extends AbstractElementHandler {
if (Double.isNaN(d)) { if (Double.isNaN(d)) {
warnings.add("Illegal launch rod direction defined, ignoring."); warnings.add("Illegal launch rod direction defined, ignoring.");
} else { } else {
conditions.setLaunchRodDirection(d * Math.PI / 180); conditions.setLaunchRodDirection(d * 2.0 * Math.PI / 360);
} }
} else if (element.equals("windaverage")) { } else if (element.equals("windaverage")) {
if (Double.isNaN(d)) { if (Double.isNaN(d)) {
@ -113,7 +113,7 @@ class SimulationConditionsHandler extends AbstractElementHandler {
} else if (element.equals("atmosphere")) { } else if (element.equals("atmosphere")) {
atmosphereHandler.storeSettings(conditions, warnings); atmosphereHandler.storeSettings(conditions, warnings);
} else if (element.equals("timestep")) { } else if (element.equals("timestep")) {
if (Double.isNaN(d) || d <= 0 ) { if (Double.isNaN(d) || d <= 0) {
warnings.add("Illegal time step defined, ignoring."); warnings.add("Illegal time step defined, ignoring.");
} else { } else {
conditions.setTimeStep(d); conditions.setTimeStep(d);

View File

@ -34,6 +34,7 @@ public class PinkNoiseWindModel implements WindModel {
private double average = 0; private double average = 0;
private double direction = Math.PI / 2; // this is an East wind
private double standardDeviation = 0; private double standardDeviation = 0;
private final int seed; private final int seed;
@ -74,7 +75,13 @@ public class PinkNoiseWindModel implements WindModel {
setTurbulenceIntensity(intensity); setTurbulenceIntensity(intensity);
} }
public void setDirection(double direction) {
this.direction = direction;
}
public double getDirection() {
return this.direction;
}
/** /**
* Return the standard deviation from the average wind speed. * Return the standard deviation from the average wind speed.
@ -150,8 +157,8 @@ public class PinkNoiseWindModel implements WindModel {
double a = (time - time1) / DELTA_T; double a = (time - time1) / DELTA_T;
double speed = average + (value1 * (1 - a) + value2 * a) * standardDeviation / STDDEV; double speed = average + (value1 * (1 - a) + value2 * a) * standardDeviation / STDDEV;
// TODO: MEDIUM: Make wind direction configurable return new Coordinate(speed * Math.sin(direction), speed * Math.cos(direction), 0);
return new Coordinate(speed, 0, 0);
} }

View File

@ -70,13 +70,13 @@ public class RK4SimulationStepper extends AbstractSimulationStepper {
RK4SimulationStatus status = new RK4SimulationStatus(original); RK4SimulationStatus status = new RK4SimulationStatus(original);
// Copy the existing warnings // Copy the existing warnings
status.setWarnings( original.getWarnings() ); status.setWarnings(original.getWarnings());
SimulationConditions sim = original.getSimulationConditions(); SimulationConditions sim = original.getSimulationConditions();
status.setLaunchRodDirection(new Coordinate( status.setLaunchRodDirection(new Coordinate(
Math.sin(sim.getLaunchRodAngle()) * Math.cos(sim.getLaunchRodDirection()), Math.sin(sim.getLaunchRodAngle()) * Math.cos(Math.PI / 2.0 - sim.getLaunchRodDirection()),
Math.sin(sim.getLaunchRodAngle()) * Math.sin(sim.getLaunchRodDirection()), Math.sin(sim.getLaunchRodAngle()) * Math.sin(Math.PI / 2.0 - sim.getLaunchRodDirection()),
Math.cos(sim.getLaunchRodAngle()) Math.cos(sim.getLaunchRodAngle())
)); ));

View File

@ -35,7 +35,7 @@ public class SimulationConditions implements Monitorable, Cloneable {
/** Launch rod angle >= 0, radians from vertical */ /** Launch rod angle >= 0, radians from vertical */
private double launchRodAngle = 0; private double launchRodAngle = 0;
/** Launch rod direction, 0 = upwind, PI = downwind. */ /** Launch rod direction, 0 = north */
private double launchRodDirection = 0; private double launchRodDirection = 0;
// TODO: Depreciate these and use worldCoordinate only. // TODO: Depreciate these and use worldCoordinate only.

View File

@ -59,17 +59,19 @@ public class SimulationOptions implements ChangeSource, Cloneable {
private double launchRodLength = 1; private double launchRodLength = 1;
/** Launch rod angle > 0, radians from vertical */ /** Keep launch rod parallel to wind*/
private boolean launchIntoWind = true;
/** Launch rod angle, |radians|<90 from vertical, positive is upwind, negative is downwind */
private double launchRodAngle = 0; private double launchRodAngle = 0;
/** Launch rod direction, 0 = upwind, PI = downwind. */ /** Launch rod direction, 0 = north. */
private double windDirection = Math.PI / 2;
private double launchRodDirection = 0; private double launchRodDirection = 0;
private double windAverage = 2.0; private double windAverage = 2.0;
private double windTurbulence = 0.1; private double windTurbulence = 0.1;
/* /*
* SimulationOptions maintains the launch site parameters as separate double values, * SimulationOptions maintains the launch site parameters as separate double values,
* and converts them into a WorldCoordinate when converting to SimulationConditions. * and converts them into a WorldCoordinate when converting to SimulationConditions.
@ -139,12 +141,20 @@ public class SimulationOptions implements ChangeSource, Cloneable {
} }
public boolean getLaunchIntoWind() {
return launchIntoWind;
}
public void setLaunchIntoWind(boolean i) {
launchIntoWind = i;
}
public double getLaunchRodAngle() { public double getLaunchRodAngle() {
return launchRodAngle; return launchRodAngle;
} }
public void setLaunchRodAngle(double launchRodAngle) { public void setLaunchRodAngle(double launchRodAngle) {
launchRodAngle = MathUtil.clamp(launchRodAngle, 0, MAX_LAUNCH_ROD_ANGLE); launchRodAngle = MathUtil.clamp(launchRodAngle, -MAX_LAUNCH_ROD_ANGLE, MAX_LAUNCH_ROD_ANGLE);
if (MathUtil.equals(this.launchRodAngle, launchRodAngle)) if (MathUtil.equals(this.launchRodAngle, launchRodAngle))
return; return;
this.launchRodAngle = launchRodAngle; this.launchRodAngle = launchRodAngle;
@ -153,11 +163,14 @@ public class SimulationOptions implements ChangeSource, Cloneable {
public double getLaunchRodDirection() { public double getLaunchRodDirection() {
if (launchIntoWind) {
this.setLaunchRodDirection(windDirection);
}
return launchRodDirection; return launchRodDirection;
} }
public void setLaunchRodDirection(double launchRodDirection) { public void setLaunchRodDirection(double launchRodDirection) {
launchRodDirection = MathUtil.reduce180(launchRodDirection); launchRodDirection = MathUtil.reduce360(launchRodDirection);
if (MathUtil.equals(this.launchRodDirection, launchRodDirection)) if (MathUtil.equals(this.launchRodDirection, launchRodDirection))
return; return;
this.launchRodDirection = launchRodDirection; this.launchRodDirection = launchRodDirection;
@ -211,8 +224,28 @@ public class SimulationOptions implements ChangeSource, Cloneable {
} }
/**
* Set the wind direction
*
* @param direction the wind direction
*/
public void setWindDirection(double direction) {
direction = MathUtil.reduce360(direction);
if (launchIntoWind) {
this.setLaunchRodDirection(direction);
}
if (MathUtil.equals(this.windDirection, direction))
return;
this.windDirection = direction;
fireChangeEvent();
}
public double getWindDirection() {
return this.windDirection;
}
public double getLaunchAltitude() { public double getLaunchAltitude() {
return launchAltitude; return launchAltitude;
@ -446,6 +479,7 @@ public class SimulationOptions implements ChangeSource, Cloneable {
this.timeStep = src.timeStep; this.timeStep = src.timeStep;
this.windAverage = src.windAverage; this.windAverage = src.windAverage;
this.windTurbulence = src.windTurbulence; this.windTurbulence = src.windTurbulence;
this.windDirection = src.windDirection;
this.calculateExtras = src.calculateExtras; this.calculateExtras = src.calculateExtras;
this.randomSeed = src.randomSeed; this.randomSeed = src.randomSeed;
@ -501,6 +535,10 @@ public class SimulationOptions implements ChangeSource, Cloneable {
isChanged = true; isChanged = true;
this.windAverage = src.windAverage; this.windAverage = src.windAverage;
} }
if (this.windDirection != src.windDirection) {
isChanged = true;
this.windDirection = src.windDirection;
}
if (this.windTurbulence != src.windTurbulence) { if (this.windTurbulence != src.windTurbulence) {
isChanged = true; isChanged = true;
this.windTurbulence = src.windTurbulence; this.windTurbulence = src.windTurbulence;
@ -542,6 +580,7 @@ public class SimulationOptions implements ChangeSource, Cloneable {
MathUtil.equals(this.timeStep, o.timeStep) && MathUtil.equals(this.timeStep, o.timeStep) &&
MathUtil.equals(this.windAverage, o.windAverage) && MathUtil.equals(this.windAverage, o.windAverage) &&
MathUtil.equals(this.windTurbulence, o.windTurbulence) && MathUtil.equals(this.windTurbulence, o.windTurbulence) &&
MathUtil.equals(this.windDirection, o.windDirection) &&
this.calculateExtras == o.calculateExtras && this.randomSeed == o.randomSeed); this.calculateExtras == o.calculateExtras && this.randomSeed == o.randomSeed);
} }
@ -595,6 +634,8 @@ public class SimulationOptions implements ChangeSource, Cloneable {
PinkNoiseWindModel windModel = new PinkNoiseWindModel(randomSeed); PinkNoiseWindModel windModel = new PinkNoiseWindModel(randomSeed);
windModel.setAverage(getWindSpeedAverage()); windModel.setAverage(getWindSpeedAverage());
windModel.setStandardDeviation(getWindSpeedDeviation()); windModel.setStandardDeviation(getWindSpeedDeviation());
windModel.setDirection(windDirection);
conditions.setWindModel(windModel); conditions.setWindModel(windModel);
conditions.setAtmosphericModel(getAtmosphericModel()); conditions.setAtmosphericModel(getAtmosphericModel());

View File

@ -103,12 +103,12 @@ public class SimulationStatus implements Monitorable {
Quaternion o; Quaternion o;
FlightConditions cond = new FlightConditions(this.configuration); FlightConditions cond = new FlightConditions(this.configuration);
this.simulationConditions.getAerodynamicCalculator().getWorstCP(this.configuration, cond, null); this.simulationConditions.getAerodynamicCalculator().getWorstCP(this.configuration, cond, null);
double angle = -cond.getTheta() - this.simulationConditions.getLaunchRodDirection(); double angle = -cond.getTheta() - (Math.PI / 2.0 - this.simulationConditions.getLaunchRodDirection());
o = Quaternion.rotation(new Coordinate(0, 0, angle)); o = Quaternion.rotation(new Coordinate(0, 0, angle));
// Launch rod angle and direction // Launch rod angle and direction
o = o.multiplyLeft(Quaternion.rotation(new Coordinate(0, this.simulationConditions.getLaunchRodAngle(), 0))); o = o.multiplyLeft(Quaternion.rotation(new Coordinate(0, this.simulationConditions.getLaunchRodAngle(), 0)));
o = o.multiplyLeft(Quaternion.rotation(new Coordinate(0, 0, this.simulationConditions.getLaunchRodDirection()))); o = o.multiplyLeft(Quaternion.rotation(new Coordinate(0, 0, Math.PI / 2.0 - this.simulationConditions.getLaunchRodDirection())));
this.orientation = o; this.orientation = o;
this.rotationVelocity = Coordinate.NUL; this.rotationVelocity = Coordinate.NUL;

View File

@ -68,6 +68,18 @@ public class PlotConfiguration implements Cloneable {
config.setEvent(FlightEvent.Type.EXCEPTION, true); config.setEvent(FlightEvent.Type.EXCEPTION, true);
configs.add(config); configs.add(config);
//// Ground track
config = new PlotConfiguration(trans.get("PlotConfiguration.Groundtrack"), FlightDataType.TYPE_POSITION_X);
config.addPlotDataType(FlightDataType.TYPE_POSITION_Y, 0);
config.addPlotDataType(FlightDataType.TYPE_ALTITUDE, 1);
config.setEvent(FlightEvent.Type.IGNITION, true);
config.setEvent(FlightEvent.Type.BURNOUT, true);
config.setEvent(FlightEvent.Type.APOGEE, true);
config.setEvent(FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT, true);
config.setEvent(FlightEvent.Type.GROUND_HIT, true);
configs.add(config);
//// Stability vs. time //// Stability vs. time
config = new PlotConfiguration(trans.get("PlotConfiguration.Stability")); config = new PlotConfiguration(trans.get("PlotConfiguration.Stability"));
config.addPlotDataType(FlightDataType.TYPE_STABILITY, 0); config.addPlotDataType(FlightDataType.TYPE_STABILITY, 0);

View File

@ -43,7 +43,7 @@ public class SimulationConditionsPanel extends JPanel {
DoubleModel m; DoubleModel m;
JSpinner spin; JSpinner spin;
//// Wind settings: Average wind speed, turbulence intensity, std. deviation //// Wind settings: Average wind speed, turbulence intensity, std. deviation, and direction
sub = new JPanel(new MigLayout("fill, gap rel unrel", sub = new JPanel(new MigLayout("fill, gap rel unrel",
"[grow][65lp!][30lp!][75lp!]", "")); "[grow][65lp!][30lp!][75lp!]", ""));
//// Wind //// Wind
@ -100,6 +100,30 @@ public class SimulationConditionsPanel extends JPanel {
slider.setToolTipText(tip); slider.setToolTipText(tip);
sub.add(slider, "w 75lp, wrap"); sub.add(slider, "w 75lp, wrap");
// Wind Direction:
label = new JLabel(trans.get("simedtdlg.lbl.Winddirection"));
//// Direction of the wind. 0 is north
tip = trans.get("simedtdlg.lbl.ttip.Winddirection");
label.setToolTipText(tip);
sub.add(label);
m = new DoubleModel(conditions, "WindDirection", 1.0, UnitGroup.UNITS_ANGLE,
0, 2*Math.PI);
spin = new JSpinner(m.getSpinnerModel());
spin.setEditor(new SpinnerEditor(spin));
spin.setToolTipText(tip);
sub.add(spin, "w 65lp!");
unit = new UnitSelector(m);
unit.setToolTipText(tip);
sub.add(unit, "growx");
slider = new BasicSlider(m.getSliderModel(0, 2*Math.PI));
slider.setToolTipText(tip);
sub.add(slider, "w 75lp, wrap");
// Wind turbulence intensity // Wind turbulence intensity
//// Turbulence intensity: //// Turbulence intensity:
@ -328,6 +352,18 @@ public class SimulationConditionsPanel extends JPanel {
slider.setToolTipText(tip); slider.setToolTipText(tip);
sub.add(slider, "w 75lp, wrap"); sub.add(slider, "w 75lp, wrap");
// Keep launch rod parallel to the wind.
BooleanModel intoWind = new BooleanModel(conditions, "LaunchIntoWind");
JCheckBox checkWind = new JCheckBox(intoWind);
//// Use International Standard Atmosphere
checkWind.setText(trans.get("simedtdlg.checkbox.Intowind"));
checkWind.setToolTipText(
trans.get("simedtdlg.checkbox.ttip.Intowind1") +
trans.get("simedtdlg.checkbox.ttip.Intowind2") +
trans.get("simedtdlg.checkbox.ttip.Intowind3") +
trans.get("simedtdlg.checkbox.ttip.Intowind4"));
sub.add(checkWind, "spanx, wrap unrel");
// Angle: // Angle:
@ -338,7 +374,7 @@ public class SimulationConditionsPanel extends JPanel {
sub.add(label); sub.add(label);
m = new DoubleModel(conditions, "LaunchRodAngle", UnitGroup.UNITS_ANGLE, m = new DoubleModel(conditions, "LaunchRodAngle", UnitGroup.UNITS_ANGLE,
0, SimulationOptions.MAX_LAUNCH_ROD_ANGLE); -SimulationOptions.MAX_LAUNCH_ROD_ANGLE, SimulationOptions.MAX_LAUNCH_ROD_ANGLE);
spin = new JSpinner(m.getSpinnerModel()); spin = new JSpinner(m.getSpinnerModel());
spin.setEditor(new SpinnerEditor(spin)); spin.setEditor(new SpinnerEditor(spin));
@ -348,7 +384,7 @@ public class SimulationConditionsPanel extends JPanel {
unit = new UnitSelector(m); unit = new UnitSelector(m);
unit.setToolTipText(tip); unit.setToolTipText(tip);
sub.add(unit, "growx"); sub.add(unit, "growx");
slider = new BasicSlider(m.getSliderModel(0, Math.PI / 9, slider = new BasicSlider(m.getSliderModel(-SimulationOptions.MAX_LAUNCH_ROD_ANGLE, 0,
SimulationOptions.MAX_LAUNCH_ROD_ANGLE)); SimulationOptions.MAX_LAUNCH_ROD_ANGLE));
slider.setToolTipText(tip); slider.setToolTipText(tip);
sub.add(slider, "w 75lp, wrap"); sub.add(slider, "w 75lp, wrap");
@ -356,32 +392,38 @@ public class SimulationConditionsPanel extends JPanel {
// Direction: // Direction:
label = new JLabel(trans.get("simedtdlg.lbl.Direction")); JLabel directionLabel = new JLabel(trans.get("simedtdlg.lbl.Direction"));
//// <html>Direction of the launch rod relative to the wind.<br> //// <html>Direction of the launch rod.
//// = towards the wind,
//// = downwind.
tip = trans.get("simedtdlg.lbl.ttip.Direction1") + tip = trans.get("simedtdlg.lbl.ttip.Direction1") +
UnitGroup.UNITS_ANGLE.toStringUnit(0) + UnitGroup.UNITS_ANGLE.toStringUnit(0) +
" " + trans.get("simedtdlg.lbl.ttip.Direction2") + " " + " " + trans.get("simedtdlg.lbl.ttip.Direction2") + " " +
UnitGroup.UNITS_ANGLE.toStringUnit(Math.PI) + UnitGroup.UNITS_ANGLE.toStringUnit(2*Math.PI) +
" " + trans.get("simedtdlg.lbl.ttip.Direction3"); " " + trans.get("simedtdlg.lbl.ttip.Direction3");
label.setToolTipText(tip); directionLabel.setToolTipText(tip);
sub.add(label); sub.add(directionLabel);
m = new DoubleModel(conditions, "LaunchRodDirection", UnitGroup.UNITS_ANGLE, m = new DoubleModel(conditions, "LaunchRodDirection", 1.0, UnitGroup.UNITS_ANGLE,
-Math.PI, Math.PI); 0, 2*Math.PI);
spin = new JSpinner(m.getSpinnerModel()); JSpinner directionSpin = new JSpinner(m.getSpinnerModel());
spin.setEditor(new SpinnerEditor(spin)); directionSpin.setEditor(new SpinnerEditor(directionSpin));
spin.setToolTipText(tip); directionSpin.setToolTipText(tip);
sub.add(spin, "w 65lp!"); sub.add(directionSpin, "w 65lp!");
unit = new UnitSelector(m); unit = new UnitSelector(m);
unit.setToolTipText(tip); unit.setToolTipText(tip);
sub.add(unit, "growx"); sub.add(unit, "growx");
slider = new BasicSlider(m.getSliderModel(-Math.PI, Math.PI)); BasicSlider directionSlider = new BasicSlider(m.getSliderModel(0, 2*Math.PI));
slider.setToolTipText(tip); directionSlider.setToolTipText(tip);
sub.add(slider, "w 75lp, wrap"); sub.add(directionSlider, "w 75lp, wrap");
intoWind.addEnableComponent(directionLabel, false);
intoWind.addEnableComponent(directionSpin, false);
intoWind.addEnableComponent(unit, false);
intoWind.addEnableComponent(directionSlider, false);
JButton restoreDefaults = new JButton(trans.get("simedtdlg.but.resettodefault")); JButton restoreDefaults = new JButton(trans.get("simedtdlg.but.resettodefault"));
restoreDefaults.addActionListener(new ActionListener() { restoreDefaults.addActionListener(new ActionListener() {