X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fserializing%2FSubmodelComponentParams.java;h=1cb5fcbc6e2260a6e4334e8cf54fe8b891f2b8e1;hb=8e8d5776ccc95a08885789834abd55cc50e18a24;hp=d47b2d98acd24119a3b7e3fb018ad16eb156486a;hpb=020445ceb5c54ee5ff384a7e6b529ee350575b12;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/serializing/SubmodelComponentParams.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/serializing/SubmodelComponentParams.java index d47b2d98..1cb5fcbc 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/serializing/SubmodelComponentParams.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/serializing/SubmodelComponentParams.java @@ -1,22 +1,22 @@ package net.mograsim.logic.model.serializing; -import java.io.IOException; - import com.google.gson.JsonElement; import net.haspamelodica.swt.helper.swtobjectwrappers.Point; import net.mograsim.logic.model.model.components.submodels.SubmodelComponent; -import net.mograsim.logic.model.util.JsonHandler; +import net.mograsim.logic.model.model.wires.PinUsage; +import net.mograsim.logic.model.util.Version; /** * This class contains all the information necessary to create a new {@link SubmodelComponent} */ -public class SubmodelComponentParams +public class SubmodelComponentParams extends SerializablePojo { // basic stuff public double width, height; public InterfacePinParams[] interfacePins; - public SubmodelParameters submodel; + public double innerScale; + public ViewModelParams submodel; // functionality that needs to be expressed in Java code public String symbolRendererSnippetID; @@ -28,60 +28,16 @@ public class SubmodelComponentParams public String highLevelStateHandlerSnippetID; public JsonElement highLevelStateHandlerParams; + public SubmodelComponentParams(Version version) + { + super(version); + } + public static class InterfacePinParams { public Point location; public String name; public int logicWidth; - } - - public static class SubmodelParameters - { - public double innerScale; - public InnerComponentParams[] subComps; - public InnerWireParams[] innerWires; - - public static class InnerComponentParams - { - public String id; - public String name; - public Point pos; - public JsonElement params; - } - - public static class InnerWireParams - { - public InnerPinParams pin1, pin2; - public String name; - public Point[] path; - - public static class InnerPinParams - { - public String compName; - public String pinName; - } - } - } - - public static SubmodelComponentParams readJson(String path) throws IOException - { - return JsonHandler.readJson(path, SubmodelComponentParams.class); - } - - /** - * Writes this {@link SubmodelComponentParams} object into a file in json format. The correct file extension is important! Check - * {@link SubmodelComponentParams}.fileExtension - */ - public void writeJson(String path) - { - try - { - JsonHandler.writeJson(this, path); - } - catch (IOException e) - { - System.err.println("Failed to write SubComponentParams to file"); - e.printStackTrace(); - } + public PinUsage usage; } } \ No newline at end of file