losing old annotated reference number of components when appended another schematic circuit

Bug #1818785 reported by muzaffer
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Won't Fix
Wishlist
Unassigned

Bug Description

kicad lose old annotated reference number of components when appended another schematic circuit. Could you find a solution ?

Application: kicad
Version: 5.0.2-bee76a0~70~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.15.0-45-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_WXPYTHON=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 :

I belive this has been fixed already
Can you test the nightly build?

Revision history for this message
eelik (eelik) wrote :

It's not fixed.

1. Create hierarchical sheet.
2. Enter it.
3. File->Append Schematic Sheet Content.
4. Select the .sch file to be appended.
5. OK.
6. Annotations are lost in the appended schematic.

Use case: reuse existing schematic and layout with corresponding annotations. Schematic must be appended because Copy/Paste between projects isn't possible. Layout can be copied between pcbnew windows/boards.

It's possible to clear annotations of the appended schematic later, but it's not possible to restore them. Therefore they should be kept when appending.

Application: kicad
Version: (5.1.0-rc2-38-g4612175da), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.1
    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=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
Rene Poeschl (poeschlr) wrote :

I think frank confused it with https://bugs.launchpad.net/kicad/+bug/1805695

There the topic was that if you append something your current files annotation is cleared. (Which is clearly a bug as adding something to your schematic should not clear the annotation of the rest.)
---

There are also some things that would need to be decided for this to ever be implemented. How should conflicts be dealt with (Clear automatically, take next free reference or ask user)
Should the "use page number in annotation" flag be taken into account? (Again what should happen in the imported schematic does not follow that convention.)

Revision history for this message
eelik (eelik) wrote :

Reusing old designs, both schematic and layout, would need better mechanisms anyways.

Meanwhile a dialog with choice boxes when sheet is appended would be enough for this case.

As a workaround I have copied sheet contents as text from one file to another. It may need some tweaking but at least it makes reuse of both schematic and layout possible.

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

I think a bug report for this was already submitted. The solution discussed was a checkbox to keep the existing annotation.

@eelik, your statement about not being able to copy and paste between projects is false. Open Eeschema in the stand alone mode any you can copy and paste between schematics from different projects. It's not convenient but it is possible. Until KiCad moves to a multiple document interface, you will have to use this method. There are no plans in the immediate future to move to a MDI. We have far greater issues to resolve.

Changed in kicad:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
eelik (eelik) wrote :

I have tried the same procedure than with pcbnew: have the destination in the project, open standalone pcbnew, copy from there, paste to project's pcbnew. This doesn't work for schematic, it doesn't give Paste menu item in destination's menu.

MDI isn't needed, just copypaste between instances would be enough.

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

@eelik, you have to do this in the same instance.

Revision history for this message
eelik (eelik) wrote :

I understand that copying between two files must be done in the same eeschema instance sequentially.

In any case I realized that copying wouldn't help if one wants to keep annotation because it removes annotation. That's how it must work to be convenient in the main use case, i.e. inside one project. If keeping annotations is wanted it would need for example a new menu item and dialog, "Paste Special..." or something like that which would modify the pasted clipboard data according to what the user chooses. I think some applications (not necessarily EDA) have that kind of possibility to e.g. paste markup text as unformatted plain text.

Still offtopic, but just to be clear: pcbnew works differently than eeschema: it's possible to have two instances open and copypaste from one to the other. It doesn't work in eeschema.

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

The same-instance rules no longer apply. Eeschema cut/copy/paste uses the system clipboard, so you can do it between instances (or even between, say, Eeschema and a text editor).

Changed in kicad:
status: Triaged → Won't Fix
Revision history for this message
eelik (eelik) wrote :

Jeff, what's the connection between your latest statement (which in itself is true) on the one hand and the original bug report and the Won't Fix status on the other? There may be a reason for the new status but the new copypaste capability isn't one as far as the original problem (appending schematic) is concerned.

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

My thinking was that now that there are two ways to accomplish it, it makes sense for one to clear the annotations (append) and one not to (paste).

Revision history for this message
eelik (eelik) wrote :

OK, I have to test further how they work now. I just thought that it's natural that copy/paste will clear the annotations because inside one design there can't be the same annotation twice, and the most important (frequent) use case for copy/paste is inside one and the same design. Appending, on the other hand, comes from another design and it would make sense to keep the annotations, because they can be cleared and changed afterwards anyways but can't be restored when they have been automatically cleared.

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

Yeah, there are a bunch of different ways to slice and dice it.

My thinking was that copy/paste was the "lower level" operation and should do as little processing as possible, while append was a "higher level" command that would provide extra "smarts".

Revision history for this message
jean-pierre charras (jp-charras) wrote :

Be *extremely* careful with annotate/clear annotate stuff:

When something is pasted/imported inside a complex hierarchy, keeping annotation has no meaning: a given component has more than one reference.
Only clearing the annotation has meaning.

Note also pasting/importing something can create a complex hierarchy.

Even if a complex hierarchy is not in play, clearing annotation of a imported/copied schematic is the less bad way.
Moreover multiunit symbols create really tricky cases.

Any option that does not take in account complex hierarchy+multiunit symbols is a broken option by design.

Wayne and me have already spend a lot of time about the annotate stuff.
It is a mined field.

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

@JP, I think the paste code by-and-large uses your algorithm from https://bugs.launchpad.net/kicad/+bug/1789048.

In particular, it sets up and clears the alternate references if the pasted sheet appears more than once in the hierarchy.

Revision history for this message
eelik (eelik) wrote :

Here is a forum thread which shows that the need to keep the existing reference designators is a perennial problem: https://forum.kicad.info/t/move-blocks-between-sheets-maintaining-references/9081

Now when we can properly (or improperly :) ) copy even between eeshcema instances, is it necessary to have the Append functionality at all? What if there were only Paste and Paste Special? The latter would open a dialog with choices. Apart from possible bugs the user would be responsible for the effects of the choices.

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.