Initial working fully go release
This commit is contained in:
@@ -169,19 +169,15 @@ func (e *EPICS) Subscribe(ctx context.Context, signal string, ch chan<- datasour
|
||||
func (e *EPICS) timeValueToDS(signal string, tv proto.TimeValue) datasource.Value {
|
||||
var data any
|
||||
if tv.Doubles != nil {
|
||||
data = tv.Doubles
|
||||
if len(tv.Doubles) == 1 {
|
||||
data = tv.Doubles[0]
|
||||
} else {
|
||||
data = tv.Doubles
|
||||
}
|
||||
} else if tv.Str != "" {
|
||||
data = tv.Str
|
||||
} else {
|
||||
// Use cached metadata type for correct int64 / float64 distinction.
|
||||
e.mu.RLock()
|
||||
meta, hasMeta := e.metadata[signal]
|
||||
e.mu.RUnlock()
|
||||
if hasMeta && (meta.Type == datasource.TypeInt64 || meta.Type == datasource.TypeEnum) {
|
||||
data = int64(tv.Long)
|
||||
} else {
|
||||
data = tv.Double
|
||||
}
|
||||
data = tv.Double
|
||||
}
|
||||
|
||||
quality := datasource.QualityGood
|
||||
|
||||
Reference in New Issue
Block a user