|
|||||||||
| 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.directionalgyro.A_DirectionalGyro
uavsim.graphics.instruments.directionalgyro.DirectionalGyro
public class DirectionalGyro
Defines a standard directional-gyro instrument.
| Field Summary | |
|---|---|
private AngleNavigational |
_headingActual
the actual heading |
private AngleNavigational |
_headingDesired
the desired heading for the autopilot |
private Knob |
_knob
the heading knob |
private static KnobProperties |
_knobProperties
the knob properties |
private static double[][] |
AIRPLANE
the polygon description of the airplane |
private static java.awt.Color |
AIRPLANE_COLOR
the color of the airplane glyph |
private static double |
AIRPLANE_SCALE
the size scale of the airplane relative to the instrument |
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 NeedleDescriptor |
FIXED_BUG
the fixed-bug descriptor |
private static double[] |
FIXED_BUG_ANGLES
the angles of the fixed bugs |
private static TextProperties |
KNOB_LABEL_PROPERTIES
the text properties of the knob label |
private static AngleNavigational |
KNOB_STEP
the step value for changing the heading |
private static TickDescriptor<AngleNavigational> |
MAJOR_TICKS
the major-ticks descriptor |
private static TickDescriptor<AngleNavigational> |
MINOR_TICKS
the minor-ticks descriptor |
private static NeedleDescriptor |
MOVEABLE_BUG
the moveable-bug descriptor |
private static NeedleDescriptor |
NEEDLE
the needle descriptor |
private static 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 | |
|---|---|
DirectionalGyro(java.lang.String id,
int canvasSize,
CoordinateCartesianAbsolute canvasAnchor)
Creates a directional gyro. |
|
| Method Summary | |
|---|---|
private void |
configureKnob()
Configures the knob. |
private void |
configureNumbers()
Configures the numbers. |
AngleNavigational |
getHeadingActual()
Gets the actual heading. |
AngleNavigational |
getHeadingDesired()
Gets the desired heading for the autopilot. |
Knob |
getKnob()
Gets the knob. |
void |
handleControlCallback(ControlCallbackEvent event)
Handles an event from a registered control. |
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 |
renderAirplane()
Renders the needle. |
private void |
renderBugs()
Renders the bugs. |
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(AngleNavigational azimuthActual)
Updates the state of the instrument without rendering it. |
void |
update(AngleNavigational azimuthActual,
AngleNavigational azimuthDesired)
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 _headingActual
private AngleNavigational _headingDesired
private final Knob _knob
private static final KnobProperties _knobProperties
private static final double[][] AIRPLANE
private static final java.awt.Color AIRPLANE_COLOR
private static final double AIRPLANE_SCALE
private static final AngleNavigational AZIMUTH_END
private static final AngleNavigational AZIMUTH_START
private static final NeedleDescriptor FIXED_BUG
private static final double[] FIXED_BUG_ANGLES
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 MOVEABLE_BUG
private static final NeedleDescriptor NEEDLE
private static final NumberDescriptor<AngleNavigational> NUMBERS
private static final TextProperties NUMBERS_TEXT
| Constructor Detail |
|---|
public DirectionalGyro(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 |
|---|
private void configureKnob()
private void configureNumbers()
public AngleNavigational getHeadingActual()
getHeadingActual in class A_DirectionalGyropublic AngleNavigational getHeadingDesired()
getHeadingDesired in class A_DirectionalGyropublic Knob getKnob()
public void handleControlCallback(ControlCallbackEvent event)
handleControlCallback in class A_Instrumentevent - - the callback eventpublic 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 renderAirplane()
private void renderBugs()
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(AngleNavigational azimuthActual)
azimuthActual - - the actual azimuth for heading
public void update(AngleNavigational azimuthActual,
AngleNavigational azimuthDesired)
azimuthActual - - the actual azimuth for headingazimuthDesired - - the desired azimuth for autopilot course
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||