1
0

PCB metadata propagation

This commit is contained in:
Bán Dénes 2021-12-15 20:55:09 +01:00
parent 90db02f751
commit 13052cd798
6 changed files with 17 additions and 13 deletions

View File

@ -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

View File

@ -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}

View File

@ -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

View File

@ -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

View File

@ -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