Re: [Kicad-developers] Internal units in the KiCAD source code

2020-02-15 Thread Wayne Stambaugh
The plotting dimensions can be an option in the plot dialog.  I don't
want to force the plot units one way or the other.

On 2/14/20 6:30 AM, Johannes Pfister wrote:
> What about changing the plotter and page_info classes to metric? Like
> changing GetSizeMils() to GetSizeUM(), m_IUsPerDecimil to m_nmPerIU
> and MIN_PAGE_SIZE to MIN_PAGE_SIZE_UM? I say um because it is the
> largest IU (PL-editor) and m_nmPerIU could be an integer (AFAIK). That
> would make everything metric, avoid rounding errors for pages and pen
> sizes that are on a grid of 1 um or 10 mil, and it would avoid
> calculating the conversations factor to convert from metric to
> non-metric, only to then convert the conversations factor back to
> convert metric to metric, like it is done when starting a gerber plot.
> It would not limit maximum page sizes to a lower limit.
> Would you accept and welcome this or do you think this is a bad or useless 
> idea?
> 
> Johannes
> 
> Am Do., 13. Feb. 2020 um 14:46 Uhr schrieb Wayne Stambaugh
> :
>>
>> Hi Johannes,
>>
>> Thank you for your suggestion but the internal units for each format
>> were chosen for a specific reason.  There really is no justifiable
>> reason to change them as they have been carefully selected based on the
>> requirements of the objects they represent.  Conversion code is provided
>> for each internal unit so plotting to standard units such as
>> millimeters, inches, etc is trivial.  I'm not opposed to adding support
>> for changing the plot units.  I am opposed to changing the internal units.
>>
>> Cheers,
>>
>> Wayne
>>
>> On 2/13/20 9:32 AM, Johannes Pfister wrote:
>>> The KiCAD code uses all kinds of different units for distances.
>>> Amongst other things I found:
>>>   nm: pcbnew internal units
>>>   10nm: Gerbview internal units
>>>   100nm EEschema internal units
>>>   1um: PL-Editor internal units
>>>   0.1mil (2.54um): SetViewport
>>>   1mil (25.4 um): WS_DRAW_ITEM_BASE and GetSizeMils
>>> And the native File formats use mm (pcbnew) and mil (EEschema).
>>> Something like SVG exports in 0.1 mil steps. I think that this is not
>>> very consistent and something like a PLOTTER class needs to handle
>>> different IU-sizes.
>>>
>>> My idea is to rewrite the internal units so that nm are used
>>> everywhere inside the source code, and only parts that write or read
>>> files and display data to or read data from the user should convert it
>>> to another unit system. I don't want to change any file formats.
>>> That would make it a bit more straightforward, more consistent, metric
>>> and an SVG-Plotter would use a metric step size. The disadvantage
>>> would be that there would be an about 2m or 4m limit in every
>>> direction, assuming int is 32 bit, which is AFAIK true for all
>>> platforms KiCAD current supports.
>>>
>>> Before i rewrite code, can you say what you guys think about it?
>>>
>>>
>>> Johannes Pfister
>>>
>>> ___
>>> Mailing list: https://launchpad.net/~kicad-developers
>>> Post to : kicad-developers@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] What does /path do in PCBNew files?

2020-02-15 Thread Brian Piccioni

Hello

In the "Kicad File Formats" PDF (and in KicadPCB files) there is (path 
/5127A011)  where the number after the slash usually changes. I don't 
see any where this field is described in the documentation.


It seems that if I copy and past a symbol in PCBNew the "(path /" field 
is duplicated so I end up with two components with the same "(path /" 
causes, for example "Error: Pcb footprints R100 and R8 linked to same 
symbol" error on back annotation.


This, in turn, causes problems with geographic reannotation.

So, can somebody explain what (path / is?

Thanks


Brian Piccioni

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] What does /path do in PCBNew files?

2020-02-15 Thread Eeli Kaikkonen
It's the symbol ID from the schematic. This defines the connection between
the symbol in the schematic file and the footprint in the layout file.

Indeed I have intended to ask about copying this in pcbnew. There's no way
to change (remove) it in pcbnew. Once a footprint is pasted or duplicated
it's bind to the same symbol as it's originator footprint. As far as I can
see there's one use case for this when copying from the same board: having
several alternative physical components for one functional component
(symbol). But this isn't obvious nor is it clean IMO.

It's probably useful if the corresponding components are copied from
another project to both eeschema and pcbnew. But inside one project this
may be more confusing than useful. Maybe it should be handled like
copying/pasting symbols and reference designators is handled now in 5.99:
with Paste Special options, trying to find the best alternative for the
default paste.

And/or there should be a way to reset this field. The footprints added by
the "Add a footprint" function don't have "path".


On Sun, Feb 16, 2020 at 12:30 AM Brian Piccioni 
wrote:

