chamber_tools

package module
v0.0.0-...-0e94d23 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: MPL-2.0 Imports: 15 Imported by: 1

README

chamber-tools

this repo is archived, please see https://gitlab.com/appf-anu/chamber-tools

group repository for chamber tools.

Documentation

Index

Constants

View Source
const NullTargetFloat64 float64 = -math.MaxFloat32

NullTargetFloat64 exported see above

View Source
const NullTargetInt int = math.MinInt32

it is extremely unlikely (see. impossible) that we will be measuring or sending a humidity of 214,748,365 %RH or a temperature of -340,282,346,638,528,859,811,704,183,484,516,925,440°C until we invent some new physics, so until then, I will use these values as the unset or null values for HumidityTarget and TemperatureTarget NullTargetInt exported see above

View Source
const NullTargetInt32 int32 = math.MinInt32

NullTargetInt32 exported see above

View Source
const NullTargetInt64 int64 = math.MinInt64

NullTargetInt64 exported see above

Variables

View Source
var IndexConfig = &Indices{
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	-1,
	[]int{},
}

IndexConfig package level struct to store indices. -1 means it doesnt exist.

View Source
var (

	// ZoneName exported so that packages that use this package can refer to the current timezone
	ZoneName string
)

Functions

func Clamp

func Clamp(value, minimum, maximum int) int

Clamp clamps a value to between a minimum and maximum value

func DecodeStructFieldToMeasurement

func DecodeStructFieldToMeasurement(m *telegraf.Measurement, va reflect.Value, i int)

DecodeStructFieldToMeasurement turns a field of a struct into a measurement field and adds it to the measurment. doesnt support nested structs or maps, yet

func InitIndexConfig

func InitIndexConfig(errLog *log.Logger, conditionsPath string)

InitIndexConfig populates the chamber_tools.IndexConfig struct from a header line

func Max

func Max(value, limit int) int

Max returns a value clamped to an upper limit

func Min

func Min(value, limit int) int

Min returns a value clamped to a lower limit limit

func RunConditions

func RunConditions(errLog *log.Logger, runStuff func(point *TimePoint) bool, conditionsPath string, loopFirstDay bool)

RunConditions runs conditions for a file

Types

type Indices

type Indices struct {
	DatetimeIdx    int   `header:"datetime"`
	SimDatetimeIdx int   `header:"datetime-sim"`
	TemperatureIdx int   `header:"temperature"`
	HumidityIdx    int   `header:"humidity"`
	Light1Idx      int   `header:"light1"`
	Light2Idx      int   `header:"light2"`
	CO2Idx         int   `header:"co2"`
	TotalSolarIdx  int   `header:"totalsolar"`
	ChannelsIdx    []int `header:"channel-%d"`
}

Indices type to store the column indexes of columns with specific headers denoted by "header" tags

type TimePoint

type TimePoint struct {
	Datetime         time.Time
	SimDatetime      time.Time
	Temperature      float64
	RelativeHumidity float64
	Light1           int
	Light2           int
	CO2              float64
	TotalSolar       float64
	Channels         []float64
}

func NewTimePointFromRow

func NewTimePointFromRow(errLog *log.Logger, row *xlsx.Row) (*TimePoint, error)

func NewTimePointFromStringArray

func NewTimePointFromStringArray(errLog *log.Logger, row []string) (*TimePoint, error)

func (TimePoint) NulledString

func (tp TimePoint) NulledString() string

Directories

Path Synopsis
file_generators

Jump to

Keyboard shortcuts

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