gofmt
This commit is contained in:
parent
a58f3e8b5f
commit
e2d57edf45
@ -99,7 +99,7 @@ func Load() (config.Config, error) {
|
||||
}
|
||||
c.Thermo = tc
|
||||
|
||||
c.Filter.SampleSize = v.GetInt(head+".filter.samples")
|
||||
c.Filter.SampleSize = v.GetInt(head + ".filter.samples")
|
||||
|
||||
cfg.Channels = append(cfg.Channels, c)
|
||||
}
|
||||
|
@ -15,8 +15,6 @@ const (
|
||||
DurWaitRestart = 1000 * time.Millisecond
|
||||
)
|
||||
|
||||
|
||||
|
||||
// Continuously sample each configured channel, apply filter, and save result
|
||||
// in a mutex controlled shared data object, that can be accessed at any time
|
||||
// by a web-request or similar.
|
||||
@ -42,7 +40,7 @@ func startCacheService(t *TH7Adapter) {
|
||||
channel_id := t.cfg.Channels[channel].Id
|
||||
channel_gain := t.cfg.Channels[channel].Gain
|
||||
|
||||
for i:=0; i<t.cfg.Channels[channel].Filter.SampleSize; i++ {
|
||||
for i := 0; i < t.cfg.Channels[channel].Filter.SampleSize; i++ {
|
||||
// update vref table
|
||||
t.pcbPort.UpdateTable()
|
||||
measurement := t.pcbPort.ReadChannel(channel_id, channel_gain)
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
type Filter struct {
|
||||
SampleSize int `json:"sample_size"`
|
||||
SampleSize int `json:"sample_size"`
|
||||
}
|
||||
|
||||
type Channel struct {
|
||||
@ -13,7 +13,7 @@ type Channel struct {
|
||||
Thermo thermocouple.Type `json:"thermocouple"`
|
||||
Gain float64 `json:"gain"`
|
||||
Offset float64 `json:"offset"`
|
||||
Filter Filter `json:"filter"`
|
||||
Filter Filter `json:"filter"`
|
||||
}
|
||||
|
||||
type TH7 struct {
|
||||
|
@ -1,9 +1,8 @@
|
||||
package core
|
||||
|
||||
|
||||
type Channel struct {
|
||||
Id int `json:"id"`
|
||||
Value float64 `json:"value"`
|
||||
Id int `json:"id"`
|
||||
Value float64 `json:"value"`
|
||||
}
|
||||
|
||||
type Ratio struct {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package filter
|
||||
|
||||
|
||||
func AlphaBetaFilter(arr []float64, init float64) float64 {
|
||||
|
||||
value := init
|
||||
|
Loading…
Reference in New Issue
Block a user