Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Dots Feature #5

Open
dan-fritchman opened this issue Oct 3, 2022 · 5 comments
Open

The Dots Feature #5

dan-fritchman opened this issue Oct 3, 2022 · 5 comments

Comments

@dan-fritchman
Copy link
Collaborator

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

Pending thoughts on their implementation:

  • There will be a Dot at each connected Instance Port.
  • There will be a Dot at each Wire-to-Wire vertex-intersection, which is not either end of one or both wires.
  • Perhaps most impactfully: Dots will have no semantic meaning in the schematic
  • Connections will continue to be inferred by Wire vertices. Dots are purely visual
  • At schematic loading time, we can have an "infer dots" function/ class, which determines where the editor should place dots. And it could compare them to the ones found in the schematic. If the two differ... I guess we'd prefer the inferred versions. This would only seem to happen if (a) the SVG schematic content is edited outside our editor, or (b) the editor behavior changes between versions, or (c) we have a bug. So, maybe some day even drop that step altogether.
@growly
Copy link
Contributor

growly commented Oct 21, 2022

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Contributor

growly commented Oct 21, 2022

gotcha.

@growly growly closed this as completed Oct 21, 2022
@dan-fritchman dan-fritchman reopened this Oct 21, 2022
@dan-fritchman
Copy link
Collaborator Author

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:

  • Adding anything (wire, instance, port)
  • Removing anything (wire, instance, port)
  • Moving anything movable (instance, ports)
  • Undo'ing/ redo'ing any of the above

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants