From 8a1f697fa0685d5521529db2c51e23c1ac81674f Mon Sep 17 00:00:00 2001 From: zhengjw22 Date: Mon, 3 Jun 2024 16:03:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96mirror=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/plugins/mirror/adapter.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/internal/plugins/mirror/adapter.go b/internal/plugins/mirror/adapter.go index ae39330..19e1573 100644 --- a/internal/plugins/mirror/adapter.go +++ b/internal/plugins/mirror/adapter.go @@ -67,16 +67,19 @@ func (c *connector) Decode(raw interface{}) (res []plugin.DeviceData, err error) mirrorData.Values = append(mirrorData.Values, point) continue } - //创建镜像设备数据 - group[mirror.ID] = plugin.DeviceData{ - ID: mirror.ID, - Values: []plugin.PointData{ - { - PointName: point.PointName, - Value: point.Value, + //通讯设备对应同一镜像设备的多个点 + for _, pointData := range mirror.Values { + group[mirror.ID] = plugin.DeviceData{ + ID: mirror.ID, + Values: []plugin.PointData{ + { + PointName: pointData.PointName, + Value: point.Value, + }, }, - }, + } } + } } for _, data := range group {