mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-14 07:17:13 -04:00
added measurement dialog
This commit is contained in:
parent
4606fe443e
commit
a71bcffc66
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<circuit>
|
||||
<version>1</version>
|
||||
<attributes>
|
||||
<entry>
|
||||
<string>Width</string>
|
||||
@ -10,6 +11,10 @@
|
||||
<visualElement>
|
||||
<elementName>Register</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>valueIsProbe</string>
|
||||
<boolean>true</boolean>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>PC</string>
|
||||
@ -19,7 +24,7 @@
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="130" y="70"/>
|
||||
<pos x="260" y="140"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
@ -34,7 +39,7 @@
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="80" y="170"/>
|
||||
<pos x="160" y="340"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
@ -49,7 +54,7 @@
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="210" y="80"/>
|
||||
<pos x="420" y="160"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
@ -60,7 +65,7 @@
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="200" y="90"/>
|
||||
<pos x="400" y="180"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
@ -71,7 +76,7 @@
|
||||
<int>0</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="200" y="100"/>
|
||||
<pos x="400" y="200"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
@ -86,7 +91,7 @@
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="320" y="80"/>
|
||||
<pos x="640" y="160"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
@ -94,9 +99,7 @@
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<de.neemann.digital.core.element.Rotation>
|
||||
<rotation>3</rotation>
|
||||
</de.neemann.digital.core.element.Rotation>
|
||||
<rotation rotation="3"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
@ -107,7 +110,7 @@
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="170" y="210"/>
|
||||
<pos x="340" y="420"/>
|
||||
<rotate>3</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
@ -122,7 +125,7 @@
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="290" y="160"/>
|
||||
<pos x="580" y="320"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
@ -133,7 +136,7 @@
|
||||
<string>C</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="80" y="80"/>
|
||||
<pos x="160" y="160"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
@ -144,7 +147,7 @@
|
||||
<int>0</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="280" y="180"/>
|
||||
<pos x="560" y="360"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
@ -155,7 +158,7 @@
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="340" y="140"/>
|
||||
<pos x="680" y="280"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
@ -166,7 +169,7 @@
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="380" y="150"/>
|
||||
<pos x="760" y="300"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
@ -174,16 +177,14 @@
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<de.neemann.digital.core.element.Rotation>
|
||||
<rotation>1</rotation>
|
||||
</de.neemann.digital.core.element.Rotation>
|
||||
<rotation rotation="1"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>abs</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="390" y="210"/>
|
||||
<pos x="780" y="420"/>
|
||||
<rotate>1</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
@ -191,22 +192,20 @@
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<de.neemann.digital.core.element.Rotation>
|
||||
<rotation>1</rotation>
|
||||
</de.neemann.digital.core.element.Rotation>
|
||||
<rotation rotation="1"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>rel</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="350" y="210"/>
|
||||
<pos x="700" y="420"/>
|
||||
<rotate>1</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Not</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="90" y="80"/>
|
||||
<pos x="180" y="160"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
@ -217,138 +216,138 @@
|
||||
<string>Reset</string>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="110" y="110"/>
|
||||
<pos x="220" y="220"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
</visualElements>
|
||||
<wires>
|
||||
<wire>
|
||||
<p1 x="80" y="80"/>
|
||||
<p2 x="90" y="80"/>
|
||||
<p1 x="160" y="160"/>
|
||||
<p2 x="180" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="110" y="80"/>
|
||||
<p2 x="130" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="160" y="80"/>
|
||||
<p2 x="170" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="240" y="80"/>
|
||||
<p2 x="270" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="270" y="80"/>
|
||||
<p2 x="320" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="170" y="80"/>
|
||||
<p2 x="210" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="270" y="160"/>
|
||||
<p2 x="290" y="160"/>
|
||||
<p1 x="220" y="160"/>
|
||||
<p2 x="260" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="320" y="160"/>
|
||||
<p2 x="340" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="160"/>
|
||||
<p2 x="410" y="160"/>
|
||||
<p1 x="480" y="160"/>
|
||||
<p2 x="540" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="200" y="100"/>
|
||||
<p2 x="210" y="100"/>
|
||||
<p1 x="540" y="160"/>
|
||||
<p2 x="640" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="280" y="180"/>
|
||||
<p2 x="290" y="180"/>
|
||||
<p1 x="340" y="160"/>
|
||||
<p2 x="420" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="360" y="150"/>
|
||||
<p2 x="380" y="150"/>
|
||||
<p1 x="540" y="320"/>
|
||||
<p2 x="580" y="320"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="120" y="70"/>
|
||||
<p2 x="130" y="70"/>
|
||||
<p1 x="640" y="320"/>
|
||||
<p2 x="680" y="320"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="120" y="40"/>
|
||||
<p2 x="410" y="40"/>
|
||||
<p1 x="800" y="320"/>
|
||||
<p2 x="820" y="320"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="240" y="200"/>
|
||||
<p2 x="370" y="200"/>
|
||||
<p1 x="240" y="80"/>
|
||||
<p2 x="820" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="200" y="90"/>
|
||||
<p2 x="210" y="90"/>
|
||||
<p1 x="480" y="400"/>
|
||||
<p2 x="740" y="400"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="120" y="90"/>
|
||||
<p2 x="130" y="90"/>
|
||||
<p1 x="400" y="180"/>
|
||||
<p2 x="420" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="80" y="170"/>
|
||||
<p2 x="240" y="170"/>
|
||||
<p1 x="240" y="180"/>
|
||||
<p2 x="260" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="370" y="170"/>
|
||||
<p2 x="380" y="170"/>
|
||||
<p1 x="160" y="340"/>
|
||||
<p2 x="480" y="340"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="240" y="170"/>
|
||||
<p2 x="290" y="170"/>
|
||||
<p1 x="740" y="340"/>
|
||||
<p2 x="760" y="340"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="270" y="140"/>
|
||||
<p2 x="340" y="140"/>
|
||||
<p1 x="480" y="340"/>
|
||||
<p2 x="580" y="340"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="110" y="110"/>
|
||||
<p2 x="120" y="110"/>
|
||||
<p1 x="400" y="200"/>
|
||||
<p2 x="420" y="200"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="240" y="170"/>
|
||||
<p2 x="240" y="200"/>
|
||||
<p1 x="560" y="360"/>
|
||||
<p2 x="580" y="360"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="370" y="170"/>
|
||||
<p2 x="370" y="200"/>
|
||||
<p1 x="540" y="280"/>
|
||||
<p2 x="680" y="280"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="390" y="170"/>
|
||||
<p2 x="390" y="210"/>
|
||||
<p1 x="720" y="300"/>
|
||||
<p2 x="760" y="300"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="120" y="40"/>
|
||||
<p2 x="120" y="70"/>
|
||||
<p1 x="240" y="140"/>
|
||||
<p2 x="260" y="140"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="120" y="90"/>
|
||||
<p2 x="120" y="110"/>
|
||||
<p1 x="220" y="220"/>
|
||||
<p2 x="240" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="170" y="80"/>
|
||||
<p2 x="170" y="210"/>
|
||||
<p1 x="480" y="340"/>
|
||||
<p2 x="480" y="400"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="410" y="40"/>
|
||||
<p2 x="410" y="160"/>
|
||||
<p1 x="240" y="80"/>
|
||||
<p2 x="240" y="140"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="350" y="160"/>
|
||||
<p2 x="350" y="210"/>
|
||||
<p1 x="240" y="180"/>
|
||||
<p2 x="240" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="270" y="80"/>
|
||||
<p2 x="270" y="140"/>
|
||||
<p1 x="740" y="340"/>
|
||||
<p2 x="740" y="400"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="270" y="140"/>
|
||||
<p2 x="270" y="160"/>
|
||||
<p1 x="340" y="160"/>
|
||||
<p2 x="340" y="420"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="820" y="80"/>
|
||||
<p2 x="820" y="320"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="780" y="340"/>
|
||||
<p2 x="780" y="420"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="700" y="320"/>
|
||||
<p2 x="700" y="420"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="540" y="160"/>
|
||||
<p2 x="540" y="280"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="540" y="280"/>
|
||||
<p2 x="540" y="320"/>
|
||||
</wire>
|
||||
</wires>
|
||||
</circuit>
|
@ -238,42 +238,12 @@
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Frequency</string>
|
||||
<int>1000</int>
|
||||
<int>200</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="1040" y="460"/>
|
||||
<rotate>2</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Probe</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>R0</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="640" y="60"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Probe</elementName>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>Label</string>
|
||||
<string>R1</string>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Bits</string>
|
||||
<int>16</int>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="740" y="60"/>
|
||||
<rotate>0</rotate>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>GPO.dig</elementName>
|
||||
<elementAttributes/>
|
||||
@ -444,14 +414,6 @@
|
||||
<p1 x="1440" y="500"/>
|
||||
<p2 x="1500" y="580"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="620" y="80"/>
|
||||
<p2 x="640" y="60"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="720" y="80"/>
|
||||
<p2 x="740" y="60"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="620" y="640"/>
|
||||
<p2 x="920" y="640"/>
|
||||
@ -546,7 +508,7 @@
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="560" y="140"/>
|
||||
<p2 x="720" y="140"/>
|
||||
<p2 x="680" y="140"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1100" y="140"/>
|
||||
@ -641,7 +603,7 @@
|
||||
<p2 x="1120" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="760" y="160"/>
|
||||
<p1 x="680" y="160"/>
|
||||
<p2 x="840" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
@ -664,10 +626,6 @@
|
||||
<p1 x="160" y="160"/>
|
||||
<p2 x="200" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="560" y="160"/>
|
||||
<p2 x="740" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="840" y="160"/>
|
||||
<p2 x="860" y="160"/>
|
||||
@ -768,10 +726,6 @@
|
||||
<p1 x="620" y="560"/>
|
||||
<p2 x="680" y="560"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="560" y="180"/>
|
||||
<p2 x="760" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="960" y="180"/>
|
||||
<p2 x="1000" y="180"/>
|
||||
@ -797,7 +751,7 @@
|
||||
<p2 x="200" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="760" y="180"/>
|
||||
<p1 x="680" y="180"/>
|
||||
<p2 x="780" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
@ -809,7 +763,7 @@
|
||||
<p2 x="140" y="440"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="740" y="120"/>
|
||||
<p1 x="560" y="120"/>
|
||||
<p2 x="860" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
@ -824,10 +778,6 @@
|
||||
<p1 x="180" y="120"/>
|
||||
<p2 x="200" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="560" y="120"/>
|
||||
<p2 x="620" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="440" y="120"/>
|
||||
<p2 x="460" y="120"/>
|
||||
@ -908,10 +858,6 @@
|
||||
<p1 x="400" y="320"/>
|
||||
<p2 x="400" y="420"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="720" y="80"/>
|
||||
<p2 x="720" y="140"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="660" y="480"/>
|
||||
<p2 x="660" y="540"/>
|
||||
@ -964,10 +910,6 @@
|
||||
<p1 x="420" y="200"/>
|
||||
<p2 x="420" y="480"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="740" y="120"/>
|
||||
<p2 x="740" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="740" y="400"/>
|
||||
<p2 x="740" y="580"/>
|
||||
@ -976,6 +918,14 @@
|
||||
<p1 x="680" y="460"/>
|
||||
<p2 x="680" y="560"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="680" y="140"/>
|
||||
<p2 x="680" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="680" y="160"/>
|
||||
<p2 x="680" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1320" y="260"/>
|
||||
<p2 x="1320" y="620"/>
|
||||
@ -1004,10 +954,6 @@
|
||||
<p1 x="1260" y="300"/>
|
||||
<p2 x="1260" y="420"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="620" y="80"/>
|
||||
<p2 x="620" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1200" y="200"/>
|
||||
<p2 x="1200" y="380"/>
|
||||
@ -1040,10 +986,6 @@
|
||||
<p1 x="1400" y="20"/>
|
||||
<p2 x="1400" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="760" y="160"/>
|
||||
<p2 x="760" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="1020" y="420"/>
|
||||
<p2 x="1020" y="460"/>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -239,7 +239,7 @@ public class Model {
|
||||
return signals;
|
||||
}
|
||||
|
||||
public static class Signal {
|
||||
public static class Signal implements Comparable<Signal> {
|
||||
|
||||
private final String name;
|
||||
private final ObservableValue value;
|
||||
@ -248,6 +248,19 @@ public class Model {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public ObservableValue getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Signal o) {
|
||||
return name.compareTo(o.name);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ public class AttributeKey<VALUE> {
|
||||
public static final AttributeKey<Integer> TermWidth = new AttributeKey<>("termWidth", Lang.get("key_termWidth"), 50);
|
||||
public static final AttributeKey<Integer> TermHeight = new AttributeKey<>("termHeight", Lang.get("key_termHeight"), 25);
|
||||
public static final AttributeKey<Integer> Cycles = new AttributeKey<>("Cycles", Lang.get("key_cycles"), 100000);
|
||||
public static final AttributeKey<Boolean> ValueIsProbe = new AttributeKey<>("valueIsProbe", Lang.get("key_valueIsProbe"), false);
|
||||
|
||||
|
||||
private final String key;
|
||||
|
@ -26,10 +26,6 @@ public class Probe implements Element {
|
||||
label = attributes.get(AttributeKey.Label);
|
||||
}
|
||||
|
||||
public Probe(int bits) {
|
||||
label = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInputs(ObservableValue... inputs) throws NodeException {
|
||||
value = inputs[0];
|
||||
|
@ -1,9 +1,6 @@
|
||||
package de.neemann.digital.core.memory;
|
||||
|
||||
import de.neemann.digital.core.BitsException;
|
||||
import de.neemann.digital.core.Node;
|
||||
import de.neemann.digital.core.NodeException;
|
||||
import de.neemann.digital.core.ObservableValue;
|
||||
import de.neemann.digital.core.*;
|
||||
import de.neemann.digital.core.element.AttributeKey;
|
||||
import de.neemann.digital.core.element.Element;
|
||||
import de.neemann.digital.core.element.ElementAttributes;
|
||||
@ -19,9 +16,12 @@ public class Register extends Node implements Element {
|
||||
.addAttribute(AttributeKey.Rotate)
|
||||
.addAttribute(AttributeKey.Bits)
|
||||
.addAttribute(AttributeKey.Label)
|
||||
.addAttribute(AttributeKey.ValueIsProbe)
|
||||
.setShortName("Reg");
|
||||
|
||||
private final int bits;
|
||||
private final boolean isProbe;
|
||||
private final String label;
|
||||
private ObservableValue dVal;
|
||||
private ObservableValue clockVal;
|
||||
private ObservableValue enableVal;
|
||||
@ -32,6 +32,8 @@ public class Register extends Node implements Element {
|
||||
public Register(ElementAttributes attributes) {
|
||||
bits = attributes.getBits();
|
||||
this.q = new ObservableValue("Q", bits);
|
||||
isProbe = attributes.get(AttributeKey.ValueIsProbe);
|
||||
label = attributes.get(AttributeKey.Label);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -60,4 +62,10 @@ public class Register extends Node implements Element {
|
||||
return new ObservableValue[]{q};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerNodes(Model model) {
|
||||
super.registerNodes(model);
|
||||
if (isProbe)
|
||||
model.addSignal(label, q);
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import de.neemann.digital.draw.model.RealTimeClock;
|
||||
import de.neemann.digital.draw.shapes.ShapeFactory;
|
||||
import de.neemann.digital.gui.components.CircuitComponent;
|
||||
import de.neemann.digital.gui.components.ElementOrderer;
|
||||
import de.neemann.digital.gui.components.ProbeDialog;
|
||||
import de.neemann.digital.gui.state.State;
|
||||
import de.neemann.digital.gui.state.StateManager;
|
||||
import de.neemann.digital.lang.Lang;
|
||||
@ -53,6 +54,8 @@ public class Main extends JFrame implements ClosingWindowListener.ConfirmSave {
|
||||
private final ToolTipAction runToBreak;
|
||||
private final ElementLibrary library;
|
||||
private final JCheckBoxMenuItem runClock;
|
||||
private final JCheckBoxMenuItem showProbes;
|
||||
private final JCheckBoxMenuItem traceEnable;
|
||||
private final LibrarySelector librarySelector;
|
||||
private final ShapeFactory shapeFactory;
|
||||
private final SavedListener savedListener;
|
||||
@ -280,16 +283,19 @@ public class Main extends JFrame implements ClosingWindowListener.ConfirmSave {
|
||||
}
|
||||
}.setToolTip(Lang.get("menu_speedTest_tt"));
|
||||
|
||||
JCheckBoxMenuItem traceEnable = new JCheckBoxMenuItem(Lang.get("menu_trace"));
|
||||
runClock = new JCheckBoxMenuItem(Lang.get("menu_runClock"), true);
|
||||
showProbes = new JCheckBoxMenuItem(Lang.get("menu_probe"));
|
||||
showProbes.setToolTipText(Lang.get("menu_probe_tt"));
|
||||
traceEnable = new JCheckBoxMenuItem(Lang.get("menu_trace"));
|
||||
runClock = new JCheckBoxMenuItem(Lang.get("menu_runClock"));
|
||||
runClock.setToolTipText(Lang.get("menu_runClock_tt"));
|
||||
|
||||
run.add(runModelAction.createJMenuItem());
|
||||
run.add(runModelMicroAction.createJMenuItem());
|
||||
run.add(doStep.createJMenuItem());
|
||||
run.add(runToBreak.createJMenuItem());
|
||||
run.add(speedTest.createJMenuItem());
|
||||
run.add(traceEnable);
|
||||
//run.add(speedTest.createJMenuItem());
|
||||
run.add(showProbes);
|
||||
//run.add(traceEnable);
|
||||
run.add(runClock);
|
||||
doStep.setEnabled(false);
|
||||
|
||||
@ -390,6 +396,11 @@ public class Main extends JFrame implements ClosingWindowListener.ConfirmSave {
|
||||
|
||||
runToBreak.setEnabled(!runClock && model.isFastRunModel());
|
||||
|
||||
|
||||
if (showProbes.isSelected())
|
||||
new ProbeDialog(this, model, updateEvent).setVisible(true);
|
||||
|
||||
|
||||
model.init();
|
||||
|
||||
} catch (NodeException e) {
|
||||
|
@ -402,13 +402,15 @@ public class CircuitComponent extends JComponent {
|
||||
corner1 = getPosVector(e);
|
||||
wasRealyDragged = false;
|
||||
} else {
|
||||
if (e.getButton() == MouseEvent.BUTTON1) {
|
||||
elements = circuit.getElementsToMove(Vector.min(corner1, corner2), Vector.max(corner1, corner2));
|
||||
state = State.MOVE;
|
||||
} else {
|
||||
elements = circuit.getElementsToCopy(Vector.min(corner1, corner2), Vector.max(corner1, corner2), shapeFactory);
|
||||
copyStartPosition = raster(getPosVector(e));
|
||||
state = State.COPY;
|
||||
if (corner2 != null) {
|
||||
if (e.getButton() == MouseEvent.BUTTON1) {
|
||||
elements = circuit.getElementsToMove(Vector.min(corner1, corner2), Vector.max(corner1, corner2));
|
||||
state = State.MOVE;
|
||||
} else {
|
||||
elements = circuit.getElementsToCopy(Vector.min(corner1, corner2), Vector.max(corner1, corner2), shapeFactory);
|
||||
copyStartPosition = raster(getPosVector(e));
|
||||
state = State.COPY;
|
||||
}
|
||||
}
|
||||
lastPos = getPosVector(e);
|
||||
}
|
||||
|
123
src/main/java/de/neemann/digital/gui/components/ProbeDialog.java
Normal file
123
src/main/java/de/neemann/digital/gui/components/ProbeDialog.java
Normal file
@ -0,0 +1,123 @@
|
||||
package de.neemann.digital.gui.components;
|
||||
|
||||
import de.neemann.digital.core.Model;
|
||||
import de.neemann.digital.core.ModelEvent;
|
||||
import de.neemann.digital.core.ModelStateObserver;
|
||||
import de.neemann.digital.lang.Lang;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.TableModelEvent;
|
||||
import javax.swing.event.TableModelListener;
|
||||
import javax.swing.table.TableModel;
|
||||
import java.awt.*;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* @author hneemann
|
||||
*/
|
||||
public class ProbeDialog extends JDialog implements ModelStateObserver {
|
||||
|
||||
private final ModelEvent.Event type;
|
||||
private final SignalTableModel tableModel;
|
||||
|
||||
public ProbeDialog(Frame owner, Model model, ModelEvent.Event type) {
|
||||
super(owner, Lang.get("win_measures"), false);
|
||||
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
|
||||
this.type = type;
|
||||
|
||||
ArrayList<Model.Signal> signals = model.getSignals();
|
||||
Collections.sort(signals);
|
||||
tableModel = new SignalTableModel(signals);
|
||||
JTable list = new JTable(tableModel);
|
||||
getContentPane().add(new JScrollPane(list), BorderLayout.CENTER);
|
||||
setAlwaysOnTop(true);
|
||||
|
||||
addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowOpened(WindowEvent e) {
|
||||
model.addObserver(ProbeDialog.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowClosed(WindowEvent e) {
|
||||
model.removeObserver(ProbeDialog.this);
|
||||
}
|
||||
});
|
||||
|
||||
setPreferredSize(new Dimension(150, getPreferredSize().height));
|
||||
|
||||
pack();
|
||||
setLocationRelativeTo(owner);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleEvent(ModelEvent event) {
|
||||
if (event.getType() == type) {
|
||||
tableModel.fireChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private class SignalTableModel implements TableModel {
|
||||
private final ArrayList<Model.Signal> signals;
|
||||
private ArrayList<TableModelListener> listeners = new ArrayList<>();
|
||||
|
||||
public SignalTableModel(ArrayList<Model.Signal> signals) {
|
||||
this.signals = signals;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRowCount() {
|
||||
return signals.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColumnCount() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColumnName(int columnIndex) {
|
||||
if (columnIndex == 0) return Lang.get("key_label");
|
||||
else return Lang.get("key_value");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getColumnClass(int columnIndex) {
|
||||
return String.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCellEditable(int rowIndex, int columnIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValueAt(int rowIndex, int columnIndex) {
|
||||
if (columnIndex == 0) return signals.get(rowIndex).getName();
|
||||
else return signals.get(rowIndex).getValue().getValueString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTableModelListener(TableModelListener l) {
|
||||
listeners.add(l);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeTableModelListener(TableModelListener l) {
|
||||
listeners.remove(l);
|
||||
}
|
||||
|
||||
public void fireChanged() {
|
||||
TableModelEvent e = new TableModelEvent(this, 0, signals.size() - 1);
|
||||
for (TableModelListener l : listeners)
|
||||
l.tableChanged(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -31,6 +31,8 @@ key_width=Breite
|
||||
key_cycles=Timeout Zyklen
|
||||
key_termWidth=Zeichen pro Zeile
|
||||
key_termHeight=Zeilen
|
||||
key_valueIsProbe=Als Messwert anzeigen
|
||||
|
||||
|
||||
rot_0=0\u00B0
|
||||
rot_90=90\u00B0
|
||||
@ -137,8 +139,11 @@ menu_exportSVG=Export SVG
|
||||
menu_exportSVGLaTex=Export SVG+LaTeX
|
||||
menu_delete=L\u00F6schen
|
||||
menu_delete_tt=L\u00F6scht ausgew\u00E4hlte Elemente
|
||||
menu_probe=Zeige Messwerte
|
||||
menu_probe_tt=Zeigt die Messwerte in einem eigenen Fenster
|
||||
|
||||
menu_about=\u00DCber Digital
|
||||
win_saveChanges=\u00C4nderungen speichern?
|
||||
win_confirmExit=Beenden best\u00E4tigen!
|
||||
win_stateChanged=Die Datei wurde ver\u00E4ndert!
|
||||
win_measures=Messwerte
|
@ -31,6 +31,7 @@ key_width=Width
|
||||
key_cycles=Timeout cycles
|
||||
key_termWidth=Characters per line
|
||||
key_termHeight=Lines
|
||||
key_valueIsProbe=Is measurment value
|
||||
|
||||
rot_0=0\u00B0
|
||||
rot_90=90\u00B0
|
||||
@ -138,7 +139,10 @@ menu_exportSVG=Export SVG
|
||||
menu_exportSVGLaTex=Export SVG+LaTeX
|
||||
menu_delete=Delete elements
|
||||
menu_delete_tt=Delete selected single element or group of elements
|
||||
menu_probe=Show Probe Values
|
||||
menu_probe_tt=Shows values of probes in separate window
|
||||
|
||||
win_saveChanges=Save Changes?
|
||||
win_confirmExit=Confirm Exit!
|
||||
win_stateChanged=State Changed!
|
||||
win_measures=Measurments
|
Loading…
x
Reference in New Issue
Block a user