Update the symbol library.

* Add bipolar, IGFET and JFET transistors.
* Add more variants to some symbols.
* Add a symbol for a simple terminal.
* Avoid unneccessary stroke() calls.
* Fix comments.
This commit is contained in:
2011-02-11 18:37:00 +01:00
parent 2c5f2f5b3f
commit 299ce010bd
17 changed files with 511 additions and 59 deletions

View File

@@ -8,7 +8,7 @@ local names =
-- Render area in base units (X1, Y1, X2, Y2)
local area = {-1, -1, 1, 2}
-- Terminals
-- Terminal points
local terminals = {{0, -1}}
-- Rendering

View File

@@ -8,7 +8,7 @@ local names =
-- Render area in base units (X1, Y1, X2, Y2)
local area = {-2, -1, 2, 1}
-- Terminals
-- Terminal points
local terminals = {{-2, 0}, {2, 0}}
-- Rendering
@@ -25,16 +25,17 @@ local render = function (cr)
cr.move_to (1, -1)
cr.line_to (-1, 1)
cr.stroke ()
cr.stroke ()
cr.restore ()
-- The contacts
-- The terminals
cr.move_to (-2, 0)
cr.line_to (-1, 0)
cr.move_to (1, 0)
cr.line_to (2, 0)
cr.stroke ()
end

View File

@@ -8,7 +8,7 @@ local names =
-- Render area in base units (X1, Y1, X2, Y2)
local area = {-1, -2, 1, 2}
-- Terminals
-- Terminal points
local terminals = {{-1, 0}, {1, 0}}
-- Rendering
@@ -20,7 +20,7 @@ local render = function (cr)
cr.move_to (0.2, -2)
cr.line_to (0.2, 2)
-- The contacts
-- The terminals
cr.move_to (-1, 0)
cr.line_to (-0.2, 0)

View File

@@ -8,16 +8,16 @@ local names =
-- Render area in base units (X1, Y1, X2, Y2)
local area = {-2, -1.5, 2, 0}
-- Terminals
-- Terminal points
local terminals = {{-2, 0}, {2, 0}}
-- Rendering
local render_normal = function (cr)
local render = function (cr)
-- The switch contact
cr.move_to (1.3, -1.3)
cr.line_to (-1, 0)
-- The contacts
-- The terminals
cr.move_to (-2, 0)
cr.line_to (-1, 0)
@@ -28,6 +28,6 @@ local render_normal = function (cr)
end
-- Register the symbol
logdiag.register ("Switch", names, area, terminals, render_normal)
logdiag.register ("Switch", names, area, terminals, render)

View File

@@ -0,0 +1,29 @@
-- Symbol name
local names =
{
en = "Terminal",
cs = "Terminál"
}
-- Render area in base units (X1, Y1, X2, Y2)
local area = {-1, -0.5, 0.5, 0.5}
-- Terminal points
local terminals = {{-1, 0}}
-- Rendering
local render = function (cr)
-- The circle
cr.arc (0, 0, 0.3, 0, math.pi * 2)
-- The contact
cr.move_to (-1, 0)
cr.line_to (-0.3, 0)
cr.stroke ()
end
-- Register the symbol
logdiag.register ("Terminal", names, area, terminals, render)