Eeschema should rescue missing symbols when appending sheet

Bug #1791280 reported by PK555
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Medium
Wayne Stambaugh

Bug Description

Application: kicad
Version: (5.0.0), release build
Libraries:
    wxWidgets 3.0.3
    libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.60.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.54.1
    Compiler: GCC 7.1.0 with C++ ABI 1011

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

Done this twice:
Create New project
File > Append Schematic Sheet
Load an old Schematic
Add, Remove as per normal saving constantly.
At some stage it breaks, Selecting 'Save' then the error.
See Screenshot.

Revision history for this message
PK555 (pk555) wrote :
Seth Hillbrand (sethh)
summary: - Errors occurred creating symbol library
+ Eeschema should rescue missing symbols when appending sheet
Changed in kicad:
importance: Undecided → Medium
milestone: none → 5.0.1
status: New → Triaged
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Looking at the screenshot, it looks like the same bug[1] that effected the rescue code which has been fixed in both the development branch and the 5.0 branch. Would you please test this with a nightly build to see if you still have the issue?

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

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

@Wayne-

I tested this with the latest nightly and appending a sheet that has symbols not available in the symbol table will show you the symbols until you trigger a re-load of the symbol table. Either edit a library or close, reload the schematic. Then the rescue happens. Unless you try to edit the symbol in the schematic. Then the missing symbols show as unmapped.

I think we should be re-mapping on import.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1791280] Re: Eeschema should rescue missing symbols when appending sheet

@Seth, there is a warning dialog when an imported schematic has not been
remapped (see line 481 in eeschema/files_io.cpp) warning the user about
broken symbol links but the bug reporter didn't mention it. If the user
didn't get this warning, that is a different issue than if the warning
was ignored. Fixing this will be very tricky. This is why I just went
with a warning. Ideally, the user should open the project to be
imported and remap it before importing it into another project. If you
import from a schematic in another project, you may have issues with
determining the correct symbol libraries from which to remap. This
could be true even if the imported schematic has been fully remapped in
the case of missing project symbol libraries. The only way I know to
guarantee this is to remap the imported project using the imported
projects symbol library table and then using the imported projects cache
library as a new entry in the current project symbol library table to
ensure all of the imported schematic symbols are available. I don't
think this will be trivial to fix.

On 09/07/2018 11:17 AM, Seth Hillbrand wrote:
> @Wayne-
>
> I tested this with the latest nightly and appending a sheet that has
> symbols not available in the symbol table will show you the symbols
> until you trigger a re-load of the symbol table. Either edit a library
> or close, reload the schematic. Then the rescue happens. Unless you
> try to edit the symbol in the schematic. Then the missing symbols show
> as unmapped.
>
> I think we should be re-mapping on import.
>

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

Argh. I said "re-map" and meant "rescue". Sorry for the confusion. I agree there is an informative message when appending a schematic that needs remapping. We don't need to change that.

The schematics should be prompting for rescue when appending if needed.

Here's what I did:
1) Create new project
2) Open Eeschema
3) Append Schematic Sheet
4) Choose sonde xilinx.sch from the demos
5) Note that it appends and all elements are visible with no apparent problem.
6) Ctrl-E on a symbol to edit it in LibEdit. Note that you are now editing the sonde xilinx library.
7) Close and save the schematic. Re-open and you are now prompted with the rescue dialog.

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

The rescuer is designed to rescue symbols only in the current project.
Rescuing symbols from another project would require some major
modification the rescue code.

On 09/07/2018 10:06 PM, Seth Hillbrand wrote:
> Argh. I said "re-map" and meant "rescue". Sorry for the confusion. I
> agree there is an informative message when appending a schematic that
> needs remapping. We don't need to change that.
>
> The schematics should be prompting for rescue when appending if needed.
>
> Here's what I did:
> 1) Create new project
> 2) Open Eeschema
> 3) Append Schematic Sheet
> 4) Choose sonde xilinx.sch from the demos
> 5) Note that it appends and all elements are visible with no apparent problem.
> 6) Ctrl-E on a symbol to edit it in LibEdit. Note that you are now editing the sonde xilinx library.
> 7) Close and save the schematic. Re-open and you are now prompted with the rescue dialog.
>

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

Once we append a sheet to the schematic, it should be part of the current project. I wouldn't suggest rescuing from an external project's cache but symbols that are present in the imported schematic's local libraries and not in the current schematic's libraries should be dealt with.

Since this would involve modifying dialogs, it should wait until 5.1 though. I can probably just open a new report for it so we can track independently.

I checked back to 5.0.0 and this process was definitely broken there. @PK55 were you able to test with a nightly build as Wayne suggested?

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

@Seth, any rescue that does not include the imported schematics cache library carries a high probability of not being correct which is almost as bad as not being rescued at all. I cannot think of any other way to do this accurately. This is why I added the warning dialog because I could not think of a better way to do this. I wonder if it's worth the effort. Once the new schematic file formats are implemented, all of the mapping and rescuing issues go away. I suppose you can try to remap using the current projects library table but your mileage may vary greatly.

Seth Hillbrand (sethh)
Changed in kicad:
milestone: 5.0.1 → 5.1.0
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I may move this up to 5.0.2 but we can leave it for 5.1 for now. It just depends how fast I can get this done.

Changed in kicad:
assignee: nobody → Wayne Stambaugh (stambaughw)
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

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

Changed in kicad:
status: Triaged → 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.