av/cmd/rv/probe_circleci.go

56 lines
1.5 KiB
Go

//go:build nocv
// +build nocv
/*
DESCRIPTION
Replaces turbidity probe implementation that uses the gocv package.
When Circle-CI builds revid this is needed because Circle-CI does not
have a copy of Open CV installed.
AUTHORS
Russell Stanley <russell@ausocean.org>
LICENSE
Copyright (C) 2021-2022 the Australian Ocean Lab (AusOcean)
It is free software: you can redistribute it and/or modify them
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
It is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
in gpl.txt. If not, see http://www.gnu.org/licenses.
*/
package main
import (
"time"
"bitbucket.org/ausocean/utils/logger"
)
type turbidityProbe struct {
sharpness, contrast float64
}
// NewTurbidityProbe returns an empty turbidity probe for CircleCI testing only.
func NewTurbidityProbe(log logger.Logger, delay time.Duration) (*turbidityProbe, error) {
tp := new(turbidityProbe)
return tp, nil
}
// Write performs no operation for CircleCI testing only.
func (tp *turbidityProbe) Write(p []byte) (int, error) {
return 0, nil
}
func (tp *turbidityProbe) Close() error {
return nil
}