projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Completely changed the structure and switched to Eclipse Plugin.
[Mograsim.git]
/
net.mograsim.logic.core
/
src
/
net
/
mograsim
/
logic
/
core
/
components
/
ManualSwitch.java
diff --git
a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/ManualSwitch.java
b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/ManualSwitch.java
index
e3ae372
..
83842dd
100644
(file)
--- a/
net.mograsim.logic.core/src/net/mograsim/logic/core/components/ManualSwitch.java
+++ b/
net.mograsim.logic.core/src/net/mograsim/logic/core/components/ManualSwitch.java
@@
-56,6
+56,16
@@
public class ManualSwitch extends Component implements LogicObservable
notifyObservers();
}
notifyObservers();
}
+ public void setToValueOf(Bit bit)
+ {
+ if (bit == Bit.ONE)
+ switchOn();
+ else if (bit == Bit.ZERO)
+ switchOff();
+ else
+ throw new IllegalArgumentException("Cannot set ManualSwitch to the value of Bit " + bit);
+ }
+
public boolean isOn()
{
return isOn;
public boolean isOn()
{
return isOn;