aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2012-04-25 01:19:34 -0400
committerbnewbold <bnewbold@robocracy.org>2012-04-25 01:19:34 -0400
commit5f8ed9ec31f3d8195b86c3e667ecd77cf52b52f1 (patch)
tree028badf7942e60d9bf54706185c4a9a1445a3177
parent8df9f74d7045e374bfce631e84feb90d6380bb7a (diff)
downloadbommom-5f8ed9ec31f3d8195b86c3e667ecd77cf52b52f1.tar.gz
bommom-5f8ed9ec31f3d8195b86c3e667ecd77cf52b52f1.zip
revert Function to Description
-rw-r--r--core.go2
-rw-r--r--formats.go18
-rw-r--r--templates/bom_view.html4
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 @@
<th>elements
<th>manufacturer
<th>mpn
- <th>function
+ <th>description
<th>form_factor
<th>specs
<th>category
@@ -25,7 +25,7 @@
<td>{{ range .Elements }}{{ if . }}{{ . }} {{ end }}{{ end }}
<td>{{ .Manufacturer }}
<td>{{ .Mpn }}
- <td>{{ .Function }}
+ <td>{{ .Description }}
<td>{{ .FormFactor }}
<td>{{ .Specs }}
<td>{{ .Category }}