-
Notifications
You must be signed in to change notification settings - Fork 29
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 ecf2831
Showing
1 changed file
with
26 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,26 @@ | ||
/** | ||
Depth: | ||
$IIDPT,x.x,x.x,,*hh | ||
I I_Sensor offset, >0 = surface transducer distance, >0 = keel transducer distance. | ||
I_From Surface To Transduder | ||
*/ | ||
// NMEA0183 Encoder DPT $IIDPT,69.21,-0.001*60 | ||
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) | ||
]) | ||
} | ||
} | ||
} |