diff --git a/src/main/java/de/neemann/digital/core/switching/PlainSwitchDT.java b/src/main/java/de/neemann/digital/core/switching/PlainSwitchDT.java index 770cf0e6e..64833ff93 100644 --- a/src/main/java/de/neemann/digital/core/switching/PlainSwitchDT.java +++ b/src/main/java/de/neemann/digital/core/switching/PlainSwitchDT.java @@ -44,11 +44,11 @@ public final class PlainSwitchDT implements NodeInterface { if (inA != null && inB != null) { inB.addObserverToValue(this).checkBits(bits, null); - s1 = PlainSwitch.createSwitchModel(inA, inB, outputA, outputB, true, name+"-A-B"); + s1 = PlainSwitch.createSwitchModel(inA, inB, outputA, outputB, true, name + "-A-B"); } if (inA != null && inC != null) { inC.addObserverToValue(this).checkBits(bits, null); - s2 = PlainSwitch.createSwitchModel(inA, inC, outputA, outputC, true, name+"-A-C"); + s2 = PlainSwitch.createSwitchModel(inA, inC, outputA, outputC, true, name + "-A-C"); } } @@ -77,12 +77,10 @@ public final class PlainSwitchDT implements NodeInterface { public void setClosed(boolean isClosed) { if (this.closed != isClosed) { this.closed = isClosed; - if (closed) { - if (s1 != null) - s1.setClosed(closed); - if (s2 != null) - s2.setClosed(!closed); - } + if (s1 != null) + s1.setClosed(closed); + if (s2 != null) + s2.setClosed(!closed); hasChanged(); } } diff --git a/src/test/resources/dig/test/switch/highZ-DT2.dig b/src/test/resources/dig/test/switch/highZ-DT2.dig new file mode 100644 index 000000000..65f8205f0 --- /dev/null +++ b/src/test/resources/dig/test/switch/highZ-DT2.dig @@ -0,0 +1,90 @@ + + + 1 + + + + VDD + + + + + In + + + Label + A + + + + + + Ground + + + + + RelayDT + + + rotation + + + + relayNormallyClosed + true + + + + + + Out + + + Label + Y + + + + + + Testcase + + + Testdata + + A Y +0 1 +1 Z +0 1 +1 Z + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file