← Back to team overview

kicad-developers team mailing list archive

Re: Static variables in module editor

 

On 06/11/2014 02:36 AM, Tomasz Wlostowski wrote:
> On 11.06.2014 07:30, Dick Hollenbeck wrote:
>> On 06/10/2014 04:39 PM, Tomasz Wlostowski wrote:
>>> On 10.06.2014 16:40, Dick Hollenbeck wrote:
>>>>>
>>>>> I clicked send, replying to Lorenzo's comment right when your next
>>>>> e-mail came. Sorry for that,
>>>>
>>>>
>>>> Thanks Tom, apology accepted.
>>>>
>>>> Another thing we get by supporting multiple open projects and paste, is we are only one
>>>> step away (i.e. COPY) from having copy and paste across projects, and therefore libraries.
>>>>
>>>> This is leaner than the current methodology of having to switch "current libraries" to
>>>> move a footprint from one to another.  And while yes code improvements could also have
>>>> brought this, what we're seeing with this multiple project approach is the footprint
>>>> movement support *without changing existing code* to any great extent.   That sounds like
>>>> free to me.
>>>>
>>> Dick,
>>>
>>> I don't see any issue with adding copy/paste and using s-exprs is the
>>> right way of doing so. But this discussion was about getting rid of a
>>> bunch of static variables.
>>>
>>> My proposal would be to:
>>> 1. Remove the statics, temporarily removing the
>>> retain-last-edited-footprint feature.
>>> 2. Add copy/paste in both pcbnew main window and the module editor.
>>> 3. Once the copy/paste code is verified, use PROJECT::GetRString() to
>>> bring back the last footprint feature.
>>>
>>> This way we would have ultimately less coding to do at the cost of
>>> temporarily disabling a feature that is IMHO not absolutely necessary
>>> for Kicad to work.
>>
>> It was not that much coding, less than 30 lines I think.  I did not do the PASTE support
>> yet, but the retention of the last footprint is in rev. 4937.  It took me about 1/2 hour
>> and that's longer than it would have taken had I consulted the places I've use this
>> support elsewhere.
> Dick,
> 
> I agree it's very easy if you want to copy an entire footprint from one 
> library to another. 


As a user I just want to PASTE from my browser or text editor, into the module editor,
short term.  This is low hanging fruit with a high ROI.

The design or coding of the rest requires more time than I want to spend.  It has a
different ROI.  I would be fighting to be first in line to say thank you for it however.


> But things may get complicated for general-purpose 
> copy paste with arbitrarily selected items.
> 
> Imagine that you want to copy-paste a bunch of traces/vias from one PCB 
> file to another. What happens with the nets? Should one ignore the nets 
> of the copied objects and propagate the nets of the items in target 
> design that are colliding with the pasted items? Or store the 
> netcode<>netname mapping in the clipboard too and add new nets to the 
> target design?
> 
> Regards,
> Tom
> 



References