From 299ce010bd8f2f5a65e4fa5a033a122b318b8c83 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Fri, 11 Feb 2011 18:37:00 +0100
Subject: 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.
---
share/library/Misc/ground.lua | 2 +-
share/library/Misc/lamp.lua | 7 ++++---
share/library/Misc/power-source.lua | 4 ++--
share/library/Misc/switch.lua | 8 ++++----
share/library/Misc/terminal.lua | 29 +++++++++++++++++++++++++++++
5 files changed, 40 insertions(+), 10 deletions(-)
create mode 100644 share/library/Misc/terminal.lua
(limited to 'share/library/Misc')
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)
+
+
--
cgit v1.2.3-70-g09d2