mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-16 08:25:09 -04:00
most tests are working again
This commit is contained in:
parent
4b576d4285
commit
a083e82070
@ -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();
|
||||
}
|
||||
}
|
||||
|
90
src/test/resources/dig/test/switch/highZ-DT2.dig
Normal file
90
src/test/resources/dig/test/switch/highZ-DT2.dig
Normal file
@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<circuit>
|
||||
<version>1</version>
|
||||
<attributes/>
|
||||
<visualElements>
|
||||
<visualElement>
|
||||
<elementName>VDD</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="280" y="100"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>In</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>A</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="180" y="100"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Ground</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="220" y="180"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>RelayDT</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<rotation rotation="1"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>relayNormallyClosed</string>
|
||||
<boolean>true</boolean>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="260" y="160"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Out</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>Y</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="320" y="160"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Testcase</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Testdata</string>
|
||||
<testData>
|
||||
<dataString>A Y
|
||||
0 1
|
||||
1 Z
|
||||
0 1
|
||||
1 Z
|
||||
</dataString>
|
||||
</testData>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="200" y="200"/>
|
||||
</visualElement>
|
||||
</visualElements>
|
||||
<wires>
|
||||
<wire>
|
||||
<p1 x="260" y="160"/>
|
||||
<p2 x="320" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="180" y="100"/>
|
||||
<p2 x="220" y="100"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="280" y="100"/>
|
||||
<p2 x="280" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="220" y="160"/>
|
||||
<p2 x="220" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="220" y="100"/>
|
||||
<p2 x="220" y="120"/>
|
||||
</wire>
|
||||
</wires>
|
||||
</circuit>
|
Loading…
x
Reference in New Issue
Block a user