|
|||||||||
| 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.horizontalsituationindicator.HorizontalSituationIndicator
public class HorizontalSituationIndicator
Defines a horizontal situation indicator (HSI).
| Field Summary | |
|---|---|
private AngleNavigational |
_courseDesired
the desired course as defined by the OBS |
private Deviation |
_glideslopeDeviation
the deviation of the glideslope needle from center |
private boolean |
_isGlideslopeAlive
whether the glideslope is alive |
private boolean |
_isLocalizerAlive
whether the localizer is alive |
private boolean |
_isToOrFromStation
whether the CDI is pointing TO a station; otherwise FROM |
private Knob |
_knobHeading
the heading knob |
private static KnobProperties |
_knobHeadingProperties
zzz |
private Knob |
_knobOBS
the OBS knob |
private static KnobProperties |
_knobOBSProperties
the knob properties |
private Deviation |
_localizerDeviation
the deviation of the localizer needle from center |
private static Ring |
_ringInner
zzz |
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 |
COURSE_BUG
the bug for course and reciprocal course |
private static java.awt.Color |
DEAD_FLAG_COLOR
the color of the dead flags |
private static Deviation |
DRIFT_DEVIATION
the amount of randomization in the needle drift |
private static double |
DRIFT_RANDOM_BUCKET
the distribution of needle movements as a percent. |
private static double |
FLAG_MAGNIFICATION
the size scale of the flags relative to the instrument size |
private static double |
FLAG_WEIGHT
the weight scale of the flag text relative to the instrument size |
private static CoordinatePolarMathematical |
FROM_INDICATOR_OFFSET
the relative position of the FROM indicator relative to the center of the instrument |
private static Interval<Deviation> |
GLIDESLOPE_DEVIATION
the interval defining the glideslope ticks |
private static CoordinatePolarMathematical |
GLIDESLOPE_FLAG_OFFSET
the relative position of the glideslope flag indicator relative to the center of the instrument |
private static TextProperties |
GLIDESLOPE_FLAG_TEXT
the text properties of the glideslope flag |
private static java.awt.Color |
GLIDESLOPE_TICK_COLOR
the color of the glideslope ticks |
private static Scaler |
GLIDESLOPE_TICK_LENGTH
the size scale of the glideslope needle relative to the instrument size |
private static Scaler |
GLIDESLOPE_TICK_WEIGHT
the weight scale of the glideslope needle relative to the instrument size |
private static TextProperties |
KNOB_LABEL_PROPERTIES
the text properties of the knob label |
private static AngleNavigational |
KNOB_STEP
the step value for changing the OBS |
private static java.awt.Color |
LIVE_FLAG_COLOR
the color of the live flags |
private static Interval<Deviation> |
LOCALIZER_DEVIATION
the interval defining the localizer ticks |
private static CoordinatePolarMathematical |
LOCALIZER_FLAG_OFFSET
the relative position of the localizer flag indicator relative to the center of the instrument |
private static TextProperties |
LOCALIZER_FLAG_TEXT
the text properties of the localizer flag |
private static java.awt.Color |
LOCALIZER_TICK_COLOR
the color of the localizer ticks |
private static Scaler |
LOCALIZER_TICK_LARGE_WEIGHT
the weight scale of the localizer large tick relative to the instrument size |
private static Scaler |
LOCALIZER_TICK_SMALL_WEIGHT
the weight scale of the localizer small tick relative to the instrument size |
private static TickDescriptor<AngleNavigational> |
MAJOR_TICKS
the major-ticks descriptor |
private static TickDescriptor<AngleNavigational> |
MINOR_TICKS
the minor-ticks descriptor |
private static NumberDescriptor<AngleNavigational> |
NUMBERS
the numbers descriptor |
private static TextProperties |
NUMBERS_TEXT
the text properties of the numbers |
private static NeedleDescriptor |
TO_FROM_INDICATOR_OFF
the dead to-from flag descriptor |
private static NeedleDescriptor |
TO_FROM_INDICATOR_ON
the alive to-from flag descriptor |
private static CoordinatePolarMathematical |
TO_INDICATOR_OFFSET
the relative position of the TO indicator relative to the center of the instrument |
| 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 | |
|---|---|
HorizontalSituationIndicator(java.lang.String id,
int canvasSize,
CoordinateCartesianAbsolute canvasAnchor)
Creates a VOR/localizer/glideslope instrument. |
|
| Method Summary | |
|---|---|
private CoordinateCartesianAbsolute |
calculateGlideslopeCoordinate(Deviation deviation)
Calculate the end of the glideslope needle based on its deviation from center. |
private CoordinateCartesianAbsolute |
calculateLocalizerCoordinate(Deviation deviation)
Calculate the end of the localizer needle based on its deviation from center. |
private void |
configureKnob()
Configures the knob. |
private void |
configureNumbers()
Configures the numbers. |
private Deviation |
drift(Deviation deviation)
Perturbs a deviation by a random drift. |
AngleNavigational |
getAzimuth()
Gets the azimuth. |
Deviation |
getGlideslopeDeviation()
Gets the glideslope deviation from center. |
Knob |
getKnobHeading()
Gets the heading knob. |
Knob |
getKnobOBS()
Gets the OBS knob. |
Deviation |
getLocalizerDeviation()
Gets the localizer deviation from center. |
void |
handleControlCallback(ControlCallbackEvent event)
Handles an event from a registered control. |
boolean |
isGlideslopeAlive()
Returns whether the glideslope is alive. |
boolean |
isLocalizerAlive()
Returns whether the localizer is alive. |
boolean |
isToOrFromStation()
Returns whether the CDI is indicating TO or FROM a station. |
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 |
renderCourseBugs()
Renders the course bugs. |
private void |
renderFlag(CoordinatePolarMathematical originOffset,
java.lang.String label,
TextProperties textProperties,
boolean isAlive)
Renders a flag. |
private void |
renderFlags()
Renders the navigation and glideslope alive flags. |
private void |
renderGlideslopeTicks()
Renders the glideslope ticks. |
private void |
renderKnobs()
zzz |
private void |
renderLocalizerTicks()
Renders the localizer ticks. |
private void |
renderNumbers()
Renders the numbers. |
private void |
renderRingInner()
Renders the zzz. |
private void |
renderTicks()
Renders the minor, medium, and major ticks. |
private void |
renderToFromIndicator()
Renders the TO/FROM indicator arrows. |
java.lang.String |
toString()
|
void |
update(boolean isToOrFromStation,
Deviation localizerDeviation,
boolean isLocalizerAlive)
Updates the state of the instrument without rendering it. |
void |
update(boolean isToOrFromStation,
Deviation localizerDeviation,
boolean isLocalizerAlive,
Deviation glideslopeDeviation,
boolean isGlideslopeAlive)
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 _courseDesired
private Deviation _glideslopeDeviation
private boolean _isGlideslopeAlive
private boolean _isLocalizerAlive
private boolean _isToOrFromStation
private final Knob _knobHeading
private static final KnobProperties _knobHeadingProperties
private final Knob _knobOBS
private static final KnobProperties _knobOBSProperties
private Deviation _localizerDeviation
private static Ring _ringInner
private static final AngleNavigational AZIMUTH_END
private static final AngleNavigational AZIMUTH_START
private static final NeedleDescriptor COURSE_BUG
private static final java.awt.Color DEAD_FLAG_COLOR
private static final Deviation DRIFT_DEVIATION
private static final double DRIFT_RANDOM_BUCKET
private static final double FLAG_MAGNIFICATION
private static final double FLAG_WEIGHT
private static final CoordinatePolarMathematical FROM_INDICATOR_OFFSET
private static final Interval<Deviation> GLIDESLOPE_DEVIATION
private static final CoordinatePolarMathematical GLIDESLOPE_FLAG_OFFSET
private static final TextProperties GLIDESLOPE_FLAG_TEXT
private static final java.awt.Color GLIDESLOPE_TICK_COLOR
private static final Scaler GLIDESLOPE_TICK_LENGTH
private static final Scaler GLIDESLOPE_TICK_WEIGHT
private static final TextProperties KNOB_LABEL_PROPERTIES
private static final AngleNavigational KNOB_STEP
private static final java.awt.Color LIVE_FLAG_COLOR
private static final Interval<Deviation> LOCALIZER_DEVIATION
private static final CoordinatePolarMathematical LOCALIZER_FLAG_OFFSET
private static final TextProperties LOCALIZER_FLAG_TEXT
private static final java.awt.Color LOCALIZER_TICK_COLOR
private static final Scaler LOCALIZER_TICK_LARGE_WEIGHT
private static final Scaler LOCALIZER_TICK_SMALL_WEIGHT
private static final TickDescriptor<AngleNavigational> MAJOR_TICKS
private static final TickDescriptor<AngleNavigational> MINOR_TICKS
private static final NumberDescriptor<AngleNavigational> NUMBERS
private static final TextProperties NUMBERS_TEXT
private static final NeedleDescriptor TO_FROM_INDICATOR_OFF
private static final NeedleDescriptor TO_FROM_INDICATOR_ON
private static final CoordinatePolarMathematical TO_INDICATOR_OFFSET
| Constructor Detail |
|---|
public HorizontalSituationIndicator(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 CoordinateCartesianAbsolute calculateGlideslopeCoordinate(Deviation deviation)
deviation - - the deviation
private CoordinateCartesianAbsolute calculateLocalizerCoordinate(Deviation deviation)
deviation - - the deviation
private void configureKnob()
private void configureNumbers()
private Deviation drift(Deviation deviation)
deviation - - the actual deviation
public AngleNavigational getAzimuth()
public Deviation getGlideslopeDeviation()
public Knob getKnobHeading()
public Knob getKnobOBS()
public Deviation getLocalizerDeviation()
public void handleControlCallback(ControlCallbackEvent event)
handleControlCallback in class A_Instrumentevent - - the callback eventpublic boolean isGlideslopeAlive()
public boolean isLocalizerAlive()
public boolean isToOrFromStation()
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 renderCourseBugs()
private void renderFlag(CoordinatePolarMathematical originOffset,
java.lang.String label,
TextProperties textProperties,
boolean isAlive)
originOffset - - the relative offset from the center of the instrumentlabel - - the flag labeltextProperties - - the label text propertiesisAlive - - whether the flag is aliveprivate void renderFlags()
private void renderGlideslopeTicks()
private void renderKnobs()
private void renderLocalizerTicks()
private void renderNumbers()
private void renderRingInner()
private void renderTicks()
private void renderToFromIndicator()
public java.lang.String toString()
toString in class java.lang.Object
public void update(boolean isToOrFromStation,
Deviation localizerDeviation,
boolean isLocalizerAlive)
isToOrFromStation - - whether the CDI is pointing TO a station; otherwise FROMlocalizerDeviation - - the localizer deviation from centerisLocalizerAlive - - whether the localizer is alive
public void update(boolean isToOrFromStation,
Deviation localizerDeviation,
boolean isLocalizerAlive,
Deviation glideslopeDeviation,
boolean isGlideslopeAlive)
isToOrFromStation - - whether the CDI is pointing TO a station; otherwise FROMlocalizerDeviation - - the localizer deviation from centerisLocalizerAlive - - whether the localizer is aliveglideslopeDeviation - - the glideslope deviation from centerisGlideslopeAlive - - whether the glideslope is alive
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||