ph

package
v0.0.0-...-9604f65 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const Bucket = storage.PhBucket
View Source
const CalibrationBucket = storage.PhCalibrationBucket
View Source
const ReadingsBucket = storage.PhReadingsBucket

Variables

This section is empty.

Functions

This section is empty.

Types

type CalibrationPoint

type CalibrationPoint struct {
	Type     string  `json:"type"`
	Expected float64 `json:"expected"`
	Observed float64 `json:"observed"`
}

type ChartConfig

type ChartConfig struct {
	YMin  float64 `json:"ymin"`
	YMax  float64 `json:"ymax"`
	Color string  `json:"color"`
	Unit  string  `json:"unit"`
}

type Controller

type Controller struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func New

func New(devMode bool, c controller.Controller) *Controller

func (*Controller) Calibrate

func (c *Controller) Calibrate(id string, ms []hal.Measurement) error

func (*Controller) CalibratePoint

func (c *Controller) CalibratePoint(id string, point CalibrationPoint) error

func (*Controller) Create

func (c *Controller) Create(p Probe) error

func (*Controller) Delete

func (c *Controller) Delete(id string) error

func (*Controller) Get

func (c *Controller) Get(id string) (Probe, error)

func (*Controller) GetEntity

func (c *Controller) GetEntity(id string) (controller.Entity, error)

func (*Controller) InUse

func (c *Controller) InUse(depType, id string) ([]string, error)

func (*Controller) List

func (c *Controller) List() ([]Probe, error)

func (*Controller) LoadAPI

func (e *Controller) LoadAPI(r *mux.Router)

func (*Controller) On

func (c *Controller) On(id string, b bool) error

func (*Controller) Read

func (c *Controller) Read(p Probe) (float64, error)

func (*Controller) Run

func (c *Controller) Run(p Probe, quit chan struct{}) error

func (*Controller) Setup

func (c *Controller) Setup() error

func (*Controller) Start

func (c *Controller) Start()

func (*Controller) Stop

func (c *Controller) Stop()

func (*Controller) Update

func (c *Controller) Update(id string, p Probe) error

type Notify

type Notify struct {
	Enable bool    `json:"enable"`
	Min    float64 `json:"min"`
	Max    float64 `json:"max"`
}

type Probe

type Probe struct {
	ID          string        `json:"id"`
	Name        string        `json:"name"`
	Enable      bool          `json:"enable"`
	Period      time.Duration `json:"period"`
	AnalogInput string        `json:"analog_input"`
	Control     bool          `json:"control"`
	Notify      Notify        `json:"notify"`
	UpperEq     string        `json:"upper_eq"`
	DownerEq    string        `json:"downer_eq"`
	Min         float64       `json:"min"`
	Max         float64       `json:"max"`
	Hysteresis  float64       `json:"hysteresis"`
	IsMacro     bool          `json:"is_macro"`
	OneShot     bool          `json:"one_shot"`
	Chart       ChartConfig   `json:"chart"`
	Transformer string        `json:"transformer"`
	// contains filtered or unexported fields
}

func (Probe) CreateFeed

func (p Probe) CreateFeed(t telemetry.Telemetry)

func (Probe) Validate

func (p Probe) Validate() error

func (Probe) WithinRange

func (p Probe) WithinRange(v float64) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL