Eeschema: changing Library Reference from/to multiple unit symbols messed up

Bug #1822316 reported by dhaillant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Medium
Jeff Young

Bug Description

Hi,

In EEschema, place a single part component (ex. a resistor or a diode...).

Edit (E) it. In Symbol Properties window, click on "Browse Library" and in "Choose symbol" window, select a multi part symbol. Validate.

(Unit dropdown list is greyed.)

Validate.

The symbol now looks funky with all the parts rendered stacked.
The component reference has a "@" char at the end.

Edit that symbol again.

In Symbol Properties window, "Unit" dropdown list is now enabled but no unit selected by default. Choose a unit.

Validate.

Things are back to normal. No more stacked parts.

Now, two different behaviours:

1) if you selected the first unit (A), no problem

2) but if you selected any other part (B, C, etc...) and you go back to Symbol Properties and choose a single part unit, say a resistor, and validate:

your symbol has NO pin.

You need to edit the symbol again, choose any multi part, validate, edit again, choose unit A, validate, edit again (!) and then choose your single part unit.

Tested both on Windows and Linux.

Application: kicad
Version: 5.1.0-060a0da~80~ubuntu16.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-143-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
dhaillant (david-haillant) wrote :

In my opinion, this is how it should behave:

Once you choose a Single Part symbol, Unit dropdown selector should be greyed/disabled.

And once you choose a multi part component, the dropdown list should be instantly enabled, with the correct multi parts informations loaded, and one default unit selected.

Plus, reverting to a single part symbol should not mess with units...

Thank you.

Revision history for this message
Michael Kavanagh (michaelkavanagh) wrote :

Well this is a weird set of steps but it definitely could be handled better.

Application: kicad
Version: (5.1.0-161-gd928aa978-dirty), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
Platform: Mac OS X (Darwin 18.5.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.4 (UTF-8,STL containers,compatible with 2.8)
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.54.0
    Compiler: Clang 10.0.1 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=ON
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=OFF
    KICAD_SCRIPTING_MODULES=OFF
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Changed in kicad:
importance: Undecided → Medium
status: New → Triaged
Jeff Young (jeyjey)
Changed in kicad:
assignee: nobody → Jeff Young (jeyjey)
status: Triaged → In Progress
Jeff Young (jeyjey)
Changed in kicad:
milestone: none → 5.1.1
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision fe1c2310e498655f504fba18f08af82f100604c4
https://git.launchpad.net/kicad/patch/?id=fe1c2310e498655f504fba18f08af82f100604c4

Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Seth Hillbrand (sethh) wrote :

@Jeff-

The solution here causes issues as it changes the default unit/convert from 1 to 0. This ends up generating invalid schematics [1]. Luckily, we have a repair function on open that resets the schematic.

I've reset the places I know of but I wonder if you could cast an eye over things for any other places this might be set?

[1] https://bugs.launchpad.net/kicad/+bug/1824764

Revision history for this message
Jon Evans (craftyjon) wrote :

Since I was just digging through this, a reminder on the status quo of the convert field:

The default convert for a component needs to be 1.
The default convert for a component *pin* is 0, meaning "applies to both converts"

The code could be better-commented about this, because it's easy to interpret the comments around the convert property to mean that components should have a default convert of 0, but currently only values of 1 or 2 are valid.

Revision history for this message
Jon Evans (craftyjon) wrote :

Ah I see Seth just made it more clear with an enum, thanks Seth!

Changed in kicad:
status: Fix Committed → Fix Released
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision fe1c2310e498655f504fba18f08af82f100604c4
https://git.launchpad.net/kicad/patch/?id=fe1c2310e498655f504fba18f08af82f100604c4

Changed in kicad:
status: Fix Released → Fix Committed
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.