From 5f8ed9ec31f3d8195b86c3e667ecd77cf52b52f1 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Wed, 25 Apr 2012 01:19:34 -0400 Subject: revert Function to Description --- core.go | 2 +- formats.go | 18 +++++++++--------- templates/bom_view.html | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/core.go b/core.go index 4594d2b..da92854 100644 --- a/core.go +++ b/core.go @@ -21,7 +21,7 @@ type Offer struct { type LineItem struct { Manufacturer string `json:"manufacturer"` Mpn string `json:"mpn"` - Function string `json:"function"` + Description string `json:"description"` FormFactor string `json:"form_factor"` // type:string Specs string `json:"specs"` // comma seperated list Comment string `json:"comment"` diff --git a/formats.go b/formats.go index 6a0c19e..57caa0f 100644 --- a/formats.go +++ b/formats.go @@ -47,7 +47,7 @@ func DumpBomAsText(bm *BomMeta, b *Bom, out io.Writer) { li.Tag, li.Manufacturer, li.Mpn, - li.Function, + li.Description, li.Comment) } tabWriter.Flush() @@ -75,7 +75,7 @@ func DumpBomAsCSV(b *Bom, out io.Writer) { strings.Join(li.Elements, ","), li.Manufacturer, li.Mpn, - li.Function, + li.Description, li.FormFactor, li.Specs, li.Category, @@ -111,15 +111,15 @@ func LoadBomFromCSV(input io.Reader) (*Bom, error) { li = &LineItem{Elements: []string{}} for i, col := range header { switch strings.ToLower(col) { - case "qty", "quantity": + case "qty", "quantity", "qnty": // if a quantity is specified, use it; else interpret it // from element id count appendField(&qty, &records[i]) - case "mpn", "manufacturer part number": + case "mpn", "manufacturer part number", "part number", "p/n": appendField(&li.Mpn, &records[i]) - case "mfg", "manufacturer": + case "mfg", "manufacturer", "mfg name", "manufacturer name": appendField(&li.Manufacturer, &records[i]) - case "element", "id", "circuit element", "symbol_id", "symbol id", "symbols": + case "element", "id", "circuit element", "symbol_id", "symbol id", "symbols", "designator", "reference": for _, symb := range strings.Split(records[i], ",") { symb = strings.TrimSpace(symb) if !isShortName(symb) { @@ -128,11 +128,11 @@ func LoadBomFromCSV(input io.Reader) (*Bom, error) { log.Println("element id not a ShortName, skipped: " + symb) } } - case "function", "purpose", "role", "subsystem", "description": - appendField(&li.Function, &records[i]) + case "description", "type", "function": + appendField(&li.Description, &records[i]) case "formfactor", "form_factor", "form factor", "case/package", "package", "symbol", "footprint": appendField(&li.FormFactor, &records[i]) - case "specs", "specifications", "properties", "attributes", "value", "type": + case "specs", "specifications", "properties", "attributes", "value": appendField(&li.Specs, &records[i]) case "comment", "comments", "note", "notes": appendField(&li.Comment, &records[i]) diff --git a/templates/bom_view.html b/templates/bom_view.html index 2606217..cbd3474 100644 --- a/templates/bom_view.html +++ b/templates/bom_view.html @@ -12,7 +12,7 @@ elements manufacturer mpn - function + description form_factor specs category @@ -25,7 +25,7 @@ {{ range .Elements }}{{ if . }}{{ . }} {{ end }}{{ end }} {{ .Manufacturer }} {{ .Mpn }} - {{ .Function }} + {{ .Description }} {{ .FormFactor }} {{ .Specs }} {{ .Category }} -- cgit v1.2.3