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) GetChannels() ([]core.Channel, error) {
	dummyData := make([]core.Channel, 0)
	return dummyData, nil
}

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
}