forked from adrianmo/go-nmea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pskpdpt.go
45 lines (42 loc) · 1.69 KB
/
pskpdpt.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package nmea
const (
// TypePSKPDPT type for proprietary Skipper PSKPDPT sentences
TypePSKPDPT = "SKPDPT"
)
// PSKPDPT - Depth of Water for multiple transducer installation
// https://www.alphatronmarine.com/files/products/120-echonav-skipper-gds101-instoper-manual-12-6-2017_1556099135_47f5f8d1.pdf (page 56, Edition: 2017.06.12)
// https://www.kongsberg.com/globalassets/maritime/km-products/product-documents/164821aa_rd301_instruction_manual_lr.pdf (page 2, 857-164821aa)
//
// Format: $PSKPDPT,x.x,x.x,x.x,xx,xx,c--c*hh<CR><LF>
// Example: $PSKPDPT,0002.5,+00.0,0010,10,03,*77
type PSKPDPT struct {
BaseSentence
// Depth is water depth relative to transducer, meters
Depth float64
// Offset from transducer, meters
Offset float64
// RangeScale is Maximum range scale in use, meters
RangeScale float64
// BottomEchoStrength is Bottom echo strength (0,9)
BottomEchoStrength int64
// ChannelNumber is Echo sounder channel number (0-99) (1 = 38 kHz. 2 = 50 kHz. 3 = 200 kHz)
ChannelNumber int64
// TransducerLocation is Transducer location. Text string, indicating transducer position: FWD/AFT/PORT/STB.
// If position is not preset by operator, empty field is provided.
TransducerLocation string
}
// newPSKPDPT constructor
func newPSKPDPT(s BaseSentence) (Sentence, error) {
p := NewParser(s)
p.AssertType(TypePSKPDPT)
sentence := PSKPDPT{
BaseSentence: s,
Depth: p.Float64(0, "depth"),
Offset: p.Float64(1, "offset"),
RangeScale: p.Float64(2, "range scale"),
BottomEchoStrength: p.Int64(3, "bottom echo strength"),
ChannelNumber: p.Int64(4, "channel number"),
TransducerLocation: p.String(5, "transducer location"),
}
return sentence, p.Err()
}