|
|||||||||
| 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<AngleNavigational>
uavsim.graphics.instruments.automaticdirectionfinder.AutomaticDirectionFinder
public class AutomaticDirectionFinder
Defines a standard fixed-card or moveable-card directional-gyro instrument.
| Field Summary | |
|---|---|
private AngleNavigational |
_bearingRelative
the bearing to the station |
private AngleNavigational |
_heading
the heading |
private boolean |
_isMoveableCard
whether this is a moveable-card ADF |
private Knob |
_knob
the heading knob |
private static KnobProperties |
_knobProperties
the knob properties |
private static AngleNavigational |
AZIMUTH_END
the end angle of the azimuth numbers |
private static AngleNavigational |
AZIMUTH_START
the start angle of the azimuth numbers |
private static AngleNavigational |
DRIFT_DEVIATION
the amount of random needle drift |
private static double |
DRIFT_RANDOM_BUCKET
the distribution of needle movements as a percent. |
private static NeedleDescriptor |
HEADING_BUG
the heading bug |
private static TextProperties |
KNOB_LABEL_PROPERTIES
the knob label properties |
private static AngleNavigational |
KNOB_STEP
the step value for changing the azimuth |
private static TickDescriptor<AngleNavigational> |
MAJOR_TICKS
the descriptor for the major ticks |
private static TickDescriptor<AngleNavigational> |
MINOR_TICKS
the descriptor for the minor ticks |
private static NeedleDescriptor |
NEEDLE_FROM
the from-needle descriptor |
private static NeedleDescriptor |
NEEDLE_TO
the to-needle descriptor |
private NumberDescriptor<AngleNavigational> |
NUMBERS
the numbers descriptor |
private static TextProperties |
NUMBERS_TEXT
the text properties of the numbers |
| 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 | |
|---|---|
AutomaticDirectionFinder(java.lang.String id,
int canvasSize,
CoordinateCartesianAbsolute canvasAnchor,
boolean isMoveableCard)
Creates an ADF instrument. |
|
| Method Summary | |
|---|---|
AngleNavigational |
calculateBearingAbsolute()
Gets the absolute bearing to the station. |
AngleNavigational |
calculateBearingRelative()
Gets the relative bearing to the station. |
private void |
configureKnob()
Configures the knobs. |
private void |
configureNumbers()
Configures the numbers. |
private AngleNavigational |
drift(AngleNavigational bearing)
Perturbs a deviation by a random drift. |
AngleNavigational |
getHeading()
Gets the heading dialed into the card. |
Knob |
getKnob()
Gets the knob. |
void |
handleControlCallback(ControlCallbackEvent event)
Handles an event from a registered control. |
boolean |
isMoveableCard()
Returns whether this is a moveable-card ADF. |
AngleMathematical |
mapAngle_(AngleNavigational azimuth)
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 |
renderHeadingBug()
Renders the heading bug. |
private void |
renderKnob()
Renders the knob. |
private void |
renderNeedle()
Renders the needle. |
private void |
renderNumbers()
Renders the numbers. |
private void |
renderTicks()
Renders the minor, medium, and major ticks. |
java.lang.String |
toString()
|
void |
update()
Updates the state of the instrument without rendering it. |
void |
update(AngleNavigational bearingRelative)
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, 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 AngleNavigational _bearingRelative
private AngleNavigational _heading
private final boolean _isMoveableCard
private final Knob _knob
private static final KnobProperties _knobProperties
private static final AngleNavigational AZIMUTH_END
private static final AngleNavigational AZIMUTH_START
private static final AngleNavigational DRIFT_DEVIATION
private static final double DRIFT_RANDOM_BUCKET
private static final NeedleDescriptor HEADING_BUG
private static final TextProperties KNOB_LABEL_PROPERTIES
private static final AngleNavigational KNOB_STEP
private static final TickDescriptor<AngleNavigational> MAJOR_TICKS
private static final TickDescriptor<AngleNavigational> MINOR_TICKS
private static final NeedleDescriptor NEEDLE_FROM
private static final NeedleDescriptor NEEDLE_TO
private final NumberDescriptor<AngleNavigational> NUMBERS
private static final TextProperties NUMBERS_TEXT
| Constructor Detail |
|---|
public AutomaticDirectionFinder(java.lang.String id,
int canvasSize,
CoordinateCartesianAbsolute canvasAnchor,
boolean isMoveableCard)
id - - the unique instrument identifiercanvasSize - - the square size of the instrument footprint in pixelscanvasAnchor - - the anchor position for the center of the canvas in pixelsisMoveableCard - - whether this is a moveable- or fixed-card ADF| Method Detail |
|---|
public AngleNavigational calculateBearingAbsolute()
public AngleNavigational calculateBearingRelative()
private void configureKnob()
private void configureNumbers()
private AngleNavigational drift(AngleNavigational bearing)
bearing - - the bearing
public AngleNavigational getHeading()
public Knob getKnob()
public void handleControlCallback(ControlCallbackEvent event)
handleControlCallback in class A_Instrumentevent - - the callback eventpublic boolean isMoveableCard()
public AngleMathematical mapAngle_(AngleNavigational azimuth)
azimuth - - the unit
public void render(java.awt.Graphics graphics)
render in class A_CircularInstrument<AngleNavigational>graphics - - the graphics contextprivate void renderHeadingBug()
private void renderKnob()
private void renderNeedle()
private void renderNumbers()
private void renderTicks()
public java.lang.String toString()
toString in class java.lang.Objectpublic void update()
public void update(AngleNavigational bearingRelative)
bearingRelative - - the relative bearing to the station
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||