th7/core/dummy.go

43 lines
774 B
Go
Raw Permalink Normal View History

2022-11-12 14:20:29 +00:00
package core
2022-12-05 13:19:54 +00:00
// NOT IN USE
2022-11-12 14:20:29 +00:00
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
}
2022-11-12 22:43:16 +00:00
func (d *DummyAdapter) GetChannels() ([]core.Channel, error) {
dummyData := make([]core.Channel, 0)
return dummyData, nil
2022-11-12 14:20:29 +00:00
}
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
}