summaryrefslogtreecommitdiff
path: root/share/library/Misc
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2011-02-11 18:37:00 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2011-02-11 18:37:00 +0100
commit299ce010bd8f2f5a65e4fa5a033a122b318b8c83 (patch)
tree3ceb61879650472395d20342a8007306182f03b2 /share/library/Misc
parent2c5f2f5b3f4782b25b35f1afc3ab63dd19b48a28 (diff)
downloadlogdiag-299ce010bd8f2f5a65e4fa5a033a122b318b8c83.tar.gz
logdiag-299ce010bd8f2f5a65e4fa5a033a122b318b8c83.tar.xz
logdiag-299ce010bd8f2f5a65e4fa5a033a122b318b8c83.zip
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.
Diffstat (limited to 'share/library/Misc')
-rw-r--r--share/library/Misc/ground.lua2
-rw-r--r--share/library/Misc/lamp.lua7
-rw-r--r--share/library/Misc/power-source.lua4
-rw-r--r--share/library/Misc/switch.lua8
-rw-r--r--share/library/Misc/terminal.lua29
5 files changed, 40 insertions, 10 deletions
diff --git a/share/library/Misc/ground.lua b/share/library/Misc/ground.lua
index 0c36240..0cd352a 100644
--- a/share/library/Misc/ground.lua
+++ b/share/library/Misc/ground.lua
@@ -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
diff --git a/share/library/Misc/lamp.lua b/share/library/Misc/lamp.lua
index 9ecf9ea..e80683f 100644
--- a/share/library/Misc/lamp.lua
+++ b/share/library/Misc/lamp.lua
@@ -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
diff --git a/share/library/Misc/power-source.lua b/share/library/Misc/power-source.lua
index 00a8498..c79b0ac 100644
--- a/share/library/Misc/power-source.lua
+++ b/share/library/Misc/power-source.lua
@@ -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)
diff --git a/share/library/Misc/switch.lua b/share/library/Misc/switch.lua
index c4d031e..06ca771 100644
--- a/share/library/Misc/switch.lua
+++ b/share/library/Misc/switch.lua
@@ -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)
diff --git a/share/library/Misc/terminal.lua b/share/library/Misc/terminal.lua
new file mode 100644
index 0000000..fe21f83
--- /dev/null
+++ b/share/library/Misc/terminal.lua
@@ -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)
+
+