← Back to team overview

kicad-developers team mailing list archive

Re: [Patch] pcbnew clipboard support

 

Kristoffer,

I finally had a chance to test this and it seems to work fine.  You
definitely need to add copy and paste to the context menu and probably
to the main menu as well.  While ctrl-c and ctrl-v are will known,
Pcbnew has never had a copy and paste feature so it may be wise to add
the menu entries for existing users.  The only issue I see is that the
netlist path is empty so I'm not sure how the this will effect the
ratsnest and connectivity algorithms.  I'm OK with it as long as no one
else objects.

Orson,

would you please take a look at this when you get a chance to see if
this makes sense as far as the tool framework goes.

Thanks

Wayne

On 5/21/2017 4:32 PM, Kristoffer Ödmark wrote:
> Hello!
> 
> I fixed the kicad clipboard code according to your comments, it is now
> linked to ctrl+c and ctrl+v, utilizing different code paths depending on
> what frame they are invoked at.
> 
> I also fixed the crashes when trying to paste strange stuff.
> 
> The code is available for testing at:
>     https://code.launchpad.net/~kristoffer-odmark/kicad/+git/kicad/+ref/copypasta
> 
> 
> One thing is missing since I am unsure how to proceed,
> the context menu entries.
> 
> Should I create a new clipboard_tool.cpp/h file and add context entries
> from there?
> 
> Should I add the context entries in the files where they are now?
> ( selection menu for copying to clipboard, pcbnew_control for pasting,
> module editor tool for pasting in module editor )
> 
> Should I do it someway enterily different?
> 
> Please advice
> 
> - Kristoffer
> 
> 
> 
> On 2017-05-08 15:41, Maciej Sumiński wrote:
>> Hi Kristoffer,
>>
>> It is a neat feature. Your application is a good application, but I
>> think it would really shine in the footprint editor. Unfortunately, it
>> crashes when I tried to copy and paste a bunch of pads. Could you
>> check it?
>>
>> IMHO it would be better to keep standard Ctrl+C and Ctrl+V hot keys, as
>> this is what people are likely to press when they want to copy or paste
>> items. These two functions also deserve an entry in the right-click
>> context menu. Let's not add more hidden features in KiCad.
>>
>> Speaking of which, you can also have a look at
>> MODULE_EDITOR_TOOLS::{Copy,Paste}Items()
>> (pcbnew/tools/module_editor_tools.cpp). Yes, you guessed it - there was
>> already copy & paste for the module editor, but it was not properly
>> exposed, mea culpa. We need to pick one way, and remove the other.
>>
>> There are also some code formatting violations that also should be
>> handled before merging the patch. Tools like uncrustify or clang-format
>> will do most of the boring work for you.
>>
>> If we decide to choose your way, then you need to add GPL license header
>> for kicad_clipboard.{cpp,h} too.
>>
>> Regards,
>> Orson
>>
>> On 05/04/2017 10:40 AM, Kristoffer Ödmark wrote:
>>> Hello all!
>>>
>>> Last night I was doing some design that used a PCB antenna. I had this
>>> antenna design made in zones, It was very frustrating to try to copy
>>> this between an old design and a new one since I had to use a texteditor
>>> ( very glad that I could though ).
>>>
>>> After this I figured that this should be able to be copy-pasted between
>>> pcbs.
>>>
>>> So I have now implemented a subclass of the PCB_IO, that can format an
>>> entire board or a selection to the clipboard in textformat, and then
>>> created a subclass to the PCB_PARSER that parses from the clipboard and
>>> reuses the "append board" functionality to add them back. It also does
>>> remove the "path" properties of modules. This allows me to copy-paste
>>> things between different PCBs in kicad. The shortcut keys are
>>> ctrl+shift+c and ctrl+shift+v so that people dont use this by mistake :)
>>>
>>> I think that this might be useful for reusing designs in some manner,
>>> and if this is in Kicad, my next step would be to start looking into
>>> some tool to link the pasted modules to symbols in the schematic.
>>>
>>> Give me some insight on what you think about this please :)
>>>
>>> video: https://youtu.be/4SuUzma0Ua4
>>>
>>> (only tested in linux)
>>>
>>> - Kristoffer
>>>
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~kicad-developers
>>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>
>>
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
>>
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp



Follow ups

References