conversion at wrong place
This commit is contained in:
parent
7ecb3ff21c
commit
cf07519baa
@ -88,23 +88,23 @@ func startCacheService(t *TH7Adapter) {
|
|||||||
|
|
||||||
data[k].Value -= cjc_uv
|
data[k].Value -= cjc_uv
|
||||||
data[k].Unit = t.cfg.Channels[k].Unit
|
data[k].Unit = t.cfg.Channels[k].Unit
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// CJC can not be applied
|
|
||||||
// board temp out of range for specified thermocouple type
|
|
||||||
// perhaps just subtract board temperature? dont know
|
|
||||||
fmt.Println("No valid CJC", t.cfg.Channels[k])
|
|
||||||
}
|
|
||||||
|
|
||||||
new_value_c, err := thermocouple.C(tc, data[k].Value)
|
new_value_c, err := thermocouple.C(tc, data[k].Value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("Error converting UV to C", t.cfg.Channels[k], data[k].Value)
|
log.Println("Error converting UV to C", t.cfg.Channels[k], data[k].Value)
|
||||||
}
|
}
|
||||||
|
|
||||||
data[k].Value = new_value_c
|
|
||||||
|
|
||||||
//TODO: different temp units
|
//TODO: different temp units
|
||||||
|
data[k].Value = new_value_c
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// CJC can not be applied
|
||||||
|
// board temp out of range for specified thermocouple type
|
||||||
|
// perhaps just subtract board temperature? dont know
|
||||||
|
fmt.Println("No valid CJC for Channel", t.cfg.Channels[k].Id)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
t.mu.Lock()
|
t.mu.Lock()
|
||||||
|
Loading…
Reference in New Issue
Block a user