X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model.am2900%2Ftest%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fam2900%2FTestableAm2901Impl.java;h=2b27ae6b83a20356febc72611535e837547346a2;hb=b85bdb8de9e5a762a878dff3123a04d2458a1578;hp=98a6d109ef3fb18b466a7ced54894a99b8a4851d;hpb=a1fd9f900021ba654a565394708552a3ad911142;p=Mograsim.git diff --git a/net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/TestableAm2901Impl.java b/net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/TestableAm2901Impl.java index 98a6d109..2b27ae6b 100644 --- a/net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/TestableAm2901Impl.java +++ b/net.mograsim.logic.model.am2900/test/net/mograsim/logic/model/am2900/TestableAm2901Impl.java @@ -24,12 +24,12 @@ import net.mograsim.logic.model.model.ViewModelModifiable; import net.mograsim.logic.model.model.components.GUIComponent; import net.mograsim.logic.model.model.components.atomic.GUIBitDisplay; import net.mograsim.logic.model.model.components.atomic.GUIManualSwitch; -import net.mograsim.logic.model.model.components.mi.nandbased.am2901.GUIAm2901; import net.mograsim.logic.model.model.components.submodels.SubmodelComponent; import net.mograsim.logic.model.model.wires.GUIWire; import net.mograsim.logic.model.model.wires.Pin; import net.mograsim.logic.model.modeladapter.LogicModelParameters; import net.mograsim.logic.model.modeladapter.ViewLogicModelAdapter; +import net.mograsim.logic.model.serializing.IndirectGUIComponentCreator; public class TestableAm2901Impl implements TestableAm2901 { @@ -103,11 +103,9 @@ public class TestableAm2901Impl implements TestableAm2901 { // Create view model ViewModelModifiable viewModel = new ViewModelModifiable(); - // TODO replace with deserialized version as soon as high level states work for deserialized components - am2901 = new GUIAm2901(viewModel); -// am2901 = IndirectGUIComponentCreator.createComponent(viewModel, "GUIAm2901"); + am2901 = IndirectGUIComponentCreator.createComponent(viewModel, "GUIAm2901"); // guess which pins are outputs and which are inputs - // TODO this code exists three times... but it seems too "hacky" to put it in a helper class + // TODO this code exists four times... but it seems too "hacky" to put it in a helper class List inputPinNames = new ArrayList<>(); List outputPinNames = new ArrayList<>(); for (Pin p : am2901.getPins().values()) @@ -155,7 +153,7 @@ public class TestableAm2901Impl implements TestableAm2901 if (comp instanceof SubmodelComponent) modelsToIterate.offer(((SubmodelComponent) comp).submodel); } - wiresIncludingSubmodels.forEach(w -> w.addRedrawListener(() -> + viewModel.setRedrawHandler(() -> wiresIncludingSubmodels.forEach(w -> { if (debugWires) {