fix: eagle library description
This commit is contained in:
parent
8f8b535dd3
commit
cfc34e1dfc
15
cvlp_lib.js
15
cvlp_lib.js
|
@ -436,6 +436,8 @@ function json2eagle(json) {
|
||||||
var docType = document.implementation.createDocumentType('eagle', 'SYSTEM', 'eagle.dtd');
|
var docType = document.implementation.createDocumentType('eagle', 'SYSTEM', 'eagle.dtd');
|
||||||
var xml = document.implementation.createDocument('', 'eagle', docType);
|
var xml = document.implementation.createDocument('', 'eagle', docType);
|
||||||
xml.documentElement.setAttribute('version','6.0')
|
xml.documentElement.setAttribute('version','6.0')
|
||||||
|
var comment = xml.createComment('footprint generated from CuVoodoo Land Pattern, author: '+json.author+', version: '+json.version+', date: '+json.date)
|
||||||
|
xml.documentElement.appendChild(comment)
|
||||||
var drawing = xml.createElement('drawing')
|
var drawing = xml.createElement('drawing')
|
||||||
xml.documentElement.appendChild(drawing)
|
xml.documentElement.appendChild(drawing)
|
||||||
// settings and grid are skipped
|
// settings and grid are skipped
|
||||||
|
@ -461,20 +463,21 @@ function json2eagle(json) {
|
||||||
drawing.appendChild(library)
|
drawing.appendChild(library)
|
||||||
// add description
|
// add description
|
||||||
var description = xml.createElement('description')
|
var description = xml.createElement('description')
|
||||||
|
description.textContent = json.name
|
||||||
library.appendChild(description)
|
library.appendChild(description)
|
||||||
description.textContent = 'footprint generated from CuVoodoo Land Pattern<br>'
|
//description.textContent = 'footprint generated from CuVoodoo Land Pattern<br>'
|
||||||
description.textContent += 'author: '+json.author+'<br>'
|
//description.textContent += 'author: '+json.author+'<br>'
|
||||||
description.textContent += 'version: '+json.version+'<br>'
|
//description.textContent += 'version: '+json.version+'<br>'
|
||||||
description.textContent += 'date: '+json.date
|
//description.textContent += 'date: '+json.date
|
||||||
// add package
|
// add package
|
||||||
var packages = xml.createElement('packages')
|
var packages = xml.createElement('packages')
|
||||||
library.appendChild(packages)
|
library.appendChild(packages)
|
||||||
var packag = xml.createElement('package')
|
var packag = xml.createElement('package')
|
||||||
|
packag.setAttribute('name','OSHW')
|
||||||
packages.appendChild(packag)
|
packages.appendChild(packag)
|
||||||
packag.setAttribute('name','oshw_logo')
|
|
||||||
var desc = xml.createElement('description')
|
var desc = xml.createElement('description')
|
||||||
|
desc.textContent = json.name
|
||||||
packag.appendChild(desc)
|
packag.appendChild(desc)
|
||||||
desc.innerHtml = json.name
|
|
||||||
// add element parts
|
// add element parts
|
||||||
// note: in eagle the origin is the bottom left corner (negate y to be compatible with the json coordinate system)
|
// note: in eagle the origin is the bottom left corner (negate y to be compatible with the json coordinate system)
|
||||||
for (var element_i in json.elements) {
|
for (var element_i in json.elements) {
|
||||||
|
|
Loading…
Reference in New Issue