Water Control
Download Water.ocx Visual Studio Control

The Depth and Water Temperature Control accepts four NMEA sentences: $..DBK (Depth Below Keel); $..DBS (Depth Below Surface); $..DBT (Depth below transducer); and $..MTW (Water Temperature). The control automatically converts temperature and depth units. One may also set the Depth and Temperature via Properties. Temperature units may be in Centigrade or Fahrenheit; depth units may be in Feet, Meters, or Fathoms.

When the control is first placed upon a container (such as a Visual BASIC form), the default depth and temperature are both zero. The default temperature unit is Fahrenheit and the default depth unit is Feet.

Since the control "sees" a depth of zero feet, it "thinks" the boat is running aground: therefore both sails and the hull are red and will flash. This is the default condition.

The default "Caution" depth is 100 feet; the default "Danger" depth is 20 feet. Water depths that are shallower than these Property's values will trigger the Caution Even or Danger Event; the sails will change color, and the control will flash.

*NOTE* The control's default Properties and the control's behavior have been programmed to maximize vessle safety with two exceptions: The control's DangerDepth and CautionDepth may be set to a value that is lower than what will be safe for some boats. Specifically, the DangerDepth may be set as low as "5," and the CautionDepth may be set as low as "10," regardless of the unit of measure.


One may set the water depth via the Depth property or via one of the three NMEA Methods. Your program will wish to use only one of these four methods: differences between hull depth, keel depth, and transducer depth will vary, and if two or more different types of NMEA sentences are passed to the control, the depth displayed on the control will "bounce up and down" to reflect that/those differences.

The control's programmer suggests the use of the Depth Below Keel ($..DBK) NMEA Sentence as preferable. However, the end user ought to be allowed to choose between all three NMEA sentences because not every boater has their depth sounder configured for calculating keel depth and/or hull depth: transducer depth is the hardware default, and boaters must know how far above the keel, and how far below the surface, the depth sounder's transducer is located and then tell their depth sounder those distances before the depth sounder will calculate DBK and DBS--- not all boaters bother.

Changing the control's Depth Unit will cause the control to automatically recalculate the current depth to reflect the new unit of measure. The examples to the left show the unit of measure changing from Meters to Fathoms.

*WARNING!* Changing the depth's unit of measure causes the control to automatically recalculate the Caution Depth and the Danger Depth to reflect the new unit of measure.

Changing the temperature's unit of measure also causes the current temperature value to recalculate.

Error condictions will trigger an event. If the water depth is less than or equal to the Caution Depth, the WaterCaution event will be triggered; if the water depth is less than or equal to the Danger Depth, the DangerDepth event will be triggered. The programmer will wish to add an audio alarm when these events trigger.

Note that these events will continue to trigger until the water depth increases. When the water depth increases deeper than the DangerDepth and the CautionDepth, the GoodWater Event will be triggered.

Events:

WaterError(TheErrorMessage, TheErrorNumber)
WaterCaution()
WaterDanger()
WaterGood()
Click()

Methods:

MTW
DBK
DBS
DBT

Properties:

Night
Twilight
BackColor
ErrorNumber
ErrorDescription
BorderStyle
DepthUnits
TempUnits
CautionDepth
DangerDepth
Depth
Temperature

Error Codes

0 - No current error condition.
1 - NMEA Sentence passed to DepthType was empty.
2 - NMEA Sentence passed to DepthType appears malformed.
3 - Caution depth must be greater than Danger Depth.
4 - Danger depth must be less than Caution Depth.
5 - Depth must be less than 32,000.
6 - NMEA Sentence passed to MTW was empty.
7 - Temperature must be less than 401 degrees.
8 - NMEA Sentence passed to MTW appears malformed.
9 - Caution depth must be greater than or equal to 10.
10 - Danger depth must be greater than or equal to 5.
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