th7/pcb/dummy.go

38 lines
587 B
Go
Raw Normal View History

2022-11-12 14:20:29 +00:00
package pcb
import (
"fmt"
"th7/data/pcb"
)
type DummyAdapter struct {
2022-11-16 19:53:11 +00:00
table pcb.Table
2022-11-12 14:20:29 +00:00
}
2022-11-16 19:53:11 +00:00
func NewDummyAdapter() (*DummyAdapter, error) {
return &DummyAdapter{}, nil
2022-11-12 14:20:29 +00:00
}
func (d *DummyAdapter) Deinit() error {
fmt.Println("dummy pcb adapter deinit")
return nil
}
func (d *DummyAdapter) UpdateTable() {
d.table.Pivdd = 5.0
d.table.Vadj = 0.9
d.table.Vref = 3.6
}
func (d *DummyAdapter) GetTable() pcb.Table {
return d.table
}
2022-11-16 19:53:11 +00:00
func (d *DummyAdapter) ReadChannel(id int, gain float64) float64 {
return -9000.0
2022-11-12 14:20:29 +00:00
}
2022-11-16 19:53:11 +00:00
func (d *DummyAdapter) ReadPCBTemp() float64 {
return 25.0
2022-11-12 14:20:29 +00:00
}