import java.util.function.Function;
import java.util.stream.Collectors;
-import net.mograsim.logic.core.components.Component;
import net.mograsim.logic.core.components.gates.AndGate;
import net.mograsim.logic.core.components.gates.NotGate;
import net.mograsim.logic.core.components.gates.OrGate;
}
@SuppressWarnings("unchecked")
- private static <G extends GUIComponent> Component createAndLinkComponent(Timeline timeline, LogicModelParameters params,
+ private static <G extends GUIComponent> void createAndLinkComponent(Timeline timeline, LogicModelParameters params,
GUIComponent guiComponent, Map<Pin, Wire> logicWiresPerPin, ComponentAdapter<G> adapter)
{
if (adapter == null)
throw new IllegalArgumentException("Unknown component class: " + guiComponent.getClass());
- return adapter.createAndLinkComponent(timeline, params, (G) guiComponent, logicWiresPerPin);
+ adapter.createAndLinkComponent(timeline, params, (G) guiComponent, logicWiresPerPin);
}
private ViewLogicModelAdapter()
import java.util.Map;
-import net.mograsim.logic.core.components.Component;
import net.mograsim.logic.core.components.gates.AndGate;
import net.mograsim.logic.core.components.gates.NotGate;
import net.mograsim.logic.core.timeline.Timeline;
}
@Override
- public Component createAndLinkComponent(Timeline timeline, LogicModelParameters params, AtomicAm2901NANDBased guiComponent,
+ public void createAndLinkComponent(Timeline timeline, LogicModelParameters params, AtomicAm2901NANDBased guiComponent,
Map<Pin, Wire> logicWiresPerPin)
{
Wire w00 = logicWiresPerPin.get(guiComponent.getPins().get(0));
Wire w37 = logicWiresPerPin.get(guiComponent.getPins().get(37));
createAm2901(timeline, params, w00, w01, w02, w03, w04, w05, w06, w07, w08, w09, w10, w11, w12, w13, w14, w15, w16, w17, w18, w19,
w20, w21, w22, w23, w24, w25, w26, w27, w28, w29, w30, w31, w32, w33, w34, w35, w36, w37);
- return null;
}
private static void create_rsLatch(Timeline timeline, LogicModelParameters params, Wire _S, Wire _R, Wire Q, Wire _Q)
import java.util.Map;
import net.mograsim.logic.core.components.BitDisplay;
-import net.mograsim.logic.core.components.Component;
import net.mograsim.logic.core.timeline.Timeline;
import net.mograsim.logic.core.wires.Wire;
import net.mograsim.logic.core.wires.Wire.ReadEnd;
}
@Override
- public Component createAndLinkComponent(Timeline timeline, LogicModelParameters params, GUIBitDisplay guiComponent,
+ public void createAndLinkComponent(Timeline timeline, LogicModelParameters params, GUIBitDisplay guiComponent,
Map<Pin, Wire> logicWiresPerPin)
{
ReadEnd end = logicWiresPerPin.get(guiComponent.getInputPin()).createReadOnlyEnd();
BitDisplay bitDisplay = new BitDisplay(timeline, end);
guiComponent.setLogicModelBinding(bitDisplay);
- return bitDisplay;
}
}
\ No newline at end of file
import java.util.Map;
-import net.mograsim.logic.core.components.Component;
import net.mograsim.logic.core.timeline.Timeline;
import net.mograsim.logic.core.wires.Wire;
import net.mograsim.logic.ui.model.components.GUIComponent;
{
public Class<G> getSupportedClass();
- public Component createAndLinkComponent(Timeline timeline, LogicModelParameters params, G guiComponent,
- Map<Pin, Wire> logicWiresPerPin);
+ public void createAndLinkComponent(Timeline timeline, LogicModelParameters params, G guiComponent, Map<Pin, Wire> logicWiresPerPin);
}
\ No newline at end of file
import java.util.Map;
-import net.mograsim.logic.core.components.Component;
import net.mograsim.logic.core.components.ManualSwitch;
import net.mograsim.logic.core.timeline.Timeline;
import net.mograsim.logic.core.wires.Wire;
}
@Override
- public Component createAndLinkComponent(Timeline timeline, LogicModelParameters params, GUIManualSwitch guiComponent,
+ public void createAndLinkComponent(Timeline timeline, LogicModelParameters params, GUIManualSwitch guiComponent,
Map<Pin, Wire> logicWiresPerPin)
{
ReadWriteEnd end = logicWiresPerPin.get(guiComponent.getOutputPin()).createReadWriteEnd();
ManualSwitch manualSwitch = new ManualSwitch(timeline, end);
guiComponent.setLogicModelBinding(manualSwitch, end);
- return manualSwitch;
}
}
\ No newline at end of file
}
@Override
- public Component createAndLinkComponent(Timeline timeline, LogicModelParameters params, G guiComponent, Map<Pin, Wire> logicWiresPerPin)
+ public void createAndLinkComponent(Timeline timeline, LogicModelParameters params, G guiComponent, Map<Pin, Wire> logicWiresPerPin)
{
ReadWriteEnd out = logicWiresPerPin.get(guiComponent.getOutputPin()).createReadWriteEnd();
List<Pin> inputPins = guiComponent.getInputPins();
ReadEnd[] ins = new ReadEnd[inputPins.size()];
for (int i = 0; i < inputPins.size(); i++)
ins[i] = logicWiresPerPin.get(inputPins.get(i)).createReadOnlyEnd();
- return constructor.newComponent(timeline, params.gateProcessTime, out, ins);
+ constructor.newComponent(timeline, params.gateProcessTime, out, ins);
}
public static interface ComponentConstructor