|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuavsim.graphics.instruments.A_Instrument
uavsim.graphics.instruments.A_CircularInstrument<GenericValue>
uavsim.graphics.instruments.turncoordinator.TurnCoordinator
public class TurnCoordinator
Defines a standard turn coordinator to depict rate of turn in degrees per second against a standard rate of three degrees per second. It also shows the slip/skid coordination ball.
| Field Summary | |
|---|---|
private Airspeed |
_airspeed
the airspeed |
private Attitude |
_attitude
the attitude |
private Course |
_course
the course |
private static java.awt.Color |
AIRPLANE_COLOR
the color of the airplane |
private static Scaler |
AIRPLANE_DOT_SCALE
the size scale of the airplane center dot relative to the instrument size |
private static Scaler |
AIRPLANE_LINE_END_SCALE
the position scale of the airplane wing lines relative to the instrument center |
private static Scaler |
AIRPLANE_LINE_SCALE
the weight scale of the airplane wing lines relative to the instrument size |
private static double |
AIRPLANE_WING_DEVIATION
an empirically determined coefficient to align the airplane wings with the rate of turn |
private static Scaler |
ARC_INNER_RADIUS_SCALE
the size scale of the arc inner radius relative to the instrument size |
private static Scaler |
ARC_OUTER_RADIUS_SCALE
the size scale of the arc outer radius relative to the instrument size |
private static java.awt.Color |
BALL_COLOR
the color of the slip/skid ball |
private static AngleMathematical |
BALL_LINE_ANGLE_LEFT
the angle of the left line of the ball cage |
private static AngleMathematical |
BALL_LINE_ANGLE_RIGHT
the angle of the right line of the ball cage |
private static java.awt.Color |
BALL_LINE_COLOR
the color of the coordination cage for the ball |
private static Scaler |
BALL_LINE_SCALE
the size scale of the ball line relative to the instrument size |
private static Scaler |
BALL_SCALE
the size scale of the ball relative to the instrument size |
private static int |
BALL_SKEW_SCALE
an empirically determined ratio to convert the coordination factor to the ball angle |
private static double |
COORDINATION_YAW_SCALE
an empirically determined coefficient to infer the coordination fraction from the yaw |
private static double |
STANDARD_RATE
the degrees per second in a standard-rate turn |
private static double |
STANDARD_RATE_MAX
the maximum clockwise degrees per second to depict |
private static double |
STANDARD_RATE_MIN
the maximum counterclockwise degrees per second to depict |
private static AngleMathematical |
TICK_ANGLE_LEVEL_LEFT
the left tick angle for level flight |
private static AngleMathematical |
TICK_ANGLE_LEVEL_RIGHT
the right tick angle for level flight |
private static AngleMathematical |
TICK_ANGLE_STANDARD_LEFT
the left tick angle for a standard-rate turn |
private static AngleMathematical |
TICK_ANGLE_STANDARD_RIGHT
the right tick angle for a standard-rate turn |
private static java.awt.Color |
TICK_COLOR
the color of the ticks |
private static Scaler |
TICK_LINE_SCALE
the size scale of the tick lines relative to the instrument size |
private static java.awt.Color |
TUBE_COLOR
the color of the ball tube |
private static GenericValue |
TUBE_END_PADDING_NEGATIVE
the angle-mapped arc interval for the start of the ball tube |
private static GenericValue |
TUBE_END_PADDING_POSITIVE
the angle-mapped arc interval for the end of the ball tube |
private static Scaler |
TUBE_RADIUS_INNER_SCALE
the size scale of the tube inner radius relative to the instrument size |
private static Scaler |
TUBE_RADIUS_OUTER_SCALE
the size scale of the tube outer radius relative to the instrument size |
private static Scaler |
TUBE_RADIUS_POSITION_SCALE
the position scale of the tube anchor relative to the instrument center |
private static double |
UNCOORDINATION_MAX
the maximum amount of positive uncoordination as a percent angle-mapped by a GenericValue |
private static double |
UNCOORDINATION_MIN
the maximum amount of negative uncoordination as a percent angle-mapped by a GenericValue |
| Fields inherited from class uavsim.graphics.instruments.A_CircularInstrument |
|---|
_ringSize, DISK_COLOR, MOUNT_RING_COLOR, MOUNT_RING_INNER_SCALE |
| Fields inherited from class uavsim.graphics.instruments.A_Instrument |
|---|
_canvasAnchor, _canvasSize, _graphics, _id |
| Constructor Summary | |
|---|---|
TurnCoordinator(java.lang.String id,
int canvasSize,
CoordinateCartesianAbsolute canvasAnchor)
Creates a turn coordinator. |
|
| Method Summary | |
|---|---|
double |
calculateTurnRateDegreesPerSecond()
Gets the rate of turn as degrees per second based on the current bank angle and airspeed. |
double |
calculateTurnRateMultipleOfStandard()
Gets the rate of turn as multiples of standard rate (three degrees per second) based on the current bank angle and airspeed. |
private double |
clampStandardRate(double degreesPerSecond)
Clamps the rate of turn to the defined limits. |
Airspeed |
getAirspeed()
Gets the airspeed in knots. |
Attitude |
getAttitude()
Gets the attitude. |
double |
getCoordinationFraction()
Gets the ratio of coordinated flight on the clamped interval [-1.0,+1.0], where 0 is coordinated, negative is ball left, and positive is ball right. |
Course |
getCourse()
Gets the course. |
private double |
getYawDerived()
Returns the derived yaw as the difference between the course and heading. |
AngleMathematical |
mapAngle_(GenericValue coordinationFraction)
Returns the angle corresponding to the value of a unit. |
void |
render(java.awt.Graphics graphics)
Renders the current state of the instrument. |
private void |
renderMiniaturePlane()
Renders the miniature airplane. |
private void |
renderTicks()
Renders the standard-rate ticks. |
private void |
renderTubeAndBall()
Renders the slip/skid tube and ball. |
java.lang.String |
toString()
|
void |
update(Attitude attitude,
Course course,
Airspeed airspeed)
Updates the state of the instrument without rendering it. |
| Methods inherited from class uavsim.graphics.instruments.A_CircularInstrument |
|---|
mapAngle, renderDisk, renderMountRing |
| Methods inherited from class uavsim.graphics.instruments.A_Instrument |
|---|
getAnchor, getCanvasSize, getGraphics, getID, getParentComponent, handleControlCallback, hasControls, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, refresh, registerControl, setCanvasAnchor, setCanvasSize, setParentComponent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private Airspeed _airspeed
private Attitude _attitude
private Course _course
private static final java.awt.Color AIRPLANE_COLOR
private static final Scaler AIRPLANE_DOT_SCALE
private static final Scaler AIRPLANE_LINE_END_SCALE
private static final Scaler AIRPLANE_LINE_SCALE
private static final double AIRPLANE_WING_DEVIATION
private static final Scaler ARC_INNER_RADIUS_SCALE
private static final Scaler ARC_OUTER_RADIUS_SCALE
private static final java.awt.Color BALL_COLOR
private static final AngleMathematical BALL_LINE_ANGLE_LEFT
private static final AngleMathematical BALL_LINE_ANGLE_RIGHT
private static final java.awt.Color BALL_LINE_COLOR
private static final Scaler BALL_LINE_SCALE
private static final Scaler BALL_SCALE
private static final int BALL_SKEW_SCALE
private static final double COORDINATION_YAW_SCALE
private static final double STANDARD_RATE
private static final double STANDARD_RATE_MAX
private static final double STANDARD_RATE_MIN
private static final AngleMathematical TICK_ANGLE_LEVEL_LEFT
private static final AngleMathematical TICK_ANGLE_LEVEL_RIGHT
private static final AngleMathematical TICK_ANGLE_STANDARD_LEFT
private static final AngleMathematical TICK_ANGLE_STANDARD_RIGHT
private static final java.awt.Color TICK_COLOR
private static final Scaler TICK_LINE_SCALE
private static final java.awt.Color TUBE_COLOR
private static final GenericValue TUBE_END_PADDING_NEGATIVE
private static final GenericValue TUBE_END_PADDING_POSITIVE
private static final Scaler TUBE_RADIUS_INNER_SCALE
private static final Scaler TUBE_RADIUS_OUTER_SCALE
private static final Scaler TUBE_RADIUS_POSITION_SCALE
private static final double UNCOORDINATION_MAX
private static final double UNCOORDINATION_MIN
| Constructor Detail |
|---|
public TurnCoordinator(java.lang.String id,
int canvasSize,
CoordinateCartesianAbsolute canvasAnchor)
id - - the unique instrument identifiercanvasSize - - the square size of the instrument footprint in pixelscanvasAnchor - - the anchor position for the center of the canvas in pixels| Method Detail |
|---|
public double calculateTurnRateDegreesPerSecond()
public double calculateTurnRateMultipleOfStandard()
private double clampStandardRate(double degreesPerSecond)
degreesPerSecond - - the rate
public Airspeed getAirspeed()
public Attitude getAttitude()
public double getCoordinationFraction()
public Course getCourse()
private double getYawDerived()
public AngleMathematical mapAngle_(GenericValue coordinationFraction)
coordinationFraction - - the unit
public void render(java.awt.Graphics graphics)
render in class A_CircularInstrument<GenericValue>graphics - - the graphics contextprivate void renderMiniaturePlane()
private void renderTicks()
private void renderTubeAndBall()
public java.lang.String toString()
toString in class java.lang.Object
public void update(Attitude attitude,
Course course,
Airspeed airspeed)
attitude - - the attitudecourse - - the courseairspeed - - the airspeed
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||