From deda0779369059b468b60c5a46923283ca8e44bb Mon Sep 17 00:00:00 2001 From: Mykola Dvornik Date: Fri, 28 Sep 2018 16:11:49 +0200 Subject: [PATCH] engine: don't export to gui scalar parameters starting with "_" --- engine/parameter.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/engine/parameter.go b/engine/parameter.go index e4a7508d3..b69b26d40 100644 --- a/engine/parameter.go +++ b/engine/parameter.go @@ -7,13 +7,14 @@ like material parameters. import ( "fmt" + "math" + "reflect" + "strings" + "github.com/mumax/3/cuda" "github.com/mumax/3/data" "github.com/mumax/3/script" "github.com/mumax/3/util" - "math" - "reflect" - "strings" ) // input parameter, settable by user @@ -225,14 +226,18 @@ type RegionwiseScalar struct { func (p *RegionwiseScalar) init(name, unit, desc string, children []derived) { p.regionwise.init(SCALAR, name, unit, children) - DeclLValue(name, p, cat(desc, unit)) + if !strings.HasPrefix(name, "_") { // don't export names beginning with "_" (e.g. from exciation) + DeclLValue(name, p, cat(desc, unit)) + } } // TODO: auto derived func NewScalarParam(name, unit, desc string, children ...derived) *RegionwiseScalar { p := new(RegionwiseScalar) p.regionwise.init(SCALAR, name, unit, children) - DeclLValue(name, p, cat(desc, unit)) + if !strings.HasPrefix(name, "_") { // don't export names beginning with "_" (e.g. from exciation) + DeclLValue(name, p, cat(desc, unit)) + } return p }