added default value to RS and T-flop-flop

This commit is contained in:
hneemann 2017-05-31 20:18:01 +02:00
parent cf31464026
commit 9391455d2c
2 changed files with 12 additions and 0 deletions

View File

@ -23,6 +23,7 @@ public class FlipflopRS extends Node implements Element {
= new ElementTypeDescription("RS_FF", FlipflopRS.class, input("S"), input("C"), input("R"))
.addAttribute(Keys.ROTATE)
.addAttribute(Keys.LABEL)
.addAttribute(Keys.DEFAULT)
.addAttribute(Keys.INVERTERCONFIG)
.addAttribute(Keys.VALUE_IS_PROBE);
@ -48,6 +49,11 @@ public class FlipflopRS extends Node implements Element {
this.qn = new ObservableValue("\u00ACQ", 1).setPinDescription(DESCRIPTION);
isProbe = attributes.get(Keys.VALUE_IS_PROBE);
label = attributes.getCleanLabel();
int def = attributes.get(Keys.DEFAULT);
out = def > 0;
q.setBool(out);
qn.setBool(!out);
}
@Override

View File

@ -23,6 +23,7 @@ public class FlipflopT extends Node implements Element {
= new ElementTypeDescription("T_FF", FlipflopT.class, input("C"))
.addAttribute(Keys.ROTATE)
.addAttribute(Keys.LABEL)
.addAttribute(Keys.DEFAULT)
.addAttribute(Keys.INVERTERCONFIG)
.addAttribute(Keys.VALUE_IS_PROBE);
@ -46,6 +47,11 @@ public class FlipflopT extends Node implements Element {
this.qn = new ObservableValue("\u00ACQ", 1).setPinDescription(DESCRIPTION);
isProbe = attributes.get(Keys.VALUE_IS_PROBE);
label = attributes.getCleanLabel();
int def = attributes.get(Keys.DEFAULT);
out = def > 0;
q.setBool(out);
qn.setBool(!out);
}
@Override