2011-02-07 10:56:39 +01:00
|
|
|
-- Symbol names
|
2011-02-11 18:37:00 +01:00
|
|
|
local names =
|
2011-01-09 05:05:31 +01:00
|
|
|
{
|
|
|
|
en = "Inductor",
|
2011-03-04 17:47:04 +01:00
|
|
|
cs = "Cívka",
|
2011-03-06 21:34:21 +01:00
|
|
|
sk = "Cievka",
|
2011-03-07 06:11:44 +01:00
|
|
|
pl = "Cewka",
|
|
|
|
de = "Spule"
|
2011-01-09 05:05:31 +01:00
|
|
|
}
|
|
|
|
|
2011-02-09 14:18:22 +01:00
|
|
|
local names_core =
|
2011-02-07 10:56:39 +01:00
|
|
|
{
|
|
|
|
en = "Inductor with magnetic core",
|
2011-03-04 17:47:04 +01:00
|
|
|
cs = "Cívka s magnetickým jádrem",
|
2011-03-06 21:34:21 +01:00
|
|
|
sk = "Cievka s magnetickým jadrom",
|
2011-03-07 06:11:44 +01:00
|
|
|
pl = "Cewka z jądrem magnetycznym",
|
|
|
|
de = "Magnetspule"
|
2011-02-07 10:56:39 +01:00
|
|
|
}
|
|
|
|
|
2011-01-09 05:05:31 +01:00
|
|
|
-- Render area in base units (X1, Y1, X2, Y2)
|
2011-02-09 14:18:22 +01:00
|
|
|
local area = {-2, -1, 2, 0}
|
2011-01-09 05:05:31 +01:00
|
|
|
|
2011-02-11 18:37:00 +01:00
|
|
|
-- Terminal points
|
2011-02-09 14:18:22 +01:00
|
|
|
local terminals = {{-2, 0}, {2, 0}}
|
2011-01-09 05:05:31 +01:00
|
|
|
|
|
|
|
-- Rendering
|
2011-02-11 18:37:00 +01:00
|
|
|
local render = function (cr)
|
2011-01-09 05:05:31 +01:00
|
|
|
-- The arcs
|
2012-08-12 06:10:27 +02:00
|
|
|
cr:arc (-1.5, 0, 0.5, math.pi, 0)
|
|
|
|
cr:arc (-0.5, 0, 0.5, math.pi, 0)
|
|
|
|
cr:arc (0.5, 0, 0.5, math.pi, 0)
|
|
|
|
cr:arc (1.5, 0, 0.5, math.pi, 0)
|
2011-02-11 18:37:00 +01:00
|
|
|
|
2012-08-12 06:10:27 +02:00
|
|
|
cr:stroke ()
|
2011-02-07 10:56:39 +01:00
|
|
|
end
|
|
|
|
|
2011-02-09 14:18:22 +01:00
|
|
|
local render_core = function (cr)
|
2011-02-11 18:37:00 +01:00
|
|
|
render (cr)
|
2011-01-09 05:05:31 +01:00
|
|
|
|
2011-02-07 10:56:39 +01:00
|
|
|
-- The core
|
2012-08-12 06:10:27 +02:00
|
|
|
cr:move_to (-2, -1)
|
|
|
|
cr:line_to (2, -1)
|
2011-02-11 18:37:00 +01:00
|
|
|
|
2012-08-12 06:10:27 +02:00
|
|
|
cr:stroke ()
|
2011-01-09 05:05:31 +01:00
|
|
|
end
|
|
|
|
|
2011-02-07 10:56:39 +01:00
|
|
|
-- Register the symbols
|
2011-02-11 18:37:00 +01:00
|
|
|
logdiag.register ("Inductor", names, area, terminals, render)
|
|
|
|
logdiag.register ("InductorWithCore", names_core, area, terminals, render_core)
|
2011-01-09 05:05:31 +01:00
|
|
|
|
|
|
|
|