-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using surfaceToTransducer to calculate depth
- Loading branch information
1 parent
432b316
commit 913e5b2
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
DPT - Depth of Water | ||
$--DPT,x.x,x.x*hh | ||
Fields: | ||
- Water depth relative to transducer, meters | ||
- Offset from transducer, meters. Positive means distance from transducer to water line, negative means distance from transducer to keel | ||
- Checksum | ||
*/ | ||
// NMEA0183 Encoder DPT $IIDPT,9.2,1.1*4B | ||
const nmea = require('../nmea.js') | ||
module.exports = function (app) { | ||
return { | ||
sentence: 'DPT', | ||
title: 'DPT - Depth at Surface (using surfaceToTransducer)', | ||
keys: [ | ||
'environment.depth.belowTransducer', | ||
'environment.depth.surfaceToTransducer' | ||
], | ||
f: function dpt (belowTransducer, surfaceToTransducer) { | ||
return nmea.toSentence([ | ||
'$IIDPT', | ||
belowTransducer.toFixed(2), | ||
surfaceToTransducer.toFixed(3) | ||
]) | ||
} | ||
} | ||
} |