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
b5b230a
..
626804f
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();
\r
}
\r
\r
notifyObservers();
\r
}
\r
\r
+ public void setToValueOf(Bit bit)
\r
+ {
\r
+ if (bit == Bit.ONE)
\r
+ switchOn();
\r
+ else if (bit == Bit.ZERO)
\r
+ switchOff();
\r
+ else
\r
+ throw new IllegalArgumentException("Cannot set ManualSwitch to the value of Bit " + bit);
\r
+ }
\r
+
\r
public boolean isOn()
\r
{
\r
return isOn;
\r
public boolean isOn()
\r
{
\r
return isOn;
\r