Skip to content

Commit

Permalink
engine: don't export to gui scalar parameters starting with "_"
Browse files Browse the repository at this point in the history
  • Loading branch information
godsic committed Sep 28, 2018
1 parent 2ea8d32 commit deda077
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions engine/parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit deda077

Please sign in to comment.