From 00d9072c5b1a998c25b574e9694da32be3fb8222 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Mon, 7 Feb 2011 10:52:02 +0100
Subject: Add some miscellaneous symbols.
---
share/library/Misc/category.json | 5 +++
share/library/Misc/ground.lua | 36 +++++++++++++++++
share/library/Misc/icon.svg | 78 +++++++++++++++++++++++++++++++++++++
share/library/Misc/lamp.lua | 44 +++++++++++++++++++++
share/library/Misc/power-source.lua | 36 +++++++++++++++++
share/library/Misc/switch.lua | 33 ++++++++++++++++
6 files changed, 232 insertions(+)
create mode 100644 share/library/Misc/category.json
create mode 100644 share/library/Misc/ground.lua
create mode 100644 share/library/Misc/icon.svg
create mode 100644 share/library/Misc/lamp.lua
create mode 100644 share/library/Misc/power-source.lua
create mode 100644 share/library/Misc/switch.lua
(limited to 'share/library')
diff --git a/share/library/Misc/category.json b/share/library/Misc/category.json
new file mode 100644
index 0000000..8ec3331
--- /dev/null
+++ b/share/library/Misc/category.json
@@ -0,0 +1,5 @@
+{
+ "en": "Miscellaneous",
+ "cs": "Smíšené"
+}
+
diff --git a/share/library/Misc/ground.lua b/share/library/Misc/ground.lua
new file mode 100644
index 0000000..fdcf593
--- /dev/null
+++ b/share/library/Misc/ground.lua
@@ -0,0 +1,36 @@
+-- Symbol name
+names =
+{
+ en = "Ground",
+ cs = "Zem"
+}
+
+-- Render area in base units (X1, Y1, X2, Y2)
+area = {-1, -1, 1, 2}
+
+-- Terminals
+terminals = {{0, -1}}
+
+-- Rendering
+render = function (cr)
+ -- The vertical line
+ cr.move_to (0, -1)
+ cr.line_to (0, 0.5)
+
+ -- The horizontal lines
+ cr.move_to (-1, 0.5)
+ cr.line_to (1, 0.5)
+
+ cr.move_to (-0.75, 1.1)
+ cr.line_to (0.75, 1.1)
+
+ cr.move_to (-0.5, 1.7)
+ cr.line_to (0.5, 1.7)
+
+ cr.stroke ()
+end
+
+-- Register the symbol
+logdiag.register ("Ground", names, area, terminals, render)
+
+
diff --git a/share/library/Misc/icon.svg b/share/library/Misc/icon.svg
new file mode 100644
index 0000000..c504a45
--- /dev/null
+++ b/share/library/Misc/icon.svg
@@ -0,0 +1,78 @@
+
+
+
+
diff --git a/share/library/Misc/lamp.lua b/share/library/Misc/lamp.lua
new file mode 100644
index 0000000..b662cec
--- /dev/null
+++ b/share/library/Misc/lamp.lua
@@ -0,0 +1,44 @@
+-- Symbol name
+names =
+{
+ en = "Lamp",
+ cs = "Světelný zdroj"
+}
+
+-- Render area in base units (X1, Y1, X2, Y2)
+area = {-2, -1, 2, 1}
+
+-- Terminals
+terminals = {{-2, 0}, {2, 0}}
+
+-- Rendering
+render = function (cr)
+ -- The circle
+ cr.save ()
+
+ cr.arc (0, 0, 1, 0, 2 * math.pi)
+ cr.stroke_preserve ()
+ cr.clip ()
+
+ cr.move_to (-1, -1)
+ cr.line_to (1, 1)
+
+ cr.move_to (1, -1)
+ cr.line_to (-1, 1)
+ cr.stroke ()
+
+ cr.restore ()
+
+ -- The contacts
+ cr.move_to (-2, 0)
+ cr.line_to (-1, 0)
+
+ cr.move_to (1, 0)
+ cr.line_to (2, 0)
+ cr.stroke ()
+end
+
+-- Register the symbol
+logdiag.register ("Lamp", names, area, terminals, render)
+
+
diff --git a/share/library/Misc/power-source.lua b/share/library/Misc/power-source.lua
new file mode 100644
index 0000000..8fd98bb
--- /dev/null
+++ b/share/library/Misc/power-source.lua
@@ -0,0 +1,36 @@
+-- Symbol name
+names =
+{
+ en = "Power source",
+ cs = "Zdroj napětí"
+}
+
+-- Render area in base units (X1, Y1, X2, Y2)
+area = {-1, -2, 1, 2}
+
+-- Terminals
+terminals = {{-1, 0}, {1, 0}}
+
+-- Rendering
+render = function (cr)
+ -- The vertical lines
+ cr.move_to (-0.2, -1)
+ cr.line_to (-0.2, 1)
+
+ cr.move_to (0.2, -2)
+ cr.line_to (0.2, 2)
+
+ -- The contacts
+ cr.move_to (-1, 0)
+ cr.line_to (-0.2, 0)
+
+ cr.move_to (0.2, 0)
+ cr.line_to (1, 0)
+
+ cr.stroke ()
+end
+
+-- Register the symbol
+logdiag.register ("PowerSource", names, area, terminals, render)
+
+
diff --git a/share/library/Misc/switch.lua b/share/library/Misc/switch.lua
new file mode 100644
index 0000000..9d59fdf
--- /dev/null
+++ b/share/library/Misc/switch.lua
@@ -0,0 +1,33 @@
+-- Symbol name
+names =
+{
+ en = "Switch",
+ cs = "Spínač"
+}
+
+-- Render area in base units (X1, Y1, X2, Y2)
+area = {-2, -1.5, 2, 0}
+
+-- Terminals
+terminals = {{-2, 0}, {2, 0}}
+
+-- Rendering
+render_normal = function (cr)
+ -- The switch contact
+ cr.move_to (1.3, -1.3)
+ cr.line_to (-1, 0)
+
+ -- The contacts
+ cr.move_to (-2, 0)
+ cr.line_to (-1, 0)
+
+ cr.move_to (1, 0)
+ cr.line_to (2, 0)
+
+ cr.stroke ()
+end
+
+-- Register the symbol
+logdiag.register ("Switch", names, area, terminals, render_normal)
+
+
--
cgit v1.2.3-70-g09d2