this is a doozy - device auto discovery and handling
The main goal was to decouple more things We got devices being looked for in the background and the stream view is like a device now too
This commit is contained in:
@@ -1,9 +1,27 @@
|
||||
package cdashdisplay
|
||||
|
||||
import "esdi/peripheral/devices"
|
||||
import (
|
||||
"esdi/peripheral/devices"
|
||||
"esdi/telemetry"
|
||||
)
|
||||
|
||||
// TODO: I believe we don't need the #esdi/peripheral/devices thing anymore
|
||||
const (
|
||||
ID = devices.CDashDisplayDevID
|
||||
Name = devices.CDashDisplayDevName
|
||||
NAME = devices.CDashDisplayDevName
|
||||
)
|
||||
|
||||
func (cds *CDashDisplay) Name() string {
|
||||
return NAME
|
||||
}
|
||||
|
||||
func (cds *CDashDisplay) RequiredFields() map[int16]telemetry.FieldID {
|
||||
fields := make(map[int16]telemetry.FieldID, len(cds.State.Layout.Windows))
|
||||
|
||||
for _, w := range cds.State.Layout.Windows {
|
||||
fieldID, _ := telemetry.GetFieldID(w.UIData.TelemetryField)
|
||||
fields[w.UIData.IDX] = fieldID
|
||||
}
|
||||
|
||||
return fields
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user