Files
tecamino-dbm/dbm/system.go
2025-05-12 17:12:25 +02:00

30 lines
702 B
Go

package dbm
import (
"github.com/google/uuid"
"github.com/tecamino/tecamino-dbm/models"
json_dataModels "github.com/tecamino/tecamino-json_data/models"
)
func (d *DBMHandler) AddSystemDps() (err error) {
path := "System:Datapoints"
typ := json_dataModels.LOU
rights := json_dataModels.Read
_, err = d.DBM.CreateDatapoints(json_dataModels.Set{Path: path, Value: 0, Type: typ, Rights: rights})
if err != nil {
d.Log.Error("dmb.Handler.AddSystemDps", err.Error())
return err
}
models.SystemDatapoints = d.DBM.QueryDatapoints(1, uuid.Nil, path)[0].Uuid
if err = d.DBM.GoSystemTime(); err != nil {
return err
}
if err = d.DBM.GoSystemMemory(); err != nil {
return err
}
return
}