Vlsir / Hdl21Schematics

Hdl21 Schematics
BSD 3-Clause "New" or "Revised" License
14 stars 2 forks source link

The `Dot`s Feature #5

Open dan-fritchman opened 2 years ago

dan-fritchman commented 2 years ago

The last pending attribute of each Schematic is the Dot.
These are intended as visual aids for connectivity annotations.

Pending thoughts on their implementation:

growly commented 2 years ago

Dumb question

If I draw a vertical wire

   |
   |
   |

then I draw a horizontal one


-------

It seems I will not get a dot. But I also can't add one?

   |
---O---
   |

So to force this connection I should draw:

     |
---O-O---
   |

?

dan-fritchman commented 2 years ago

Not a dumb question!

The way you'd get that third picture, both in most schematic-editors I know and in the intent here, is to add a vertex in the middle, then draw the second half of the horizontal line.

So this:

   |
   |
   |

Turns to this:

   |
---O
   |

And then to this:

   |
---O---
   |

Now the part you probably can't tell is that doing so does work in Hdl21 Schematics, right now. If you stick that vertex right in the middle (by clicking and then continuing), the horizontal wire will be connected to the vertical one. We just don't draw the dots yet, so it's not terribly visually clear.

dan-fritchman commented 2 years ago

There's another possible method, which some schematic editors have: a sort of "add dot where wires are currently flying-over each other" UI mechanism. In Virtuoso, for example, I believe double-clicking on the middle of this picture:

   |
-------
   |

Would turn it to this one:

   |
---O---
   |

You can imagine plenty of other mechanisms, e.g. a right-click menu or an "add dots" UI mode.
We can reserve judgment about any of these; I was planning to do none of them for now. When the Dots feature (this very issue!) is complete, the prior "add an intersecting vertex" method should work clearly, and we can decide whether we need any others.

growly commented 2 years ago

gotcha.

dan-fritchman commented 2 years ago

119d676 adds the dots to the SVG content, and "dot inference" on loading. 894d364 draws them in the editor app.

Primary downside for now:
Every time anything that could change the dot locations happens, we re-infer them all. This includes:

This will be slow. But it's a start. In time we can move to just redo'ing the potentially effected Dots, per object edited.