2022-11-12 14:20:29 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|