59 lines
818 B
Go
59 lines
818 B
Go
package core
|
|
|
|
import (
|
|
"sync"
|
|
"th7/data/config"
|
|
"th7/data/core"
|
|
"th7/ports"
|
|
)
|
|
|
|
type TH7Adapter struct {
|
|
pcbPort ports.PCBPort
|
|
mu sync.Mutex
|
|
data core.Data
|
|
}
|
|
|
|
func NewTH7Adapter(pcbPort ports.PCBPort, cfg config.Config) *TH7Adapter {
|
|
|
|
var adapter TH7Adapter
|
|
|
|
adapter.pcbPort = pcbPort
|
|
|
|
return &adapter
|
|
}
|
|
|
|
func (t *TH7Adapter) GetChannel(id int) (core.Channel, error) {
|
|
t.mu.Lock()
|
|
defer t.mu.Unlock()
|
|
|
|
return t.data.Channels[0], nil
|
|
}
|
|
|
|
func (t *TH7Adapter) GetAll() core.Data {
|
|
t.mu.Lock()
|
|
defer t.mu.Unlock()
|
|
|
|
return t.data
|
|
}
|
|
|
|
func (t *TH7Adapter) GetVref() float64 {
|
|
t.mu.Lock()
|
|
defer t.mu.Unlock()
|
|
|
|
return 0
|
|
}
|
|
|
|
func (t *TH7Adapter) GetVadj() float64 {
|
|
t.mu.Lock()
|
|
defer t.mu.Unlock()
|
|
|
|
return 0
|
|
}
|
|
|
|
func (t *TH7Adapter) GetPivdd() float64 {
|
|
t.mu.Lock()
|
|
defer t.mu.Unlock()
|
|
|
|
return 0
|
|
}
|