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

Add symbol editor #700

Merged
merged 6 commits into from
May 3, 2024
Merged

Add symbol editor #700

merged 6 commits into from
May 3, 2024

Commits on Apr 13, 2024

  1. Add feature: saving symbol to file

    "Schematic" object already can edit symbols, this commit makes
    it able to save and load them.
    
    Implementation is actually quite ugly in terms of code beauty
    and industry standards, it's very "hacky". It consists of two
    parts:
    1. Teach "Save" and "Open" dialogs to deal with "*.sym" files
    2. Modify "Schematic" object and some other parts of codebase
       so that when a schematic is saved and the filename ends with
       "*.sym", then only symbol parts are saved. And vice versa:
       when a file with a name ending in "*.sym" is opened, then
       skip the path for usual schematic, and load only symbol parts.
    
    The "symbol file" is actually a stripped "schematic file" — no
    properties, no components, etc.
    wawuwo committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    f00c6ef View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2024

  1. Fix: show port numbers when editing *.sym file

    - PortSymbol has two members: nameStr and numberStr.
    - nameStr is usually empty and is set from Schematic::adjustPortNumber
      after performing some obscure checks.
    - numberStr is usually contains a number
    - PortSymbol::paint outputs 'nameStr' as ports "label"
    - When editing a *.sym file, 'adjustPortNumber' is not called,
      nameStr remains empty
    
    This patch makes PortSymbol use 'numberStr' as fallback value for
    cases when 'nameStr' is empty. When editing a *.sym file one won't
    see a port without label anymore.
    wawuwo committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    ca9d201 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2024

  1. Allow inserting ports when editing a symbol

    "Insert port" tool is reused it. When in symbol editing mode,
    left mouse button click with this tool activated spawns a dialog
    asking for port name, then insert a port.
    
    I hope there is no breaking changes and everything is backwards
    compatible as I strived to add workarounds everywhere it's needed.
    
    The sad part is that code is not elegant, it increases overall
    codebase entropy, doesn't follow any general strategy. It's just
    a set of patches.
    wawuwo committed Apr 20, 2024
    Configuration menu
    Copy the full SHA
    44eda49 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. Configuration menu
    Copy the full SHA
    bfb9dc5 View commit details
    Browse the repository at this point in the history
  2. Fix detached ports disappearing after undo in symbol edit mode

    Detached ports are ports which were inserted manually, i.e. they
    don't have a corresponding port in schematic.
    
    Inside Schematic::undo the Schematic::adjustPortNumbers is called.
    The latter removes detached ports and because of that you lose
    all of your ports if use "undo" once.
    
    But Schematic::adjustPortNumbers is also called every time the
    editing mode is switched and when the file is saved. So I think
    it wouldn't be harm to not adjust port numbers every time you
    undoing.
    wawuwo committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    44d9b55 View commit details
    Browse the repository at this point in the history
  3. Fix build: add missing include

    wawuwo committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    483bd60 View commit details
    Browse the repository at this point in the history