Documentation
¶
Index ¶
- Constants
- func Unmarshal(bytes []byte) (Adf, *AdfError)
- type Additive
- type AdditiveList
- type Adf
- func (adf *Adf) AddSeries(series Series) *AdfError
- func (adf *Adf) Dispose()
- func (adf *Adf) GetVersion() string
- func (adf *Adf) Marshal() ([]byte, *AdfError)
- func (adf *Adf) RemoveSeries() *AdfError
- func (adf *Adf) SizeBytes() uint32
- func (adf *Adf) UpdateSeries(series Series, time uint64) *AdfError
- type AdfError
- type ErrorCode
- type FarmingTechnique
- type Header
- type Matrix
- type PrecisionInfo
- type ReductionCode
- type ReductionInfo
- type Series
- type SoilDepthInfo
- type WaveInfo
Constants ¶
View Source
const ( DAY_TIME_SEC uint32 = C.ADF_DAY WEEK_TIME_SEC uint32 = C.ADF_WEEK MONTH28_TIME_SEC uint32 = C.ADF_MONTH_28 MONTH29_TIME_SEC uint32 = C.ADF_MONTH_29 MONTH30_TIME_SEC uint32 = C.ADF_MONTH_30 MONTH31_TIME_SEC uint32 = C.ADF_MONTH_31 )
View Source
const ( HEADER_CORRUPTED_STR string = C.ADF_ERROR_PREFIX + C.ADF_HEADER_CORRUPTED_STR METADATA_CORRUPTED_STR string = C.ADF_ERROR_PREFIX + C.ADF_METADATA_CORRUPTED_STR SERIES_CORRUPTED_STR string = C.ADF_ERROR_PREFIX + C.ADF_SERIES_CORRUPTED_STR ZERO_REPEATED_SERIES_STR string = C.ADF_ERROR_PREFIX + C.ADF_ZERO_REPEATED_SERIES_STR EMPTY_SERIES_STR string = C.ADF_ERROR_PREFIX + C.ADF_EMPTY_SERIES_STR TIME_OUT_OF_BOUND_STR string = C.ADF_ERROR_PREFIX + C.ADF_TIME_OUT_OF_BOUND_STR ADDITIVE_OVERFLOW_STR string = C.ADF_ERROR_PREFIX + C.ADF_ADDITIVE_OVERFLOW_STR NULL_HEADER_SOURCE_STR string = C.ADF_ERROR_PREFIX + C.ADF_NULL_HEADER_SOURCE_STR NULL_HEADER_TARGET_STR string = C.ADF_ERROR_PREFIX + C.ADF_NULL_HEADER_TARGET_STR NULL_META_SOURCE_STR string = C.ADF_ERROR_PREFIX + C.ADF_NULL_META_SOURCE_STR NULL_META_TARGET_STR string = C.ADF_ERROR_PREFIX + C.ADF_NULL_META_TARGET_STR NULL_SERIES_SOURCE_STR string = C.ADF_ERROR_PREFIX + C.ADF_NULL_SERIES_SOURCE_STR NULL_SERIES_TARGET_STR string = C.ADF_ERROR_PREFIX + C.ADF_NULL_SERIES_TARGET_STR NULL_SOURCE_STR string = C.ADF_ERROR_PREFIX + C.ADF_NULL_SOURCE_STR NULL_TARGET_STR string = C.ADF_ERROR_PREFIX + C.ADF_NULL_TARGET_STR NULL_ADDITIVE_SOURCE_STR string = C.ADF_ERROR_PREFIX + C.ADF_NULL_ADDITIVE_SOURCE_STR NULL_ADDITIVE_TARGET_STR string = C.ADF_ERROR_PREFIX + C.ADF_NULL_ADDITIVE_TARGET_STR RUNTIME_ERROR_STR string = C.ADF_ERROR_PREFIX + C.ADF_RUNTIME_ERROR_STR )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Additive ¶
func NewAdditive ¶
type AdditiveList ¶
type AdditiveList struct {
Adds []Additive
}
func NewAdditiveList ¶
func NewAdditiveList(adds []Additive) AdditiveList
func (*AdditiveList) Size ¶
func (al *AdditiveList) Size() int
type Adf ¶
type Adf struct {
// contains filtered or unexported fields
}
func (*Adf) GetVersion ¶
func (*Adf) RemoveSeries ¶
type ErrorCode ¶
type ErrorCode uint16
const ( OK ErrorCode = C.ADF_OK HEADER_CORRUPTED ErrorCode = C.ADF_HEADER_CORRUPTED METADATA_CORRUPTED ErrorCode = C.ADF_METADATA_CORRUPTED SERIES_CORRUPTED ErrorCode = C.ADF_SERIES_CORRUPTED ZERO_REPEATED_SERIES ErrorCode = C.ADF_ZERO_REPEATED_SERIES EMPTY_SERIES ErrorCode = C.ADF_EMPTY_SERIES TIME_OUT_OF_BOUND ErrorCode = C.ADF_TIME_OUT_OF_BOUND ADDITIVE_OVERFLOW ErrorCode = C.ADF_ADDITIVE_OVERFLOW NULL_HEADER_SOURCE ErrorCode = C.ADF_NULL_HEADER_SOURCE NULL_HEADER_TARGET ErrorCode = C.ADF_NULL_HEADER_TARGET NULL_META_SOURCE ErrorCode = C.ADF_NULL_META_SOURCE NULL_META_TARGET ErrorCode = C.ADF_NULL_META_TARGET NULL_SERIES_SOURCE ErrorCode = C.ADF_NULL_SERIES_SOURCE NULL_SERIES_TARGET ErrorCode = C.ADF_NULL_SERIES_TARGET NULL_SOURCE ErrorCode = C.ADF_NULL_SOURCE NULL_TARGET ErrorCode = C.ADF_NULL_TARGET NULL_ADDITIVE_SOURCE ErrorCode = C.ADF_NULL_ADDITIVE_SOURCE NULL_ADDITIVE_TARGET ErrorCode = C.ADF_NULL_ADDITIVE_TARGET RUNTIME_ERROR ErrorCode = C.ADF_RUNTIME_ERROR )
type FarmingTechnique ¶
type FarmingTechnique uint8
const ( REGULAR FarmingTechnique = C.ADF_FT_REGULAR INDOOR FarmingTechnique = C.ADF_FT_INDOOR INDOOR_PROTECTED FarmingTechnique = C.ADF_FT_INDOOR_PROTECTED OUTDOOR FarmingTechnique = C.ADF_FT_OUTDOOR ARTIFICIAL_SOIL FarmingTechnique = C.ADF_FT_ARTIFICIAL_SOIL HYDROPONICS FarmingTechnique = C.ADF_FT_HYDROPONICS ANTHROPONICS FarmingTechnique = C.ADF_FT_ANTHROPONICS AEROPONICS FarmingTechnique = C.ADF_FT_AEROPONICS FOGPONICS FarmingTechnique = C.ADF_FT_FOGPONICS )
type Header ¶
type Header struct {
Version uint16 `json:"version"`
FarmingTec FarmingTechnique `json:"farmingTec"`
WInfo WaveInfo `json:"waveInfo"`
SInfo SoilDepthInfo `json:"soilInfo"`
RedInfo ReductionInfo `json:"reductionInfo"`
PrecInfo PrecisionInfo `json:"precisonInfo"`
NChunks uint32 `json:"nChunks"`
}
func NewHeader ¶
func NewHeader(farmingTec FarmingTechnique, wInfo WaveInfo, sInfo SoilDepthInfo, redInfo ReductionInfo, precInfo PrecisionInfo, nChunks uint32) Header
type PrecisionInfo ¶
type PrecisionInfo struct {
SoilDensity float32 `json:"soilDensity"`
Pressure float32 `json:"pressure"`
LightExposure float32 `json:"lightExposure"`
WaterUse float32 `json:"waterUse"`
SoilTemp float32 `json:"soilTemp"`
EnvTemp float32 `json:"environmentTemp"`
AdditiveConc float32 `json:"additiveConcentration"`
}
func NewDefaultPrecisionInfo ¶
func NewDefaultPrecisionInfo() PrecisionInfo
func NewPrecisionInfo ¶
type ReductionCode ¶
type ReductionCode int8
const ( NONE ReductionCode = C.ADF_RM_NONE AVERAGE ReductionCode = C.ADF_RM_AVG MOVING_AVERAGE ReductionCode = C.ADF_RM_MAVG )
type ReductionInfo ¶
type ReductionInfo struct {
SoilDensity ReductionCode `json:"soilDensity"`
Pressure ReductionCode `json:"pressure"`
LightExposure ReductionCode `json:"lightExposure"`
WaterUse ReductionCode `json:"waterUse"`
SoilTemp ReductionCode `json:"soilTemp"`
EnvTemp ReductionCode `json:"envTemp"`
AdditiveConc ReductionCode `json:"additive"`
}
func NewDefaultReductionInfo ¶
func NewDefaultReductionInfo() ReductionInfo
func NewReductionInfo ¶
func NewReductionInfo(soilDensity ReductionCode, pressure ReductionCode, lightExposure ReductionCode, waterUse ReductionCode, soilTemp ReductionCode, envTemp ReductionCode, additiveConc ReductionCode) ReductionInfo
type Series ¶
type Series struct {
LightExposure Matrix[float32] `json:"lightExposure"`
SoilTempC Matrix[float32] `json:"soilTempC"`
EnvTempC []float32 `json:"envTempC"`
WaterUseMl []float32 `json:"waterUseMl"`
PH uint8 `json:"pH"`
PBar float32 `json:"pBar"`
SoilDensityKgM3 float32 `json:"soilDensityKgM3"`
SoilAdditives AdditiveList `json:"soilAdditives"`
AtmAdditives AdditiveList `json:"atmAdditives"`
Repeated uint32 `json:"repeated"`
}
func (*Series) DisposeSeries ¶
func (s *Series) DisposeSeries()
type SoilDepthInfo ¶
type SoilDepthInfo struct {
TransY uint16 `json:"translationY"`
MaxSoilDepthMm uint16 `json:"maxSoilDepthMm"`
NDepth uint16 `json:"nDepth"`
}
func NewSoilDepthInfo ¶
func NewSoilDepthInfo(transY uint16, maxSoilDepthMm uint16, nDepth uint16) SoilDepthInfo
Click to show internal directories.
Click to hide internal directories.