|
|||||||||
| 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.vorlocalizerglideslope.VORLocalizerGlideslope
public class VORLocalizerGlideslope
Defines a standard directional-gyro instrument.
| Field Summary | |
|---|---|
private AngleNavigational |
_courseDesired
the desired course as defined by the OBS |
private AttitudePitch |
_glideslopeCorrectionAngle
the correction angle to get the glideslope on course |
private boolean |
_hasGlideslope
whether this instrument has a glideslope indicator |
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 |
_knob
the OBS knob |
private static KnobProperties |
_knobProperties
the knob properties |
private AttitudeYaw |
_localizerCorrectionAngle
the correction angle to get the localizer on course |
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 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<AttitudePitch> |
GLIDESLOPE_DEVIATION
the interval defining the glideslipe ticks |
private static AttitudePitch |
GLIDESLOPE_DRIFT
the amount of random needle drift |
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 NeedleDescriptor |
GLIDESLOPE_NEEDLE
the glideslope-needle descriptor |
private static Scaler |
GLIDESLOPE_NEEDLE_BASE
the position scale of the glideslope needle base relative to the instrument center |
private static double |
GLIDESLOPE_SCALE
the scale to adjust the glideslope correction angle into a needle deflection |
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<AttitudeYaw> |
LOCALIZER_DEVIATION
the interval defining the localizer ticks |
private static AttitudeYaw |
LOCALIZER_DRIFT
the amount of random needle drift |
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 NeedleDescriptor |
LOCALIZER_NEEDLE
the localizer-needle descriptor |
private static Scaler |
LOCALIZER_NEEDLE_BASE
the position scale of the localizer needle relative to the instrument center |
private static double |
LOCALIZER_SCALE
the scale to adjust the localizer correction angle into a needle deflection |
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 | |
|---|---|
VORLocalizerGlideslope(java.lang.String id,
int canvasSize,
CoordinateCartesianAbsolute canvasAnchor,
boolean hasGlideslope)
Creates a VOR/localizer/glideslope instrument. |
|
| Method Summary | |
|---|---|
private CoordinateCartesianAbsolute |
calculateGlideslopeCoordinate(AttitudePitch angle)
Calculate the end of the glideslope needle based on its correction angle from center. |
private CoordinateCartesianAbsolute |
calculateLocalizerCoordinate(AttitudeYaw angle,
boolean isILSMode)
Calculate the end of the localizer needle based on its correction angle from center. |
private void |
configureKnob()
Configures the knob. |
private void |
configureNumbers()
Configures the numbers. |
private AttitudePitch |
drift(AttitudePitch correctionAngle)
Perturbs a correction angle by a random drift. |
private AttitudeYaw |
drift(AttitudeYaw correctionAngle)
Perturbs a correction angle by a random drift. |
AngleNavigational |
getCourseDesired()
Gets the desired course set the OBS. |
AttitudePitch |
getGlideslopeCorrectionAngle()
Gets the correction angle to get the glideslope on course. |
Knob |
getKnob()
Gets the knob. |
AttitudeYaw |
getLocalizerCorrectionAngle()
Gets the correction angle to get the localizer on course. |
void |
handleControlCallback(ControlCallbackEvent event)
Handles an event from a registered control. |
boolean |
hasGlideslope()
Returns whether the instrument has a glideslope. |
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 |
renderGlideslopeNeedle()
Renders the needle. |
private void |
renderGlideslopeTicks()
Renders the glideslope ticks. |
private void |
renderKnob()
Renders the OBS knob. |
private void |
renderLocalizerNeedle()
Renders the needle. |
private void |
renderLocalizerTicks()
Renders the localizer ticks. |
private void |
renderNumbers()
Renders the numbers. |
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()
Updates the state of the instrument without rendering it. |
void |
update(AttitudeYaw correctionAngleLocalizer,
AttitudePitch correctionAngleGlideslope)
Updates the state of the instrument without rendering it. |
void |
update(AttitudeYaw correctionAngle,
boolean isToOrFromStation)
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 AttitudePitch _glideslopeCorrectionAngle
private final boolean _hasGlideslope
private boolean _isGlideslopeAlive
private boolean _isLocalizerAlive
private boolean _isToOrFromStation
private final Knob _knob
private static final KnobProperties _knobProperties
private AttitudeYaw _localizerCorrectionAngle
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 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<AttitudePitch> GLIDESLOPE_DEVIATION
private static final AttitudePitch GLIDESLOPE_DRIFT
private static final CoordinatePolarMathematical GLIDESLOPE_FLAG_OFFSET
private static final TextProperties GLIDESLOPE_FLAG_TEXT
private static final NeedleDescriptor GLIDESLOPE_NEEDLE
private static final Scaler GLIDESLOPE_NEEDLE_BASE
private static final double GLIDESLOPE_SCALE
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<AttitudeYaw> LOCALIZER_DEVIATION
private static final AttitudeYaw LOCALIZER_DRIFT
private static final CoordinatePolarMathematical LOCALIZER_FLAG_OFFSET
private static final TextProperties LOCALIZER_FLAG_TEXT
private static final NeedleDescriptor LOCALIZER_NEEDLE
private static final Scaler LOCALIZER_NEEDLE_BASE
private static final double LOCALIZER_SCALE
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 VORLocalizerGlideslope(java.lang.String id,
int canvasSize,
CoordinateCartesianAbsolute canvasAnchor,
boolean hasGlideslope)
id - - the unique instrument identifiercanvasSize - - the square size of the instrument footprint in pixelscanvasAnchor - - the anchor position for the center of the canvas in pixelshasGlideslope - - whether glideslope is implemented; without it, this is a VOR and localizer instrument| Method Detail |
|---|
private CoordinateCartesianAbsolute calculateGlideslopeCoordinate(AttitudePitch angle)
angle - - the the correction angle
private CoordinateCartesianAbsolute calculateLocalizerCoordinate(AttitudeYaw angle,
boolean isILSMode)
angle - - the correction angleisILSMode - - whether the instrument is in ILS mode, which increases the sensitivity of the needle by
LOCALIZER_ILS_SENSITIVITY
private void configureKnob()
private void configureNumbers()
private AttitudePitch drift(AttitudePitch correctionAngle)
correctionAngle - - the true correction angle
private AttitudeYaw drift(AttitudeYaw correctionAngle)
correctionAngle - - the true correction angle
public AngleNavigational getCourseDesired()
public AttitudePitch getGlideslopeCorrectionAngle()
public Knob getKnob()
public AttitudeYaw getLocalizerCorrectionAngle()
public void handleControlCallback(ControlCallbackEvent event)
handleControlCallback in class A_Instrumentevent - - the callback eventpublic boolean hasGlideslope()
public 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 renderGlideslopeNeedle()
private void renderGlideslopeTicks()
private void renderKnob()
private void renderLocalizerNeedle()
private void renderLocalizerTicks()
private void renderNumbers()
private void renderTicks()
private void renderToFromIndicator()
public java.lang.String toString()
toString in class java.lang.Objectpublic void update()
public void update(AttitudeYaw correctionAngleLocalizer,
AttitudePitch correctionAngleGlideslope)
correctionAngleLocalizer - - the localizer deviation from centercorrectionAngleGlideslope - - the glideslope deviation from center
public void update(AttitudeYaw correctionAngle,
boolean isToOrFromStation)
correctionAngle - - the correction angle necessary to go from the radial the UAV is on to the UAV it wants to be onisToOrFromStation - - whether the UAV is going to or from the station
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||