Bugfixes in custom pattern and connector symbol generators
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "qeda",
|
||||
"version": "0.0.47",
|
||||
"version": "0.0.48",
|
||||
"description": "QEDA — a tool for creating libraries of electronic components",
|
||||
"main": "lib/qeda.js",
|
||||
"bin": {
|
||||
|
||||
@@ -45,13 +45,16 @@ copperPads = (pattern, element, suffix = '') ->
|
||||
else if housing['rowCount' + suffix]? and housing['columnCount' + suffix]?
|
||||
hasPads = true
|
||||
rowCount = housing['rowCount' + suffix]
|
||||
rowPitch = housing['rowPitch' + suffix] ? housing['pitch' + suffix]
|
||||
rowDXs = element.parseMultiple housing['rowDX' + suffix]
|
||||
rowDYs = element.parseMultiple housing['rowDY' + suffix]
|
||||
columnCounts = element.parseMultiple housing['columnCount' + suffix]
|
||||
if rowCount is 1
|
||||
rowPitch = 0
|
||||
else
|
||||
rowPitch = housing['rowPitch' + suffix] ? housing['pitch' + suffix]
|
||||
rowDXs = pattern.parseArray housing['rowDX' + suffix]
|
||||
rowDYs = pattern.parseArray housing['rowDY' + suffix]
|
||||
columnCounts = pattern.parseArray housing['columnCount' + suffix]
|
||||
columnPitch = housing['columnPitch' + suffix] ? housing['pitch' + suffix]
|
||||
columnDXs = element.parseMultiple housing['columnDX' + suffix]
|
||||
columnDYs = element.parseMultiple housing['columnDY' + suffix]
|
||||
columnDXs = pattern.parseArray housing['columnDX' + suffix]
|
||||
columnDYs = pattern.parseArray housing['columnDY' + suffix]
|
||||
y = -rowPitch*(rowCount - 1)/2
|
||||
for row in [0..(rowCount - 1)]
|
||||
columnCount = columnCounts[row] ? columnCounts[0]
|
||||
|
||||
@@ -110,6 +110,14 @@ class QedaPattern
|
||||
@pads[name] = @_addPad pad
|
||||
this
|
||||
|
||||
#
|
||||
# Parse array of floats
|
||||
#
|
||||
parseArray: (input) ->
|
||||
unless input? then return [0]
|
||||
result = input.toString().replace(/\s+/g, '').split(',').map((v) => parseFloat(v))
|
||||
result
|
||||
|
||||
#
|
||||
# Parse position point(s)
|
||||
#
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = (symbol, element) ->
|
||||
schematic.showPinNumbers ?= true
|
||||
schematic.pinIcon = pinIcon
|
||||
|
||||
unless symbol.left.length and symbol.right.length # Automatic
|
||||
if (not symbol.left.length) and (not symbol.right.length) # Automatic
|
||||
numbers = Object.keys element.pins
|
||||
if schematic.single
|
||||
numbers.map (v) -> symbol.right.push v
|
||||
|
||||
Reference in New Issue
Block a user