Skip to content

Commit

Permalink
新增镜像设备特性
Browse files Browse the repository at this point in the history
  • Loading branch information
smthing committed May 30, 2024
1 parent e891c22 commit 9b328b5
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions internal/plugins/mirror/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ func (c *connector) Encode(deviceId string, mode plugin.EncodeMode, values ...pl
if !ok {
return nil, errors.New("mirror pointName not found")
}
if _, ok := group[rawDevice.deviceId]; !ok {
group[rawDevice.deviceId] = EncodeModel{
deviceId: rawDevice.deviceId,
points: make([]plugin.PointData, 0),
mode: mode,
}
var points []plugin.PointData
if _, ok := group[rawDevice.deviceId]; ok {
points = group[rawDevice.deviceId].points
} else {
points = make([]plugin.PointData, 0)
}
points = append(points, point)
group[rawDevice.deviceId] = EncodeModel{
deviceId: rawDevice.deviceId,
points: points,
mode: mode,
}
model := group[rawDevice.deviceId]
model.points = append(model.points, point)
}
//group转数组
models := make([]EncodeModel, 0)
Expand Down

0 comments on commit 9b328b5

Please sign in to comment.