The final restructured version for automatic build using maven tycho
[Mograsim.git] / plugins / net.mograsim.logic.model / src / net / mograsim / logic / model / modeladapter / componentadapters / ManualSwitchAdapter.java
1 package net.mograsim.logic.model.modeladapter.componentadapters;
2
3 import java.util.Map;
4
5 import net.mograsim.logic.core.components.CoreManualSwitch;
6 import net.mograsim.logic.core.timeline.Timeline;
7 import net.mograsim.logic.core.wires.CoreWire;
8 import net.mograsim.logic.core.wires.CoreWire.ReadWriteEnd;
9 import net.mograsim.logic.model.model.components.atomic.ModelManualSwitch;
10 import net.mograsim.logic.model.model.wires.Pin;
11 import net.mograsim.logic.model.modeladapter.CoreModelParameters;
12
13 public class ManualSwitchAdapter implements ComponentAdapter<ModelManualSwitch>
14 {
15         @Override
16         public Class<ModelManualSwitch> getSupportedClass()
17         {
18                 return ModelManualSwitch.class;
19         }
20
21         @Override
22         public void createAndLinkComponent(Timeline timeline, CoreModelParameters params, ModelManualSwitch modelComponent,
23                         Map<Pin, CoreWire> logicWiresPerPin)
24         {
25                 ReadWriteEnd end = logicWiresPerPin.get(modelComponent.getOutputPin()).createReadWriteEnd();
26                 CoreManualSwitch manualSwitch = new CoreManualSwitch(timeline, end);
27                 modelComponent.setCoreModelBinding(manualSwitch);
28         }
29 }