inda19plusplus / logik

Logisim clone
MIT License
2 stars 5 forks source link

Wire and Gate representation #4

Closed NogginBops closed 4 years ago

NogginBops commented 4 years ago

This is an issue for discussing the structure for wires and gates.

Should wires and gates be represented in different ways?

How should wires be represented?

How should gates be represented?

Things to consider are:

weerox commented 4 years ago

It would probably be best to let the backend handle file operations (open and save) and the GUI will pass file paths to the backend.

NogginBops commented 4 years ago

What we have decided to do is have wires and gates be represented separately.

Wires are strait segments that ends in two connections (no connections in the middle). The backend will not be concerned with where wires are connected, but will instead know about the subnets that compose the scene.

We've also decided that the GUI and backend will have to be synced when it comes to gate/component implementations. Meaning that the drawing code for a particular gate will be coded into the GUI while the simulation code will be coded in the backend and the two will communicate about these gates using some kind of id (enum).

Because the gui contains visual information that is important to save to save files we will do the saving on the gui side.

NogginBops commented 4 years ago

Closing this discussion as we have a representation that is working at the moment. We can open a new issue if we want to change anything.