logdiag/share/library/Passive/capacitor.lua

40 lines
633 B
Lua
Raw Normal View History

-- Symbol name
local names =
{
en = "Capacitor",
2011-03-04 17:47:04 +01:00
cs = "Kondenzátor",
2011-03-06 21:34:21 +01:00
sk = "Kondenzátor",
2011-03-07 06:11:44 +01:00
pl = "Kondensator",
de = "Kondensator"
}
-- Render area in base units (X1, Y1, X2, Y2)
2011-03-06 12:27:35 +01:00
local area = {-2, -1, 2, 1}
-- Terminal points
local terminals = {{-2, 0}, {2, 0}}
-- Rendering
local render = function (cr)
-- The vertical lines
cr:move_to (-0.2, -1)
cr:line_to (-0.2, 1)
cr:move_to (0.2, -1)
cr:line_to (0.2, 1)
-- The terminals
cr:move_to (-2, 0)
cr:line_to (-0.2, 0)
cr:move_to (0.2, 0)
cr:line_to (2, 0)
cr:stroke ()
end
-- Register the symbol
2011-03-06 12:27:35 +01:00
logdiag.register ("Capacitor", names, area, terminals, render)