X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fserializing%2FLegacySubmodelComponentSerializer.java;h=b41fc523b018ca7b52a9fc0f41ebdf85e24f1787;hb=43f832fac0531473dc97af75edb7c5b1cb9f6ce4;hp=37b05a908c4d2c99107333ddbc7bda7750b86138;hpb=3a52b6bffe52db5dd5ca907b4b3dfd368a58e14f;p=Mograsim.git
diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/serializing/LegacySubmodelComponentSerializer.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/serializing/LegacySubmodelComponentSerializer.java
index 37b05a90..b41fc523 100644
--- a/net.mograsim.logic.model/src/net/mograsim/logic/model/serializing/LegacySubmodelComponentSerializer.java
+++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/serializing/LegacySubmodelComponentSerializer.java
@@ -140,8 +140,8 @@ public final class LegacySubmodelComponentSerializer
}
/**
- * {@link #serialize(SubmodelComponent, Function)} using a default {@link IdentifierGetter} (see IdentifierGetter
's
- * {@link IdentifierGetter#IdentifierGetter() default constructor})
+ * {@link #serialize(SubmodelComponent, Function)} using the default {@link IdentifyParams} (see IdentifyParams
's
+ * {@link IdentifyParams#IdentifyParams() default constructor})
*
* @author Daniel Kirschten
*/
@@ -173,8 +173,8 @@ public final class LegacySubmodelComponentSerializer
comp.setSize(params.width, params.height);
for (LegacyInterfacePinParams iPinParams : params.interfacePins)
// TRISTATE because we don't have a better choice
- comp.addSubmodelInterface(new MovablePin(comp, iPinParams.name, iPinParams.logicWidth, PinUsage.TRISTATE, iPinParams.location.x,
- iPinParams.location.y));
+ comp.addSubmodelInterface(new MovablePin(model, comp, iPinParams.name, iPinParams.logicWidth, PinUsage.TRISTATE,
+ iPinParams.location.x, iPinParams.location.y));
LegacySubmodelParameters submodelParams = params.submodel;
LogicModelModifiable submodelModifiable = comp.getSubmodelModifiable();
Map componentsByName = submodelModifiable.getComponentsByName();
@@ -232,17 +232,8 @@ public final class LegacySubmodelComponentSerializer
LegacyInnerComponentParams innerComponentParams = new LegacyInnerComponentParams();
componentParams[i1] = innerComponentParams;
innerComponentParams.pos = new Point(innerComponent.getPosX(), innerComponent.getPosY());
- DeserializedSubmodelComponent innerCompCasted;
- if (innerComponent instanceof DeserializedSubmodelComponent
- && (innerCompCasted = (DeserializedSubmodelComponent) innerComponent).idForSerializingOverride != null)
- {
- innerComponentParams.id = innerCompCasted.idForSerializingOverride;
- innerComponentParams.params = innerCompCasted.paramsForSerializingOverride;
- } else
- {
- innerComponentParams.id = innerComponent.getIDForSerializing(idParams);
- innerComponentParams.params = innerComponent.getParamsForSerializingJSON(idParams);
- }
+ innerComponentParams.id = innerComponent.getIDForSerializing(idParams);
+ innerComponentParams.params = innerComponent.getParamsForSerializingJSON(idParams);
innerComponentParams.name = innerComponent.name;
i1++;
}