split turbidity probe declaration

This commit is contained in:
Russell Stanley 2022-02-08 11:20:20 +10:30
parent 4f33f13358
commit d8fefc0930
4 changed files with 17 additions and 12 deletions

View File

@ -67,7 +67,6 @@ import (
"bitbucket.org/ausocean/av/container/mts/meta"
"bitbucket.org/ausocean/av/revid"
"bitbucket.org/ausocean/av/revid/config"
"bitbucket.org/ausocean/av/turbidity"
"bitbucket.org/ausocean/iot/pi/netlogger"
"bitbucket.org/ausocean/iot/pi/netsender"
"bitbucket.org/ausocean/iot/pi/sds"
@ -118,14 +117,6 @@ const (
// This is set to true if the 'profile' build tag is provided on build.
var canProfile = false
type turbidityProbe struct {
sharpness, contrast float64
delay time.Duration
ticker time.Ticker
ts *turbidity.TurbiditySensor
log logger.Logger
}
func main() {
mts.Meta = meta.NewWith([][2]string{{metaPreambleKey, metaPreambleData}})

View File

@ -52,6 +52,14 @@ const (
maxImages = 10 // Max number of images read when evaluating turbidity.
)
type turbidityProbe struct {
sharpness, contrast float64
delay time.Duration
ticker time.Ticker
ts *turbidity.TurbiditySensor
log logger.Logger
}
// NewTurbidityProbe returns a new turbidity probe.
func NewTurbidityProbe(log logger.Logger, delay time.Duration) (*turbidityProbe, error) {
tp := new(turbidityProbe)

View File

@ -35,14 +35,17 @@ import (
"bitbucket.org/ausocean/utils/logger"
)
// NewTurbidityProbe returns a new turbidity probe.
type turbidityProbe struct {
sharpness, contrast float64
}
// NewTurbidityProbe returns a empty turbidity probe for CircleCI testing only.
func NewTurbidityProbe(log logger.Logger, delay time.Duration) (*turbidityProbe, error) {
tp := new(turbidityProbe)
return tp, nil
}
// Write, reads input h264 frames in the form of a byte stream and writes the the sharpness and contrast
// scores of a video to the the turbidity probe.
// Write performs no operation for CircleCI testing only.
func (tp *turbidityProbe) Write(p []byte) (int, error) {
return len(p), nil
}

View File

@ -1,3 +1,6 @@
//go:build !nocv
// +build !nocv
/*
DESCRIPTION
Holds the turbidity sensor struct. Can evaluate 4x4 chessboard markers in an