th7/core/dummy.go
2022-11-12 14:20:29 +00:00

41 lines
700 B
Go

package core
import (
"th7/data/core"
"th7/ports"
)
type DummyAdapter struct {
pcb ports.PCBPort
}
func NewDummyAdapter(pcb ports.PCBPort) *DummyAdapter {
return &DummyAdapter{pcb: pcb}
}
func (d *DummyAdapter) GetChannel(id int) (core.Channel, error) {
return core.Channel{}, nil
}
func (d *DummyAdapter) GetAll() core.Data {
return core.Data{}
}
func (d *DummyAdapter) GetVref() float64 {
d.pcb.UpdateTable()
table := d.pcb.GetTable()
return table.Vref
}
func (d *DummyAdapter) GetVadj() float64 {
d.pcb.UpdateTable()
table := d.pcb.GetTable()
return table.Vadj
}
func (d *DummyAdapter) GetPivdd() float64 {
d.pcb.UpdateTable()
table := d.pcb.GetTable()
return table.Pivdd
}