2011-02-11 23:21:04 +01:00
|
|
|
-- Symbol names
|
|
|
|
local names_A =
|
|
|
|
{
|
|
|
|
en = "Ammeter",
|
2011-03-04 17:47:04 +01:00
|
|
|
cs = "Ampérmetr",
|
2011-03-06 21:34:21 +01:00
|
|
|
sk = "Ampérmeter",
|
2011-03-07 06:11:44 +01:00
|
|
|
pl = "Amperomierz",
|
|
|
|
de = "Ampermeter"
|
2011-02-11 23:21:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
local names_V =
|
|
|
|
{
|
|
|
|
en = "Voltmeter",
|
2011-03-04 17:47:04 +01:00
|
|
|
cs = "Voltmetr",
|
2011-03-06 21:34:21 +01:00
|
|
|
sk = "Voltmeter",
|
2011-03-07 06:11:44 +01:00
|
|
|
pl = "Woltomierz",
|
|
|
|
de = "Voltmeter"
|
2011-02-11 23:21:04 +01:00
|
|
|
}
|
|
|
|
|
2011-03-06 13:25:43 +01:00
|
|
|
local names_ohm =
|
|
|
|
{
|
|
|
|
en = "Ohmmeter",
|
|
|
|
cs = "Ohmmetr",
|
2011-03-06 21:34:21 +01:00
|
|
|
sk = "Ohmmeter",
|
2011-03-07 06:11:44 +01:00
|
|
|
pl = "Omomierz",
|
|
|
|
de = "Ohmmeter"
|
2011-03-06 13:25:43 +01:00
|
|
|
}
|
|
|
|
|
2011-02-11 23:21:04 +01:00
|
|
|
-- Render area in base units (X1, Y1, X2, Y2)
|
2011-02-24 08:14:48 +01:00
|
|
|
local area = {-2, -2, 2, 2}
|
2011-02-11 23:21:04 +01:00
|
|
|
|
|
|
|
-- Terminal points
|
2011-02-24 08:14:48 +01:00
|
|
|
local terminals = {{-2, 0}, {2, 0}, {0, -2}, {0, 2}}
|
2011-02-11 23:21:04 +01:00
|
|
|
|
|
|
|
-- Rendering
|
2011-02-24 08:14:48 +01:00
|
|
|
local render_A = function (cr)
|
2011-02-11 23:21:04 +01:00
|
|
|
-- The circle
|
|
|
|
cr.arc (0, 0, 2, 0, math.pi * 2)
|
|
|
|
|
2011-02-24 08:14:48 +01:00
|
|
|
-- The letter A
|
|
|
|
cr.move_to (-0.4, 0.5)
|
|
|
|
cr.line_to (0, -0.5)
|
|
|
|
cr.line_to (0.4, 0.5)
|
2011-02-11 23:21:04 +01:00
|
|
|
|
2011-02-24 08:14:48 +01:00
|
|
|
cr.move_to (-0.3, 0.25)
|
|
|
|
cr.line_to (0.3, 0.25)
|
2011-02-11 23:21:04 +01:00
|
|
|
|
|
|
|
cr.stroke ()
|
|
|
|
end
|
|
|
|
|
|
|
|
local render_V = function (cr)
|
2011-02-24 08:14:48 +01:00
|
|
|
-- The circle
|
|
|
|
cr.arc (0, 0, 2, 0, math.pi * 2)
|
2011-02-11 23:21:04 +01:00
|
|
|
|
2011-02-24 08:14:48 +01:00
|
|
|
-- The letter V
|
|
|
|
cr.move_to (-0.4, -0.5)
|
|
|
|
cr.line_to (0, 0.5)
|
|
|
|
cr.line_to (0.4, -0.5)
|
2011-02-11 23:21:04 +01:00
|
|
|
|
2011-02-24 08:14:48 +01:00
|
|
|
cr.stroke ()
|
2011-02-11 23:21:04 +01:00
|
|
|
end
|
|
|
|
|
2011-03-06 13:25:43 +01:00
|
|
|
local render_ohm = function (cr)
|
|
|
|
-- The circle
|
|
|
|
cr.arc (0, 0, 2, 0, math.pi * 2)
|
|
|
|
|
|
|
|
-- The capital letter omega
|
|
|
|
cr.move_to (-0.5, 0.5)
|
|
|
|
cr.line_to (-0.15, 0.5)
|
|
|
|
cr.curve_to (-0.15, 0.5, -0.4, 0.3, -0.4, 0)
|
|
|
|
cr.curve_to (-0.4, -0.25, -0.25, -0.5, 0, -0.5)
|
|
|
|
cr.curve_to (0.25, -0.5, 0.4, -0.25, 0.4, 0)
|
|
|
|
cr.curve_to (0.4, 0.3, 0.15, 0.5, 0.15, 0.5)
|
|
|
|
cr.line_to (0.5, 0.5)
|
|
|
|
|
|
|
|
cr.stroke ()
|
|
|
|
end
|
|
|
|
|
2011-02-11 23:21:04 +01:00
|
|
|
-- Register the symbols
|
2011-03-06 13:25:43 +01:00
|
|
|
logdiag.register ("Ammeter", names_A, area, terminals, render_A)
|
|
|
|
logdiag.register ("Voltmeter", names_V, area, terminals, render_V)
|
|
|
|
logdiag.register ("Ohmmeter", names_ohm, area, terminals, render_ohm)
|
2011-02-11 23:21:04 +01:00
|
|
|
|
|
|
|
|