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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
29
share/library/Misc/terminal.lua
Normal file
29
share/library/Misc/terminal.lua
Normal 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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user