You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
538 B
Go
41 lines
538 B
Go
2 years ago
|
package device
|
||
|
|
||
|
// do sensor and methods
|
||
|
|
||
|
import (
|
||
|
"sync"
|
||
|
)
|
||
|
|
||
|
type DOManager struct {
|
||
|
// do sensor manager
|
||
|
*SensorManager
|
||
|
*Atlas
|
||
|
|
||
|
sync.RWMutex
|
||
|
}
|
||
|
|
||
1 year ago
|
func NewDOManager() (*DOManager, error) {
|
||
2 years ago
|
// atlas delays
|
||
|
a := &Atlas{
|
||
|
CalDelay: 1300,
|
||
|
ReadDelay: 600,
|
||
|
}
|
||
|
|
||
|
sm := NewSensorManager()
|
||
|
|
||
1 year ago
|
return &DOManager{
|
||
2 years ago
|
Atlas: a,
|
||
|
SensorManager: sm,
|
||
1 year ago
|
}, nil
|
||
2 years ago
|
}
|
||
|
|
||
|
func (m *DOManager) Start() error {
|
||
|
// start sensor manager
|
||
|
return m.SensorManager.Start(m.Atlas.TakeReading)
|
||
|
}
|
||
|
|
||
|
func (m *DOManager) String() string {
|
||
|
// TODO
|
||
|
return ""
|
||
|
}
|