Add symbol orientations.

This commit is contained in:
David Craven
2018-01-31 18:14:22 +01:00
parent e572099f81
commit 6f3ebc1cf5
7 changed files with 11 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ class QedaSymbol
@settings = element.library.symbol
@shapes = []
@attributes = []
@orientations = [0]
@currentLineWidth = 0
sides = ['left', 'right', 'top', 'bottom']
schematic = element.schematic

View File

@@ -3,6 +3,9 @@ twoSided = require './common/two-sided'
module.exports = (symbol, element, icons = Icons) ->
element.refDes = 'C'
symbol.orientations = [0, 90, 180, 270]
if element.schematic.polarized == true
symbol.orientations = [0, 90]
icon = new icons.Capacitor(symbol, element)
twoSided symbol, element, icon

View File

@@ -4,7 +4,6 @@ module.exports = (symbol, element, icon, leftName = 'L', rightName = 'R') ->
schematic = element.schematic
settings = symbol.settings
pins = element.pins
schematic.showPinNames ?= false
leftRegEx = new RegExp("^" + leftName)
@@ -37,6 +36,7 @@ module.exports = (symbol, element, icon, leftName = 'L', rightName = 'R') ->
schematic.showPinNames = true
schematic.showPinNumbers = true
enclosure symbol, element, icon
symbol.orientations = [0]
else
decorated = (left.length > 1) or (right.length > 1) or (nc?.length)

View File

@@ -3,6 +3,7 @@ twoSided = require './common/two-sided'
module.exports = (symbol, element, icons = Icons) ->
element.refDes = 'Y'
symbol.orientations = [0, 90, 180, 270]
icon = new icons.Crystal(symbol, element)
twoSided symbol, element, icon

View File

@@ -3,6 +3,9 @@ twoSided = require './common/two-sided'
module.exports = (symbol, element, icons = Icons) ->
element.refDes = 'D'
symbol.orientations = [0, 90]
if element.schematic.zener == true
symbol.orientations = [180, 270]
icon = new icons.Diode(symbol, element)
# Cathode on the right but has number 1

View File

@@ -3,6 +3,7 @@ twoSided = require './common/two-sided'
module.exports = (symbol, element, icons = Icons) ->
element.refDes = 'L'
symbol.orientations = [0, 90, 180, 270]
icon = new icons.Inductor(symbol, element)
twoSided symbol, element, icon

View File

@@ -3,6 +3,7 @@ twoSided = require './common/two-sided'
module.exports = (symbol, element, icons = Icons) ->
element.refDes = 'R'
symbol.orientations = [0, 90, 180, 270]
icon = new icons.Resistor(symbol, element)
twoSided symbol, element, icon