Documentation ¶
Index ¶
- Constants
- Variables
- func Clamp(value, minimum, maximum int) int
- func DecodeStructFieldToMeasurement(m *telegraf.Measurement, va reflect.Value, i int)
- func InitIndexConfig(errLog *log.Logger, conditionsPath string)
- func Max(value, limit int) int
- func Min(value, limit int) int
- func RunConditions(errLog *log.Logger, runStuff func(point *TimePoint) bool, ...)
- type Indices
- type TimePoint
Constants ¶
const NullTargetFloat64 float64 = -math.MaxFloat32
NullTargetFloat64 exported see above
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
const NullTargetInt32 int32 = math.MinInt32
NullTargetInt32 exported see above
const NullTargetInt64 int64 = math.MinInt64
NullTargetInt64 exported see above
Variables ¶
var IndexConfig = &Indices{ -1, -1, -1, -1, -1, -1, -1, -1, []int{}, }
IndexConfig package level struct to store indices. -1 means it doesnt exist.
var ( // ZoneName exported so that packages that use this package can refer to the current timezone ZoneName string )
Functions ¶
func DecodeStructFieldToMeasurement ¶
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 ¶
InitIndexConfig populates the chamber_tools.IndexConfig struct from a header line
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