EEschema - copy/paste of grid cells between schematics not working

Bug #1828222 reported by Art
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Medium
Jeff Young

Bug Description

Quite often I need to copy a portion of schematic or a single symbol from one schematic to another. Right now EEschema doesn't support that unless you really do some tedious contortions with it. Ok, it is what it is... But at least can you fix support for cutting and pasting all the custom fields from one symbol properties to another on a different schematic sheet?

So if I open one schematic sheet in one project go to component properties and copy all the values there (single column) and then close that sheet and try to paste the selection into another symbol in another schematic sheet/project, nothing happens. It seems that cut/paste buffer is purged as soon as EEschema is closed. What is the point of doing it, I wonder?

Application: kicad
Version: (5.1.0-rc1-142-g5315d1be2), 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 8 (build 9200), 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

Tags: eeschema
Jeff Young (jeyjey)
Changed in kicad:
milestone: none → 6.0.0-rc1
status: New → Fix Committed
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Jeff, does this include copying hierarchical sheets from the clipboard? If so, did you run the pasted sheets through the litany of tests that are required to prevent infinite recursion bugs?

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

@Wayne, yes and yes.

See SCH_EDITOR_CONTROL::Paste().

tags: added: eeschema
Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1828222] Re: EEschema - no cut and paste between different schematics

Nice!

On 5/8/19 11:04 AM, Jeff Young wrote:
> @Wayne, yes and yes.
>
> See SCH_EDITOR_CONTROL::Paste().
>

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote : Re: EEschema - no cut and paste between different schematics

Yes far I tested, the copy-paste feature just miss to copy the symbol to the library, and now I realize the files to the new folder, reported here lp:1827915.

Revision history for this message
Art (diametrix) wrote :

Dude, talk about getting things messed up! Yes you fixed one aspect of copy and paste - you can do it now between the sheets, but there are numerous other issues that make it still unusable. Here is my short albeit not exhaustive list:

1. Ctr-C, Ctr-D shortcuts don't work now
2. EEschema crashed when you try to cancel out with an Esc button while trying to paste a symbol (select paste from the menu, having symbol attach to the cursor for placement)
3. Not sure if it is related, but had EEschema crash several times just accessing symbol properties dialog box
4. Copying KiCad version info from the About KiCad menu suffers from the same issue: copy buffer gets cleared once KiCad is closed.

So to sum it up, one step forward, two steps back

Application: kicad
Version: (5.1.0-512-g5f4a6e33a), 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 8 (build 9200), 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

Changed in kicad:
status: Fix Committed → New
Revision history for this message
Michael Kavanagh (michaelkavanagh) wrote :

Please try Eeschema Preferences > Hotkeys > Set to Defaults. Some hotkeys were changed to align the tools with Pcbnew and this may cause conflicts. I cannot replicate any of the issues you list:

1) Ctrl+D for duplicate works fine (can hover over or select items), Ctrl+C for copy to clipboard requires the items to be selected.
2) I think this was fixed recently.

Changed in kicad:
status: New → Incomplete
Revision history for this message
Art (diametrix) wrote :

Forgot to mention one more thing:

5. Highlighting columns in the symbol properties dialog box not is near impossible. Previously you could click on the column header (mostly Value) and copy the whole column and them paste it into another symbol. Now more often than not the column is highlighted in grey thus making it impossible to copy.

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

@Art, I didn't mess it up. I did those just to annoy you. ;)

Revision history for this message
Art (diametrix) wrote :

@Jeff, thanks. Take it as a kindness... I didn't say you did. I just said things got messed up.

Not sure if this related to my last comment about column selection but after some vigorous clicking between cells and columns trying to select the column I just got that dialog hand up completely. I can still select the cells and edit them but none of the buttons (OK, Cancel etc) are accessible. I can't close it with the red x button in the top right corner either. No way to save what I was doing before that :(

Revision history for this message
Art (diametrix) wrote :

Ok, after living it on its own for a while it came back to life. Not sure what happened there

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

You're running mostly into wxWidgets errors there. Their wxGrid works better than the wxDataView we used to use, but it still has issues. We try to work around them, but it can be pretty difficult. (We build our own copy of wxWidgets on Mac, so it's easier there.)

Changed in kicad:
status: Incomplete → Triaged
assignee: nobody → Jeff Young (jeyjey)
Revision history for this message
Jeff Young (jeyjey) wrote :

Copy/paste appears to work fine; it's the column selection that's busted. Because the editor control is open for the first cell, it eats the ctrl-C command and we don't get it. (If you click below the bottom of the grid the cell editor will close, the highlighting will change, and then you can ctrl-C and get all the cells.)

Changed in kicad:
status: Triaged → In Progress
importance: Undecided → Medium
summary: - EEschema - no cut and paste between different schematics
+ EEschema - copy/paste of grid cells between schematics not working
Jeff Young (jeyjey)
Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Art (diametrix) wrote :

Well, its gone from unusable to ...what's worse than unusable? Sorry for changing the status of the bug report. Let me know if it is better to start a new one.

The main problems are:

1. Symbol selection - sometimes the whole symbol gets highlighted and sometimes only one of the pins (I mention it here only because it is a first step in trying to copy something and you never know if you actually selected a symbol or not)
2. Copying with Ctr-C Ctr-D still doesn't work, either by selecting a symbol or by hovering above it. Nothing gets placed into the copy buffer.
3. Which is not a big deal now, because context menu on the right click doesn't work either. So no copying and pasting from context menu either... or from the edit menu for that matter. If you click copy from the edit menu it does place symbol into the copy buffer. However Paste option remains greyed out, so it doesn't do you any good, because you still can't place it.

So to solve the problem of copying between different sheets the easiest way it to disable copying altogether ;)

Changed in kicad:
status: Fix Committed → New
Revision history for this message
Art (diametrix) wrote :

That's funny. Copying version info still doesn't work if you close KiCad after you copy the info. Buffer gets emptied.

Application: KiCad
Version: (5.1.0-560-g2aea26de1), 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 8 (build 9200), 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
Jeff Young (jeyjey) wrote :

1) Symbol selection: if a pin is highlighted then the pin is selected, not the symbol. Tool which work on symbols are smart enough to promote the selection to the symbol if needed.

2) By "copy buffer" I assume you mean the system clipboard? I wonder if the issue is Windows-specific. (It works fine on Mac.)

3) Context menus are undergoing some re-factoring right now. I suspect it's already fixed but not yet merged.

Revision history for this message
Art (diametrix) wrote :

1. I'm not even going to ask why highlighting a pin is so important. If I click on a symbol (as you can see in the video, which I assume you watched) and not on the pin and the symbol is not highlighted - that is a problem. Especially considering the fact that you can't really see that the pin is being highlighted. It might work well in theory with bigger symbols, but for symbols which have pins close together (like the capacitor in the video) that creates a problem. At the very least there should be a disambiguation menu.

2. Which part would be Window specific? The fact that Ctrl-C or Ctrl-D doesn't work or that Paste option in the Edit menu remains greyed out? Those seem like two separate issues to me.

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

I think the part about click-mis-hits is due to the code I just put in to make selecting wires easier. It allows 5 pixels of "slop", but I think it needs to keep track of distance and select the closest object.

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

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

Changed in kicad:
status: New → Fix Committed
Revision history for this message
Jeff Young (jeyjey) wrote :

I've implemented better (or maybe just different) hit testing logic. Let me know if it improves things....

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.