diff --git a/distribution/ReleaseNotes.txt b/distribution/ReleaseNotes.txt
index 1891f82ea..f8464ab55 100644
--- a/distribution/ReleaseNotes.txt
+++ b/distribution/ReleaseNotes.txt
@@ -1,7 +1,8 @@
Release Notes
HEAD, planned as v0.20
-- improved zooming and navigating in the measurement graph
+- Improved zooming and navigating in the measurement graph.
+- Added multi pole double-throw relays.
v0.19, released on 14. June 2018
- Added a tabbed pane to the attributes dialog to make it more beginner friendly.
diff --git a/src/test/java/de/neemann/digital/integration/TestExamples.java b/src/test/java/de/neemann/digital/integration/TestExamples.java
index 577d134d2..2c7341255 100644
--- a/src/test/java/de/neemann/digital/integration/TestExamples.java
+++ b/src/test/java/de/neemann/digital/integration/TestExamples.java
@@ -45,8 +45,8 @@ public class TestExamples extends TestCase {
public void testTestExamples() throws Exception {
File examples = new File(Resources.getRoot(), "/dig/test");
testCasesInFiles = 0;
- assertEquals(135, new FileScanner(TestExamples::check).scan(examples));
- assertEquals(127, testCasesInFiles);
+ assertEquals(137, new FileScanner(TestExamples::check).scan(examples));
+ assertEquals(129, testCasesInFiles);
}
/**
diff --git a/src/test/resources/dig/test/switch/relayFullAdder.dig b/src/test/resources/dig/test/switch/relayFullAdder.dig
new file mode 100644
index 000000000..0d18f190e
--- /dev/null
+++ b/src/test/resources/dig/test/switch/relayFullAdder.dig
@@ -0,0 +1,349 @@
+
+
+ 1
+
+
+
+ In
+
+
+ Label
+ A
+
+
+
+
+
+ In
+
+
+ Label
+ B
+
+
+
+
+
+ Testcase
+
+
+ Testdata
+
+ A B C Sum Carry
+loop (C,2)
+loop (A,2)
+loop (B,2)
+let s=A+B+C;
+ (A) (B) (C) (s&1) (s>>1)
+end loop
+end loop
+end loop
+
+
+
+
+
+
+
+ In
+
+
+ Label
+ C
+
+
+
+
+
+ RelayDT
+
+
+ poles
+ 2
+
+
+ rotation
+
+
+
+
+
+
+ RelayDT
+
+
+ poles
+ 2
+
+
+
+
+
+ Ground
+
+
+
+
+ Ground
+
+
+
+
+ VDD
+
+
+
+
+ Out
+
+
+ Label
+ Sum
+
+
+
+
+
+ Out
+
+
+ Label
+ Carry
+
+
+
+
+
+ RelayDT
+
+
+ poles
+ 2
+
+
+ rotation
+
+
+
+
+
+
+ RelayDT
+
+
+ poles
+ 2
+
+
+
+
+
+ Ground
+
+
+
+
+ Ground
+
+
+
+
+ VDD
+
+
+
+
+ PullDown
+
+
+
+
+ PullDown
+
+
+ rotation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/test/resources/dig/test/switch/relayFullAdder2.dig b/src/test/resources/dig/test/switch/relayFullAdder2.dig
new file mode 100644
index 000000000..f6626dd78
--- /dev/null
+++ b/src/test/resources/dig/test/switch/relayFullAdder2.dig
@@ -0,0 +1,685 @@
+
+
+ 1
+
+
+
+ In
+
+
+ Label
+ A
+
+
+ Bits
+ 2
+
+
+
+
+
+ In
+
+
+ Label
+ B
+
+
+ Bits
+ 2
+
+
+
+
+
+ Testcase
+
+
+ Testdata
+
+ A B C_in S C_out
+loop (C,2)
+loop (A,4)
+loop (B,4)
+let s=A+B+C;
+ (A) (B) (C) (s&3) (s>>2)
+end loop
+end loop
+end loop
+
+
+
+
+
+
+
+ In
+
+
+ Label
+ C_in
+
+
+
+
+
+ RelayDT
+
+
+ poles
+ 2
+
+
+ rotation
+
+
+
+
+
+
+ RelayDT
+
+
+ poles
+ 2
+
+
+
+
+
+ Ground
+
+
+
+
+ Ground
+
+
+
+
+ VDD
+
+
+
+
+ RelayDT
+
+
+ poles
+ 2
+
+
+ rotation
+
+
+
+
+
+
+ RelayDT
+
+
+ poles
+ 2
+
+
+
+
+
+ Ground
+
+
+
+
+ Ground
+
+
+
+
+ VDD
+
+
+
+
+ RelayDT
+
+
+ poles
+ 2
+
+
+ rotation
+
+
+
+
+
+
+ RelayDT
+
+
+ poles
+ 2
+
+
+
+
+
+ Ground
+
+
+
+
+ Ground
+
+
+
+
+ VDD
+
+
+
+
+ Out
+
+
+ Label
+ C_out
+
+
+
+
+
+ RelayDT
+
+
+ poles
+ 2
+
+
+ rotation
+
+
+
+
+
+
+ RelayDT
+
+
+ poles
+ 2
+
+
+
+
+
+ Ground
+
+
+
+
+ Ground
+
+
+
+
+ VDD
+
+
+
+
+ PullDown
+
+
+
+
+ Splitter
+
+
+ Input Splitting
+ 2
+
+
+ Output Splitting
+ 1,1
+
+
+
+
+
+ Splitter
+
+
+ Input Splitting
+ 2
+
+
+ Output Splitting
+ 1,1
+
+
+
+
+
+ Splitter
+
+
+ Input Splitting
+ 1,1
+
+
+ Output Splitting
+ 2
+
+
+
+
+
+ Out
+
+
+ Label
+ S
+
+
+ Bits
+ 2
+
+
+
+
+
+ PullDown
+
+
+ Bits
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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