2022-11-12 14:20:29 +00:00
|
|
|
package config
|
|
|
|
|
|
|
|
import (
|
|
|
|
"th7/data/thermocouple"
|
|
|
|
)
|
|
|
|
|
2023-12-05 17:22:12 +00:00
|
|
|
type API struct {
|
|
|
|
Port int `json:"port"`
|
|
|
|
Enabled bool `json:"enabled"`
|
|
|
|
Restricted bool `json:"restricted"` // can read/modify DB settings?
|
|
|
|
}
|
|
|
|
|
2023-11-21 14:45:14 +00:00
|
|
|
type Filter struct {
|
2023-11-21 14:57:53 +00:00
|
|
|
SampleSize int `json:"sample_size"`
|
2023-11-21 16:19:20 +00:00
|
|
|
Type int `json:"type"`
|
2023-11-21 14:45:14 +00:00
|
|
|
}
|
|
|
|
|
2022-11-12 14:20:29 +00:00
|
|
|
type Channel struct {
|
|
|
|
Id int `json:"id"`
|
|
|
|
Thermo thermocouple.Type `json:"thermocouple"`
|
|
|
|
Gain float64 `json:"gain"`
|
|
|
|
Offset float64 `json:"offset"`
|
2023-11-25 10:37:02 +00:00
|
|
|
Log bool `json:"log"`
|
2023-11-21 14:57:53 +00:00
|
|
|
Filter Filter `json:"filter"`
|
2022-11-12 14:20:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type TH7 struct {
|
2023-12-05 17:22:12 +00:00
|
|
|
Led bool `json:"LED"`
|
|
|
|
Debug bool `json:"debug"`
|
|
|
|
NoLog bool `json:"nolog"`
|
|
|
|
NoWeb bool `json:"noweb"`
|
2022-11-12 14:20:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Config struct {
|
|
|
|
Board TH7 `json:"TH7"`
|
|
|
|
Channels []Channel `json:"channels"`
|
|
|
|
DB map[string]interface{} `json:"db"`
|
2023-12-05 17:22:12 +00:00
|
|
|
API []API `json:"API"`
|
2022-11-12 14:20:29 +00:00
|
|
|
}
|