X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model.am2900%2Ftest%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fam2900%2FSwitchWithDisplay.java;fp=net.mograsim.logic.model.am2900%2Ftest%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fam2900%2FSwitchWithDisplay.java;h=0000000000000000000000000000000000000000;hb=6d28e5c93c9347784950ca66fb6d1b3a14461ece;hp=c5c3ab790d6abd8a0f267fb13fad909e8b16c055;hpb=9b34381259d5e6cb46bd3834712311cd60317506;p=Mograsim.git diff --git a/net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/SwitchWithDisplay.java b/net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/SwitchWithDisplay.java deleted file mode 100644 index c5c3ab79..00000000 --- a/net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/SwitchWithDisplay.java +++ /dev/null @@ -1,65 +0,0 @@ -package net.mograsim.logic.model.am2900; - -import net.mograsim.logic.core.components.BitDisplay; -import net.mograsim.logic.core.components.ManualSwitch; -import net.mograsim.logic.core.types.BitVector; -import net.mograsim.logic.model.model.ViewModelModifiable; -import net.mograsim.logic.model.model.components.atomic.GUIBitDisplay; -import net.mograsim.logic.model.model.components.atomic.GUIManualSwitch; -import net.mograsim.logic.model.model.wires.Pin; -import net.mograsim.logic.model.model.wires.WireCrossPoint; -import net.mograsim.logic.model.util.ModellingTool; - -public class SwitchWithDisplay -{ - private final Pin pin; - private final GUIBitDisplay guiBitDisplay; - private final GUIManualSwitch guiManualSwitch; - - public SwitchWithDisplay(ViewModelModifiable model, Pin target) - { - pin = target; - guiBitDisplay = new GUIBitDisplay(model, pin.logicWidth); - guiManualSwitch = new GUIManualSwitch(model, pin.logicWidth); - - ModellingTool tool = ModellingTool.createFor(model); - WireCrossPoint crossPoint = new WireCrossPoint(model, pin.logicWidth); - tool.connect(guiBitDisplay.getInputPin(), crossPoint); - tool.connect(guiManualSwitch.getOutputPin(), crossPoint); - } - - public final BitVector getDisplayedValue() - { - return guiBitDisplay.getBitDisplay().getDisplayedValue(); - } - - public final void setState(BitVector bits) - { - guiManualSwitch.getManualSwitch().setState(bits); - } - - public final Pin getPin() - { - return pin; - } - - public final BitDisplay getBitDisplay() - { - return guiBitDisplay.getBitDisplay(); - } - - public final ManualSwitch getManualSwitch() - { - return guiManualSwitch.getManualSwitch(); - } - - final GUIBitDisplay getGuiBitDisplay() - { - return guiBitDisplay; - } - - final GUIManualSwitch getGuiManualSwitch() - { - return guiManualSwitch; - } -}