> Hello
>
> In the "Kicad File Formats" PDF (and in KicadPCB files) there is (path
> /5127A011)  where the number after the slash usually changes. I don't see
> any where this field is described in the documentation.
>
> It seems that if I copy and past a symbol in PCBNew the "(path /" field is
> duplicated so I end up with two components with the same "(path /" causes,
> for example "Error: Pcb footprints R100 and R8 linked to same symbol" error
> on back annotation.
>
> This, in turn, causes problems with geographic reannotation.
>
> So, can somebody explain what (path / is?
>
> Thanks
>
>
> Brian Piccioni
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] What does /path do in PCBNew files?

2020-02-15 Thread Brian Piccioni

Eeli

Thanks for the explanation. I suspect it will need a re-think - or at 
least some modification.


I am almost finished the "to do" list for geographic re-annotation. One 
thing that occurred to me is that the "re-annotate selected" would be 
very useful for duplicating design elements. For example, lets say we 
have 4 output amplifiers with connectors etc.. We can route one then 
copy and paste the other 3, then re-annotate them to correspond to the 
schematic. After all, we have nifty new "back annotation" functions!


Except back-annotation breaks when the /path field is duplicated.

I don't know enough to propose a fix but I can imagine users will have 
problems (and generate bug reports) when they do copy and paste inside 
PCBNew.


I think optionally removing the path might be a good idea - or, simply 
removing it from duplicated/pasted footprints. Of course I am probably 
missing something.


Brian



On 2020-02-15 6:07 p.m., Eeli Kaikkonen wrote:
It's the symbol ID from the schematic. This defines the connection 
between the symbol in the schematic file and the footprint in the 
layout file.


Indeed I have intended to ask about copying this in pcbnew. There's no 
way to change (remove) it in pcbnew. Once a footprint is pasted or 
duplicated it's bind to the same symbol as it's originator footprint. 
As far as I can see there's one use case for this when copying from 
the same board: having several alternative physical components for one 
functional component (symbol). But this isn't obvious nor is it clean IMO.


It's probably useful if the corresponding components are copied from 
another project to both eeschema and pcbnew. But inside one project 
this may be more confusing than useful. Maybe it should be handled 
like copying/pasting symbols and reference designators is handled now 
in 5.99: with Paste Special options, trying to find the best 
alternative for the default paste.


And/or there should be a way to reset this field. The footprints added 
by the "Add a footprint" function don't have "path".



On Sun, Feb 16, 2020 at 12:30 AM Brian Piccioni 
mailto:br...@documenteddesigns.com>> wrote:


Hello

In the "Kicad File Formats" PDF (and in KicadPCB files) there is
(path /5127A011)  where the number after the slash usually
changes. I don't see any where this field is described in the
documentation.

It seems that if I copy and past a symbol in PCBNew the "(path /"
field is duplicated so I end up with two components with the same
"(path /" causes, for example "Error: Pcb footprints R100 and R8
linked to same symbol" error on back annotation.

This, in turn, causes problems with geographic reannotation.

So, can somebody explain what (path / is?

Thanks


Brian Piccioni

___
Mailing list: https://launchpad.net/~kicad-developers
Post to     : kicad-developers@lists.launchpad.net

Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] What does /path do in PCBNew files?

2020-02-15 Thread Eeli Kaikkonen
On Sun, Feb 16, 2020 at 1:20 AM Brian Piccioni 
wrote:

> I think optionally removing the path might be a good idea - or, simply
> removing it from duplicated/pasted footprints. Of course I am probably
> missing something.
>
> Brian
>
You can't backannotate something which doesn't have the "path". But those
footprints can of course be re-annotated.

I don't think it's possible to cleanly copypaste groups of footprints to
create "duplicated design elements" as you say. Either they point to one
group of symbols while they should point to hierarchical sheet instances
(each of which have different path), or they don't have corresponding
symbols at all.

If you have two footprints with identical "paths" you can reannotate from
eeshcema (with a warning IIRC) and both footprints will have the same
refdes. But it doesn't make sense to have two footprints with different
refdes to point to one symbol because the symbol has only one refdes.

Having identical paths in more than one footprints is problematic anyways.
I have used it but I don't recommend it.

Eeli Kaikkonen
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] What does /path do in PCBNew files?

2020-02-15 Thread Brian Piccioni
I guess I'd wonder then why provide Copy and Paste/Duplicate if the 
result is not usable?


It seems like a sort of honey pot.

On 2020-02-15 6:34 p.m., Eeli Kaikkonen wrote:




On Sun, Feb 16, 2020 at 1:20 AM Brian Piccioni 
mailto:br...@documenteddesigns.com>> wrote:


I think optionally removing the path might be a good idea - or,
simply removing it from duplicated/pasted footprints. Of course I
am probably missing something.

