X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fserializing%2FSubmodelComponentSerializer.java;h=234361d9648369115b023c3308c759d84e69dc18;hb=64f90ff345bfea80fd61b50bab2752792df76c7b;hp=96119678ecf55a8daab932d376d1f39fd8d3416e;hpb=bbe38c55aaa999d025f534245f9207a88643f6e5;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/serializing/SubmodelComponentSerializer.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/serializing/SubmodelComponentSerializer.java index 96119678..234361d9 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/serializing/SubmodelComponentSerializer.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/serializing/SubmodelComponentSerializer.java @@ -24,9 +24,8 @@ import net.mograsim.logic.model.util.Version; */ public final class SubmodelComponentSerializer { - // TODO serialize pin usage // TODO set pin usages of existing components - public static final Version JSON_VERSION_CURRENT_SERIALIZING = Version.parseSemver("0.1.4"); + public static final Version JSON_VERSION_CURRENT_SERIALIZING = Version.parseSemver("0.1.5"); public static final Version JSON_VERSION_LATEST_SUPPORTED_DESERIALIZING = Version.parseSemver("0.1.5"); public static final Version JSON_VERSION_EARLIEST_WITH_USAGE_SERIALIZED = Version.parseSemver("0.1.4"); // convenience methods @@ -171,6 +170,7 @@ public final class SubmodelComponentSerializer comp.setSubmodelScale(params.innerScale); comp.setSize(params.width, params.height); for (InterfacePinParams iPinParams : params.interfacePins) + // TRISTATE because we don't have a better choice comp.addSubmodelInterface(new MovablePin(comp, iPinParams.name, iPinParams.logicWidth, hasUsageSerialized ? iPinParams.usage : PinUsage.TRISTATE, iPinParams.location.x, iPinParams.location.y)); ViewModelModifiable submodelModifiable = comp.getSubmodelModifiable(); @@ -212,6 +212,7 @@ public final class SubmodelComponentSerializer iPinParams.location = p.getRelPos(); iPinParams.name = p.name; iPinParams.logicWidth = p.logicWidth; + iPinParams.usage = p.usage; i++; } params.interfacePins = iPins;