Eeschema: Append schematics clears out existing annotation

Bug #1805695 reported by Frank Severinsen
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Low
Wayne Stambaugh

Bug Description

Hi Guys

Steps to reproduce:
1. open up any annotated schematic
2. append any schematic sheet.
3. ALL annotation is now gone including in other sheets.

Desired behavior should be to only clear annotation on the appended schematic.

Application: kicad
Version: 6.0.0-rc1-unknown-4d73cfb~84~ubuntu18.10.1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.4) nghttp2/1.32.1 librtmp/2.3
Platform: Linux 4.18.0-11-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.0
    Compiler: GCC 8.2.0 with C++ ABI 1013
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=OFF
    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

Tags: eeschema
Revision history for this message
Frank Severinsen (shack) wrote :

OBS this is actually present in 5.0.1 stable.
Should perhaps be fixed in stable as well

tags: removed: gal
summary: - GAL Eeschema: Append schematics clears out existing annotation
+ Eeschema: Append schematics clears out existing annotation
Revision history for this message
eelik (eelik) wrote :

Workaround: create a temporary hierarchical sheet. Append the schematic there. Then copy from there and paste to another sheet.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Frank, do you mean all of the other sheets in your schematic or all of the other sheets in the appended schematic?

Changed in kicad:
status: New → Incomplete
Revision history for this message
Frank Severinsen (shack) wrote :

In all my schematic, root and Subsheets

Revision history for this message
eelik (eelik) wrote :

In the sheet where it was appended to and all its subsheets. But not the sheet in upper level. For example sheet hierarchy:

A
|__B
   |___C

where C is a hierarchical sheet inside B and B is inside A.

If I append a .sch file to B, the annotations in B and C are cleared, but not A.

If I understood Frank correctly he thinks that the annotations of the newly appended symbols should be cleared, not the annotations which were already in the current schematic, no matter what the hierarchy. I agree with that.

Revision history for this message
Frank Severinsen (shack) wrote :

Thanks for the clarification @Eelik. And that is indeed exactly my points

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Frank, are B and C in @eelik's example in #5 part of the current project? If so, then it makes sense that the B and C references are cleared because all references in the appended schematic(s) are cleared not just the new reference paths. We would need to change the code to only clear the references of the appended reference paths which would be rather complex. We opted for the easy way out and cleared all reference paths which would cause the behavior you are seeing.

Revision history for this message
Frank Severinsen (shack) wrote :

@Wayne
Yes I have B and C subsheets in my project. In my case I needed to append to A (rootsheet), which cleared all designator on my entire schematic.

just to be clear, the schematic I appended, was a single sheet with no subsheets.

to summarize I don't see why appended schematics should touch any preexisting schematic.

Revision history for this message
Rene Poeschl (poeschlr) wrote :

Lets make it even simpler. This whole thing also affects schematics without any hierarchical sheets in it. I made a quick screencast [1] of what happens if you append a sheet with one single symbol in it to another one with also one symbol in it. The expectation would be that the original symbol (J2) keeps its annotation and only the one from the source sheet (X1) should loose it.

It has also been reported on the forum [2]. In that case there is already an existing layout. Loosing the annotation means that the layout and schematic get out of sync.

I attached the projects i used to create the screencast.

[1]: https://youtu.be/LkXT06GrM5s
[2]: https://forum.kicad.info/t/appending-components-in-eeschema-resets-all-annotations/13917

Changed in kicad:
status: Incomplete → Triaged
importance: Undecided → Low
milestone: none → 5.1.0
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I've attached a patch to fix this issue but I would like some further testing before I commit it. There was an ominous warning comment (eeschema/files_io.cpp lines 623-624) about clearing the annotation before the symbol links were updated but this doesn't make sense to me. Git blamed @Jeff for this comment so I'm curious as to why this is an issue since the symbol links shouldn't effect the annotation.

Revision history for this message
Jeff Young (jeyjey) wrote :

@Wayne, afraid I can't help much on the comment:

    // Clear all annotation in the imported schematic
       to prevent clashes with existing annotation.
    // Must be done after updating the symbol links as
       we need to know about multi-unit parts.

The first half predates me. I just moved it and added the second half about the clear needing to be done after updating the links.

Revision history for this message
Seth Hillbrand (sethh) wrote :

@Wayne-

Your patch seems to work as advertised.

That said, the original comment was written in the fix to lp:1731760

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I pushed my patch. If someone finds a corner case, I can fix it then.

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

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

Changed in kicad:
status: Triaged → Fix Committed
assignee: nobody → Wayne Stambaugh (stambaughw)
Revision history for this message
Frank Severinsen (shack) wrote :

@Wayne Thanks for the fix! should this be added to stable as well?

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Frank, 5.0.2 has already been tagged and the packages are in the process of being built so this fix wont make it. I'm hoping we can get 5.1 release before FOSDEM so we wont have to create a 5.0.3 release.

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.