Radar Control
September 29, 2006

Download This Control

This control resized via the Width Property.

The control's Properties match the NMEA RSD sentence via the RSD Method. One therefore may use either the RSD Method or several Properties with this control. One may use various other Methods to add radar targets (the AddTarget Method), remove targets (the DelTarget Method), and to remove all targets (the ClsTargets Method). One may use the control without any targets, of course.

The Properties RangeUnits and RangeScale must be set first before the control will draw anything meaningful. After these two Properties are set, one may then add values to the CursorRange and CursorBearing Properties--- otherwise an error will be returned. One may use the RSD Method to set all four of these values at once.

Various Properties turn on and off assorted control features, such as inner rings, the label for the cursor's bearing, the line dead ahead, etc. Other properties change the colors of various items. The cursor may be a dot or a + cross-hairs, and each have three sizes that may be specified.
Dim i As Integer

i = Radar1.AddTarget("01", 49.3, 13.9)
i = Radar1.AddTarget("Fish", 51.9, 13.1)
i = Radar1.AddTarget("FishBoat", 131.2, 19.3)
i = Radar1.AddTarget("NavAid", 196.6, 13.8, 2, vbRed)

[....]

i = Radar1.DelTarget("01")
Adding a radar target requires giving the target an ID, a bearing, and a distance. Two other (optional) values are the size of the dot to plot, and the color to use. If the optional values are not specified, a size of "1" and a color of "vbBlack" is used.

NOTE: ID's must be unique, or the function will return an error and trigger the RadarError event.

One uses the target's ID to remove it, via the DelTarget Method.

The ShowID Property will toggle on and off the radar target's IDs. Most of the time a radar target will be unknown, so one will not actually wish to see the IDs displayed--- the IDs merely act as an index key that is used to remove individual targets.

Note that one may add radar targets to the control even when their distance falls outside the radar's current range scale. Those targets will be plotted if and when the RangeScale Property is later increased to include the distant targets.

This image shows the cursor's style set to "cross hairs" via the CursorStyle Property, and the cursor's label turned off via the ShowBearing Property.

Events:

CursorRangeChanged(OldRange, NewRange)
CursorBearingChanged(OldBearing, NewBearing)
RangeScaleChanged(OldRange, NewRange)
RangeUnitsChanged(OldUnits, NewUnits)
RadarError(ErrorNumber, ErrorDescription)
RSDError(ErrorNumber, ErrorDescription)
Click()
DblClick()

Methods:

LastErrorNumber
LastErrorDescription
RingsInterval
ClsTargets
AddTarget
DelTarget
RSD

Properties:

LineColor
OuterRingColor
InnerRingsColor
RangeUnits
CursorRange
RangeScale
CursorBearing
OwnShipPosition
BackColor
FontColor
BorderStyle
CursorSize
CursorStyle
Night
Twilight
ShowLine
ShowBearing
ShowID
ShowRings
LineSize

Error Codes

0 - No current error.
1 - Cursor Range must be less than or equal Range Scale.
2 - Cursor Bearing must be from 0 to 359.999999
3 - Range Scale must be greater than 0.1
4 - Target ID to add may not be blank.
5 - Target Bearing must be from 0 to 360 degrees.
6 - Target Distance must be greater than 0.01
7 - Target Size must be from 1 to 3.
8 - Target ID is not unique [<ID>]
9 - Target ID to delete may not be blank.
10 - Target ID to delete [<ID>] was not found.
11 - RSD NMEA Sentence appears to be malformed: nn
12 - RSD NMEA Sentence does not state it is RSD. It states: $xxxxx
NMEA Sage Home Page

The Banded Compass Control
The Compass Control
The North Biased Compass Control
The Goto Control
Course and Speed (Ground)
The Position Control
Engine RPM Control
The Rudder Control
The GPS Satellite Health Control
The GPS Satellite Elevation Control
Set and Drift Control
The NMEA Talker Control
Depth and Water Temperature Control
The Wind Control
The Cross Track Alarm Control
The Pilot Control
Waypoint Plotter Control
Radar Control
Goto Simple Control