mirror of
https://github.com/TECHNOFAB11/ergogen.git
synced 2025-12-12 08:00:06 +01:00
Injectable PCB templates
This commit is contained in:
parent
21e50cb11d
commit
6079aaf332
31 changed files with 277 additions and 251 deletions
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,8 +92,8 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
|
||||
(net 0 "")
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -104,9 +104,8 @@
|
|||
(add_net "")
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,8 +92,8 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
|
||||
(net 0 "")
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -104,9 +104,8 @@
|
|||
(add_net "")
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
1
test/cli/bundle/reference/pcbs/custom_template.kicad_pcb
Normal file
1
test/cli/bundle/reference/pcbs/custom_template.kicad_pcb
Normal file
|
|
@ -0,0 +1 @@
|
|||
Custom template override. The secret is 42.
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,8 +92,8 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
|
||||
(net 0 "")
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -104,7 +104,7 @@
|
|||
(add_net "")
|
||||
)
|
||||
|
||||
|
||||
|
||||
(module injected_test_footprint (layer F.Cu) (tedit 5E1ADAC2)
|
||||
(at 0 0 0)
|
||||
|
||||
|
|
@ -112,11 +112,10 @@
|
|||
(fp_text reference "I1" (at 0 0) (layer F.SilkS) hide (effects (font (size 1.27 1.27) (thickness 0.15))))
|
||||
)
|
||||
|
||||
(gr_line (start -9 9) (end 9 9) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start -9 9) (end 9 9) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 9 9) (end 9 -9) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 9 -9) (end -9 -9) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start -9 -9) (end -9 9) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,8 +92,8 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
|
||||
(net 0 "")
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -104,9 +104,8 @@
|
|||
(add_net "")
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
BIN
test/fixtures/bundle.zip
vendored
BIN
test/fixtures/bundle.zip
vendored
Binary file not shown.
5
test/fixtures/bundle/config.yaml
vendored
5
test/fixtures/bundle/config.yaml
vendored
|
|
@ -11,3 +11,8 @@ pcbs:
|
|||
injected:
|
||||
what: injected
|
||||
where: matrix
|
||||
custom_template:
|
||||
outlines.edge.outline: box
|
||||
template: custom_template
|
||||
params:
|
||||
secret: 42
|
||||
3
test/fixtures/bundle/templates/custom_template.js
vendored
Normal file
3
test/fixtures/bundle/templates/custom_template.js
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = params => {
|
||||
return `Custom template override. The secret is ${params.custom.secret}.`
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,10 +92,10 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
(net 0 "")
|
||||
(net 1 "from")
|
||||
(net 2 "to")
|
||||
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
(add_net "to")
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
(module E73:SW_TACT_ALPS_SKQGABE010 (layer F.Cu) (tstamp 5BF2CC94)
|
||||
|
||||
|
|
@ -168,8 +168,7 @@
|
|||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,10 +92,10 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
(net 0 "")
|
||||
(net 1 "from")
|
||||
(net 2 "to")
|
||||
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
(add_net "to")
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
(module PG1350 (layer F.Cu) (tedit 5DD50112)
|
||||
(at 0 0 0)
|
||||
|
|
@ -353,8 +353,7 @@
|
|||
(pad 2 smd rect (at -8.275 -3.75 0) (size 2.6 2.6) (layers F.Cu F.Paste F.Mask) (net 2 "to"))
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,10 +92,10 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
(net 0 "")
|
||||
(net 1 "from")
|
||||
(net 2 "to")
|
||||
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
(add_net "to")
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
(module lib:Kailh_PG1232 (layer F.Cu) (tedit 5E1ADAC2)
|
||||
(at 0 0 0)
|
||||
|
|
@ -328,8 +328,7 @@
|
|||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,10 +92,10 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
(net 0 "")
|
||||
(net 1 "from")
|
||||
(net 2 "to")
|
||||
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
(add_net "to")
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
(module ComboDiode (layer F.Cu) (tedit 5B24D78E)
|
||||
|
||||
|
|
@ -147,8 +147,7 @@
|
|||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,10 +92,10 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
(net 0 "")
|
||||
(net 1 "from")
|
||||
(net 2 "to")
|
||||
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
(add_net "to")
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
(module MX (layer F.Cu) (tedit 5DD4F656)
|
||||
(at 0 0 0)
|
||||
|
|
@ -353,8 +353,7 @@
|
|||
(pad 2 smd rect (at -5.842 -5.08 0) (size 2.55 2.5) (layers F.Cu F.Paste F.Mask) (net 2 "to"))
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,9 +92,9 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
(net 0 "")
|
||||
(net 1 "net")
|
||||
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -106,7 +106,7 @@
|
|||
(add_net "net")
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
(module SMDPad (layer F.Cu) (tedit 5B24D78E)
|
||||
|
||||
|
|
@ -219,8 +219,7 @@
|
|||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
(net 0 "")
|
||||
(net 1 "RAW")
|
||||
(net 2 "GND")
|
||||
(net 3 "RST")
|
||||
|
|
@ -115,7 +115,7 @@
|
|||
(net 20 "P7")
|
||||
(net 21 "P8")
|
||||
(net 22 "P9")
|
||||
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -148,7 +148,7 @@
|
|||
(add_net "P9")
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
(module ProMicro (layer F.Cu) (tedit 5B307E4C)
|
||||
(at 0 0 0)
|
||||
|
|
@ -312,8 +312,7 @@
|
|||
(pad 24 thru_hole circle (at 13.97 7.62 0) (size 1.7526 1.7526) (drill 1.0922) (layers *.Cu *.SilkS *.Mask) (net 22 "P9"))
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
(net 0 "")
|
||||
(net 1 "from")
|
||||
(net 2 "to")
|
||||
(net 3 "pos")
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
(net 13 "C")
|
||||
(net 14 "D")
|
||||
(net 15 "net")
|
||||
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -134,7 +134,7 @@
|
|||
(add_net "net")
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
(module ALPS (layer F.Cu) (tedit 5CF31DEF)
|
||||
|
||||
|
|
@ -522,8 +522,7 @@
|
|||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,12 +92,12 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
(net 0 "")
|
||||
(net 1 "A")
|
||||
(net 2 "B")
|
||||
(net 3 "C")
|
||||
(net 4 "D")
|
||||
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -112,7 +112,7 @@
|
|||
(add_net "D")
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
(module TRRS-PJ-320A-dual (layer F.Cu) (tedit 5970F8E5)
|
||||
|
||||
|
|
@ -221,8 +221,7 @@
|
|||
(pad 4 thru_hole oval (at 0 3.2 0) (size 1.6 2.2) (drill oval 0.9 1.5) (layers *.Cu *.Mask) (net 4 "D"))
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -139,4 +139,8 @@ exports.inject = (ergogen) => {
|
|||
return `references ${p.ref_hide ? 'hidden' : 'shown'}`
|
||||
}
|
||||
})
|
||||
|
||||
ergogen.inject('template', 'template_test', params => {
|
||||
return `Custom template override. The secret is ${params.custom.secret}.`
|
||||
})
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ const glob = require('glob')
|
|||
const u = require('../src/utils')
|
||||
const a = require('../src/assert')
|
||||
const ergogen = require('../src/ergogen')
|
||||
require('./helpers/mock_footprints').inject(ergogen)
|
||||
require('./helpers/mock').inject(ergogen)
|
||||
|
||||
let what = process.env.npm_config_what
|
||||
const dump = process.env.npm_config_dump
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,12 +92,12 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
(net 0 "")
|
||||
(net 1 "P1")
|
||||
(net 2 "T4_1")
|
||||
(net 3 "T4_2")
|
||||
(net 4 "T4_3")
|
||||
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -112,7 +112,7 @@
|
|||
(add_net "T4_3")
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
(module trace_test (layer F.Cu) (tedit 5CF31DEF)
|
||||
|
||||
|
|
@ -234,7 +234,7 @@
|
|||
)
|
||||
|
||||
|
||||
(gr_line (start -9.5 9.5) (end 9.5 9.5) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start -9.5 9.5) (end 9.5 9.5) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 9.5 9.5) (end 9.5 -9.5) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 9.5 -9.5) (end -9.5 -9.5) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start -9.5 -9.5) (end -9.5 9.5) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
|
|
@ -242,7 +242,6 @@
|
|||
(gr_line (start 29.5 9.5) (end 29.5 -9.5) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 29.5 -9.5) (end 10.5 -9.5) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 10.5 -9.5) (end 10.5 9.5) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
6
test/pcbs/mock_template.yaml
Normal file
6
test/pcbs/mock_template.yaml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
points.zones.matrix:
|
||||
pcbs:
|
||||
main:
|
||||
template: template_test
|
||||
params:
|
||||
secret: 42
|
||||
1
test/pcbs/mock_template___pcbs_main.kicad_pcb
Normal file
1
test/pcbs/mock_template___pcbs_main.kicad_pcb
Normal file
|
|
@ -0,0 +1 @@
|
|||
Custom template override. The secret is 42.
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,8 +92,8 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
|
||||
(net 0 "")
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -104,8 +104,8 @@
|
|||
(add_net "")
|
||||
)
|
||||
|
||||
|
||||
(gr_line (start -5.7 9.5) (end 5.699999999999999 9.5) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
|
||||
(gr_line (start -5.7 9.5) (end 5.699999999999999 9.5) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 9.5 5.7) (end 9.5 -5.699999999999999) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 5.699999999999999 -9.5) (end -5.7 -9.5) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start -9.5 -5.699999999999999) (end -9.5 5.7) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
|
|
@ -126,7 +126,6 @@
|
|||
(gr_line (start 14.25 0) (end 19 -4.75) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 19 -4.75) (end 23.75 0) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
(gr_line (start 23.75 0) (end 19 4.75) (angle 90) (layer Edge.Cuts) (width 0.15))
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,8 +92,8 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
|
||||
(net 0 "")
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -104,9 +104,8 @@
|
|||
(add_net "")
|
||||
)
|
||||
|
||||
references hidden
|
||||
|
||||
|
||||
references hidden
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
|
||||
(kicad_pcb (version 20171130) (host pcbnew 5.1.6)
|
||||
|
||||
(page A3)
|
||||
|
|
@ -92,8 +92,8 @@
|
|||
(outputdirectory ""))
|
||||
)
|
||||
|
||||
(net 0 "")
|
||||
|
||||
(net 0 "")
|
||||
|
||||
(net_class Default "This is the default net class."
|
||||
(clearance 0.2)
|
||||
(trace_width 0.25)
|
||||
|
|
@ -104,9 +104,8 @@
|
|||
(add_net "")
|
||||
)
|
||||
|
||||
references shown
|
||||
|
||||
|
||||
references shown
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue