models

package
v0.0.0-...-518c124 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentPumpType = "CurrentPump"

CurrentPumpType is the type name

View Source
const DigitalInputType = "DigitalInput"

DigitalInputType name of the type

View Source
const DosingPumpType = "Dosing"

DosingPumpType name

View Source
const LPortType = "LPort"
View Source
const LevelSensorType = "LevelSensor"

LevelSensorType type name

View Source
const LightType = "Light"
View Source
const ProbeType = "Probe"
View Source
const ProgrammableLogicType = "ProgrammableLogic"
View Source
const SPortType = "SPort"

SPortType name

Variables

This section is empty.

Functions

func GetID

func GetID(typ string, index int) string

GetID Generates an id

Types

type BaseInfo

type BaseInfo struct {
	ID          string
	Type        string
	DisplayName string
	Units       string
}

BaseInfo base information for most models

type CurrentPump

type CurrentPump struct {
	BaseInfo
	Value int
	Index int
}

CurrentPump Model

func NewCurrentPump

func NewCurrentPump(index int) CurrentPump

NewCurrentPump creates a new pump

type DigitalInput

type DigitalInput struct {
	BaseInfo
	Index    int
	Value    types.CurrentState
	Function types.DigitalInputFunction
}

DigitalInput model

func NewDigitalInput

func NewDigitalInput(index int) DigitalInput

NewDigitalInput creates a new input

type DosingPump

type DosingPump struct {
	BaseInfo
	Channel  int
	Rate     int
	PerDay   int
	Settings types.TimerSettings
}

DosingPump creates a new item

func NewDosingPump

func NewDosingPump(index int) DosingPump

NewDosingPump creates a new pump

type Info

type Info struct {
	Maintenance     []Maintenance
	OperationMode   types.OperationMode
	Model           types.Model
	SoftwareDate    time.Time
	DeviceAddress   int
	Latitude        float64
	Longitude       float64
	MoonPhase       float64
	Alarm           types.CurrentState
	SoftwareVersion float64
	SerialNumber    int
	LastUpdate      time.Time
	Reminders       []Reminder
}

Info model

func NewInfo

func NewInfo() Info

NewInfo creates new object

func (Info) IsP3

func (info Info) IsP3() bool

IsP3 checks to see if the controller is a p3

type LPort

type LPort struct {
	BaseInfo
	PortNumber int
	Mode       types.PortMode
	Value      float64
}

func NewLPort

func NewLPort(portNumber int) LPort

type LevelSensor

type LevelSensor struct {
	BaseInfo
	Index             int
	AlarmState        types.CurrentState
	OperationMode     types.LevelSensorOperationMode
	Value             types.CurrentState
	SensorIndex       int
	WaterMode         types.WaterMode
	SecondSensor      types.CurrentState
	SecondSensorIndex int
	HasTwoInputs      bool
	HasWaterChange    bool
}

LevelSensor model

func NewLevelSensor

func NewLevelSensor(index int) LevelSensor

NewLevelSensor creates a new level sensor

type Light

type Light struct {
	BaseInfo
	Value          float64
	Channel        int
	IsDimmable     bool
	OperationHours int
	IsLightOn      bool
}

func NewLight

func NewLight(index int) Light

type Maintenance

type Maintenance struct {
	DisplayName string
	Index       int
	IsActive    bool
	Duration    int
	TimeLeft    int
}

Maintenance model

func NewMaintenance

func NewMaintenance(index int) *Maintenance

NewMaintenance creates object

type Probe

type Probe struct {
	BaseInfo
	Format         int
	SensorType     types.SensorType
	Index          int
	AlarmState     types.CurrentState
	NominalValue   float64
	SensorMode     types.SensorMode
	AlarmEnable    bool
	AlarmDeviation float64
	Value          float64
	OperationHours int
	ConvertedValue float64
	CenterValue    float64
	MaxRange       float64
	MinRange       float64
}

func NewProbe

func NewProbe(index int) Probe

func (Probe) GetUnits

func (probe Probe) GetUnits() string

func (Probe) GetValueMultiplier

func (probe Probe) GetValueMultiplier() float64

func (*Probe) SetAlarmDeviation

func (probe *Probe) SetAlarmDeviation(value float64)

func (*Probe) SetNominalValue

func (probe *Probe) SetNominalValue(value float64)

func (*Probe) SetValue

func (probe *Probe) SetValue(value float64)

type ProgrammableLogic

type ProgrammableLogic struct {
	DisplayName string
	Index       int
	Function    types.LogicFunction
	Input1      types.PortMode
	Input2      types.PortMode
	Id          string
	Type        string
}

func NewProgrammableLogic

func NewProgrammableLogic(index int) ProgrammableLogic

type Reminder

type Reminder struct {
	IsOverdue   bool
	Next        time.Time
	Text        string
	Index       int
	Period      int
	IsRepeating bool
}

Reminder model

func NewReminder

func NewReminder(index int) *Reminder

NewReminder creates new object

type SPort

type SPort struct {
	BaseInfo
	PortNumber         int
	Mode               types.PortMode
	Value              types.CurrentState
	CurrentColourValue int
	IsActive           bool
	Current            float64
}

SPort model

func NewSPort

func NewSPort(index int) SPort

NewSPort creates new object

Jump to

Keyboard shortcuts

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