Completely changed the structure and switched to Eclipse Plugin.
[Mograsim.git] / net.mograsim.logic.core / src / net / mograsim / logic / core / components / ManualSwitch.java
index b5b230a..626804f 100644 (file)
@@ -56,6 +56,16 @@ public class ManualSwitch extends Component implements LogicObservable
                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