Brian

You can't backannotate something which doesn't have the "path". But 
those footprints can of course be re-annotated.


I don't think it's possible to cleanly copypaste groups of footprints 
to create "duplicated design elements" as you say. Either they point 
to one group of symbols while they should point to hierarchical sheet 
instances (each of which have different path), or they don't have 
corresponding symbols at all.


If you have two footprints with identical "paths" you can reannotate 
from eeshcema (with a warning IIRC) and both footprints will have the 
same refdes. But it doesn't make sense to have two footprints with 
different refdes to point to one symbol because the symbol has only 
one refdes.


Having identical paths in more than one footprints is problematic 
anyways. I have used it but I don't recommend it.


Eeli Kaikkonen
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] What does /path do in PCBNew files?

2020-02-15 Thread Jeff Young
Pasting creates new timestamps.  So copy/paste works fine, there’s just no way 
to do a unified copy/paste between eeschema *and* pcbnew.

The timestamps are moving to UUIDs as we speak.

The links are reset/updated when you do an Update PCB from Schematic and chose 
the “re-associate by reference” option.  (The timestamps/UUIDs encode said 
“association”.)

Cheers,
Jeff.


> On 15 Feb 2020, at 23:40, Brian Piccioni  wrote:
> 
> I guess I'd wonder then why provide Copy and Paste/Duplicate if the result is 
> not usable?
> 
> It seems like a sort of honey pot.
> 
> On 2020-02-15 6:34 p.m., Eeli Kaikkonen wrote:
>> 
>> 
>> 
>> On Sun, Feb 16, 2020 at 1:20 AM Brian Piccioni > > wrote:
>> I think optionally removing the path might be a good idea - or, simply 
>> removing it from duplicated/pasted footprints. Of course I am probably 
>> missing something.
>> 
>> Brian
>> 
>> You can't backannotate something which doesn't have the "path". But those 
>> footprints can of course be re-annotated.
>> 
>> I don't think it's possible to cleanly copypaste groups of footprints to 
>> create "duplicated design elements" as you say. Either they point to one 
>> group of symbols while they should point to hierarchical sheet instances 
>> (each of which have different path), or they don't have corresponding 
>> symbols at all.
>> 
>> If you have two footprints with identical "paths" you can reannotate from 
>> eeshcema (with a warning IIRC) and both footprints will have the same 
>> refdes. But it doesn't make sense to have two footprints with different 
>> refdes to point to one symbol because the symbol has only one refdes.
>> 
>> Having identical paths in more than one footprints is problematic anyways. I 
>> have used it but I don't recommend it.
>> 
>> Eeli Kaikkonen
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] What does /path do in PCBNew files?

2020-02-15 Thread Brian Piccioni

I see.

So the approach to duplicating a section would be

1) Copy the design in eeschema
2) in eeSchema push to PCBNew
3) Layout a single section.
4) Copy and paste that section
5) Re-annotate the PCB section (this works now!) without pushing to 
schematic so the references correspond to the schematic

6) in eeSchema push to PCBNew associating by reference

Brian


On 2020-02-15 6:47 p.m., Jeff Young wrote:
Pasting creates new timestamps.  So copy/paste works fine, there’s 
just no way to do a unified copy/paste between eeschema *and* pcbnew.


The timestamps are moving to UUIDs as we speak.

The links are reset/updated when you do an Update PCB from Schematic 
and chose the “re-associate by reference” option.  (The 
timestamps/UUIDs encode said “association”.)


Cheers,
Jeff.


On 15 Feb 2020, at 23:40, Brian Piccioni > wrote:


I guess I'd wonder then why provide Copy and Paste/Duplicate if the 
result is not usable?


It seems like a sort of honey pot.

On 2020-02-15 6:34 p.m., Eeli Kaikkonen wrote:




On Sun, Feb 16, 2020 at 1:20 AM Brian Piccioni 
mailto:br...@documenteddesigns.com>> 
wrote:


I think optionally removing the path might be a good idea - or,
simply removing it from duplicated/pasted footprints. Of course
I am probably missing something.

Brian

You can't backannotate something which doesn't have the "path". But 
those footprints can of course be re-annotated.


I don't think it's possible to cleanly copypaste groups of 
footprints to create "duplicated design elements" as you say. Either 
they point to one group of symbols while they should point to 
hierarchical sheet instances (each of which have different path), or 
they don't have corresponding symbols at all.


If you have two footprints with identical "paths" you can reannotate 
from eeshcema (with a warning IIRC) and both footprints will have 
the same refdes. But it doesn't make sense to have two footprints 
with different refdes to point to one symbol because the symbol has 
only one refdes.


Having identical paths in more than one footprints is problematic 
anyways. I have used it but I don't recommend it.


Eeli Kaikkonen

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net 


Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] What does /path do in PCBNew files?

