PCB metadata propagation
This commit is contained in:
parent
90db02f751
commit
13052cd798
6 changed files with 17 additions and 13 deletions
|
@ -80,7 +80,7 @@ const process = async (raw, debug=false, logger=()=>{}) => {
|
|||
}
|
||||
|
||||
logger('Scaffolding PCBs...')
|
||||
const pcbs = pcbs_lib.parse(config.pcbs || {}, points, outlines, units)
|
||||
const pcbs = pcbs_lib.parse(config, points, outlines, units)
|
||||
results.pcbs = {}
|
||||
for (const [pcb_name, pcb_text] of Object.entries(pcbs)) {
|
||||
if (!debug && pcb_name.startsWith('_')) continue
|
||||
|
|
|
@ -234,7 +234,7 @@ const footprint = exports._footprint = (config, name, points, point, net_indexer
|
|||
|
||||
exports.parse = (config, points, outlines, units) => {
|
||||
|
||||
const pcbs = a.sane(config || {}, 'pcbs', 'object')()
|
||||
const pcbs = a.sane(config.pcbs || {}, 'pcbs', 'object')()
|
||||
const results = {}
|
||||
|
||||
for (const [pcb_name, pcb_config] of Object.entries(pcbs)) {
|
||||
|
@ -301,8 +301,12 @@ exports.parse = (config, points, outlines, units) => {
|
|||
const nets_text = nets_arr.join('\n')
|
||||
const footprint_text = footprints.join('\n')
|
||||
const outline_text = Object.values(kicad_outlines).join('\n')
|
||||
const personalized_prefix = kicad_prefix
|
||||
.replace('KEYBOARD_NAME_HERE', pcb_name)
|
||||
.replace('VERSION_HERE', config.meta && config.meta.version || 'v1.0.0')
|
||||
.replace('YOUR_NAME_HERE', config.meta && config.meta.author || 'Unknown')
|
||||
results[pcb_name] = `
|
||||
${kicad_prefix}
|
||||
${personalized_prefix}
|
||||
${nets_text}
|
||||
${netclass}
|
||||
${footprint_text}
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
(page A3)
|
||||
(title_block
|
||||
(title KEYBOARD_NAME_HERE)
|
||||
(rev VERSION_HERE)
|
||||
(company YOUR_NAME_HERE)
|
||||
(title _export)
|
||||
(rev v1.0.0)
|
||||
(company Unknown)
|
||||
)
|
||||
|
||||
(general
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
(page A3)
|
||||
(title_block
|
||||
(title KEYBOARD_NAME_HERE)
|
||||
(rev VERSION_HERE)
|
||||
(company YOUR_NAME_HERE)
|
||||
(title export)
|
||||
(rev v1.0.0)
|
||||
(company Unknown)
|
||||
)
|
||||
|
||||
(general
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
(page A3)
|
||||
(title_block
|
||||
(title KEYBOARD_NAME_HERE)
|
||||
(rev VERSION_HERE)
|
||||
(company YOUR_NAME_HERE)
|
||||
(title export)
|
||||
(rev v1.0.0)
|
||||
(company Unknown)
|
||||
)
|
||||
|
||||
(general
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue