From 6579d52bac4a84c3559082756ac9d8c6e09fbccb Mon Sep 17 00:00:00 2001 From: Martin/Geno Date: Sun, 7 Oct 2018 20:04:36 +0200 Subject: [PATCH] [BUGFIX] show NaN on link (fix #149) --- output/meshviewer-ffrgb/meshviewer.go | 4 +++- output/meshviewer-ffrgb/meshviewer_test.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/output/meshviewer-ffrgb/meshviewer.go b/output/meshviewer-ffrgb/meshviewer.go index cf9d01c..b86a30b 100644 --- a/output/meshviewer-ffrgb/meshviewer.go +++ b/output/meshviewer-ffrgb/meshviewer.go @@ -93,7 +93,7 @@ func transform(nodes *runtime.Nodes) *Meshviewer { Target: linkOrigin.TargetID, TargetAddress: linkOrigin.TargetAddress, SourceTQ: linkOrigin.TQ, - TargetTQ: linkOrigin.TQ, + TargetTQ: 0, } linkType, linkTypeFound := typeList[linkOrigin.SourceAddress] @@ -102,8 +102,10 @@ func transform(nodes *runtime.Nodes) *Meshviewer { } if switchSourceTarget { + link.SourceTQ = 0 link.Source = linkOrigin.TargetID link.SourceAddress = linkOrigin.TargetAddress + link.TargetTQ = linkOrigin.TQ link.Target = linkOrigin.SourceID link.TargetAddress = linkOrigin.SourceAddress diff --git a/output/meshviewer-ffrgb/meshviewer_test.go b/output/meshviewer-ffrgb/meshviewer_test.go index 7fcde4a..5e6aa53 100644 --- a/output/meshviewer-ffrgb/meshviewer_test.go +++ b/output/meshviewer-ffrgb/meshviewer_test.go @@ -164,7 +164,7 @@ func TestTransform(t *testing.T) { assert.Equal("other", link.Type) assert.Equal("node:b:mac:lan", link.TargetAddress) assert.Equal(float32(0.2), link.SourceTQ) - assert.Equal(float32(0.2), link.TargetTQ) + assert.Equal(float32(0), link.TargetTQ) break case "node:a:mac:wifi":