2020-02-15 Thread Brian Piccioni
I'd like a head's up when UUID is implemented as a lot of my code is 
based on timestamps as unique IDs.



On 2020-02-15 6:47 p.m., Jeff Young wrote:
Pasting creates new timestamps.  So copy/paste works fine, there’s 
just no way to do a unified copy/paste between eeschema *and* pcbnew.


The timestamps are moving to UUIDs as we speak.

The links are reset/updated when you do an Update PCB from Schematic 
and chose the “re-associate by reference” option.  (The 
timestamps/UUIDs encode said “association”.)


Cheers,
Jeff.


On 15 Feb 2020, at 23:40, Brian Piccioni > wrote:


I guess I'd wonder then why provide Copy and Paste/Duplicate if the 
result is not usable?


It seems like a sort of honey pot.

On 2020-02-15 6:34 p.m., Eeli Kaikkonen wrote:




On Sun, Feb 16, 2020 at 1:20 AM Brian Piccioni 
mailto:br...@documenteddesigns.com>> 
wrote:


I think optionally removing the path might be a good idea - or,
simply removing it from duplicated/pasted footprints. Of course
I am probably missing something.

Brian

You can't backannotate something which doesn't have the "path". But 
those footprints can of course be re-annotated.


I don't think it's possible to cleanly copypaste groups of 
footprints to create "duplicated design elements" as you say. Either 
they point to one group of symbols while they should point to 
hierarchical sheet instances (each of which have different path), or 
they don't have corresponding symbols at all.


If you have two footprints with identical "paths" you can reannotate 
from eeshcema (with a warning IIRC) and both footprints will have 
the same refdes. But it doesn't make sense to have two footprints 
with different refdes to point to one symbol because the symbol has 
only one refdes.


Having identical paths in more than one footprints is problematic 
anyways. I have used it but I don't recommend it.


Eeli Kaikkonen

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net 


Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] What does /path do in PCBNew files?

2020-02-15 Thread Wayne Stambaugh
On 2/15/20 6:40 PM, Brian Piccioni wrote:
> I guess I'd wonder then why provide Copy and Paste/Duplicate if the
> result is not usable?

We should be ensuring unique time stamps when pasting footprints to
ensure any back annotation to the schematic is not corrupt.
> 
> It seems like a sort of honey pot.
> 
> On 2020-02-15 6:34 p.m., Eeli Kaikkonen wrote:
>>
>>
>>
>> On Sun, Feb 16, 2020 at 1:20 AM Brian Piccioni
>> mailto:br...@documenteddesigns.com>> wrote:
>>
>> I think optionally removing the path might be a good idea - or,
>> simply removing it from duplicated/pasted footprints. Of course I
>> am probably missing something.
>>
>> Brian
>>
>> You can't backannotate something which doesn't have the "path". But
>> those footprints can of course be re-annotated.
>>
>> I don't think it's possible to cleanly copypaste groups of footprints
>> to create "duplicated design elements" as you say. Either they point
>> to one group of symbols while they should point to hierarchical sheet
>> instances (each of which have different path), or they don't have
>> corresponding symbols at all.
>>
>> If you have two footprints with identical "paths" you can reannotate
>> from eeshcema (with a warning IIRC) and both footprints will have the
>> same refdes. But it doesn't make sense to have two footprints with
>> different refdes to point to one symbol because the symbol has only
>> one refdes.
>>
>> Having identical paths in more than one footprints is problematic
>> anyways. I have used it but I don't recommend it.
>>
>> Eeli Kaikkonen
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] What does /path do in PCBNew files?

2020-02-15 Thread Eeli Kaikkonen
On Sun, Feb 16, 2020 at 1:47 AM Jeff Young  wrote:

> Pasting creates new timestamps.  So copy/paste works fine, there’s just no
> way to do a unified copy/paste between eeschema *and* pcbnew.
>

Yes, copy/paste in pcbnew works, there's no bug there. But the question is:
is it really useful that the "path" is copied, too.

As you said, if the user wants to keep the schematic and the layout in sync
after copying a footprint, they must:
1. reannotate the footprints
2. add symbols to the schematic
3. reannotate the symbols
4. and reassociate by reference.

That would work as well if the copies of the footprints wouldn't have
"path" at all, i.e. if they were like newly added footprints.

What do users except whey they copy and paste footprints? Do they expect
them to be tied to the same symbol as the original footprint, or do they
except them to be like newly added footprints? I would say the latter is
more natural expectation. I have falled into that trap myself. I thought
that copypasting a footprint is a handy way add a new footprint to the
board without going through the "Add new footprint" function. Then I
changed the refdes on the board. At some point I noticed that somehow the
refdes was changed back. Only later I realized that now there were two
footprints tied to the same symbol and normal updating PCB from schematic
changed the refdes back.

Eeli Kaikkonen
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp