models

package
v0.0.0-...-9834320 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrowingState

type GrowingState string
const (
	Sown         GrowingState = "SOWN"
	Seedling     GrowingState = "SEEDLING"
	Transplanted GrowingState = "TRANSPLANTED"
	Mature       GrowingState = "MATURE"
	Removed      GrowingState = "REMOVED"
	Perannual    GrowingState = "PERANNUAL"
)

type Plant

type Plant struct {
	Id                 uint32
	Name               string
	MinDaysToGerminate uint8
	MaxDaysToGerminate uint8
	MinDaysToMaturity  uint8
	MaxDaysToMaturity  uint8
	IsPerAnnual        bool
}

type Specimen

type Specimen struct {
	Id             uint32
	Plant          Plant
	SownDate       time.Time
	TransplantDate time.Time
	State          GrowingState
}

func (Specimen) EstimatedGerminationDate

func (self Specimen) EstimatedGerminationDate() (time.Time, time.Time)

Returns the lower and upper bounds of the estimated germination

If the sown data is zero, the function will return zero date time for upper and lower

func (Specimen) EstimatedMaturityDate

func (self Specimen) EstimatedMaturityDate() (time.Time, time.Time)

Returns the estimated maturity date for the specimen

If sown date for the specimen is zero, returns zero for both lower and upper

func (Specimen) ToString

func (self Specimen) ToString() string

func (Specimen) WithinSproutingWindow

func (self Specimen) WithinSproutingWindow() bool

Jump to

Keyboard shortcuts

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