← Back to team overview

kicad-developers team mailing list archive

Re: Rename proposal

 

On Wed, Sep 10, 2014 at 02:20:48PM +0100, Brian Sidebotham wrote:
> I think the rename should be done, but I think we should probably end up with:
> 
>     IgnoreMTextsOnF_Cu
>     IgnoreMTextsOnB_Cu
> 
> because the constants F_Cu and B_Cu are compared when looking for the
> layer generally in the same test. For example in collectors.cpp:296
> and collectors.cpp:299:

BE CAREFUL. On module objects the layer can only be F_Cu and B_Cu, indicating
that the module is mounted on the front or the back side. It doesn't
mean "Module texts on Front Copper", it means "Texts on modules mountend
on the front side". It's a silly overload of the layer slot, but it's
historic now :D in reality the module IS-NOT-A BOARD_ITEM in the strict
sense (since it's more like a container), but that's how it's modelled
at the moment.

Also, at the moment module texts simply can't be on F_Cu (and probably
neither tomorrow) but only on F_SilkS (and B_SilkS, but only after
flipping the whole module). So, ATM when a module has layer F_Cu it's
texts are always on F_SilkS; in the same way a module on B_Cu has texts
always on B_Silks. This is *not* ensured as invariant or other; it's
simply that the editor at the moment creates text only on F_SilkS and
the flip code obviously only flip both of them.

Even today you could simply hand edit the file to put the text on
another layer and *almost everything* would work correctly (from what
I've seen till now)

>     if( m_Guide->IgnoreMTextsOnCopper() && module->GetLayer()==B_Cu )
> 
>     if( m_Guide->IgnoreMTextsOnCmp() && module->GetLayer()==F_Cu )
> 
> Secondly, I think the above tests in the collector should remain true.
> If the PCB item is text and it belongs to a module that is placed on

Careful #2: PCB text items are quite different from module text items (a
whole another class) since they live directly on the board.
However module text IS-A board item (probably because it was easier to
handle) so you are saying a correct thing anyway.

> the F_Cu layer we should ignore it if the IgnoreMTextsOnCmp() function
> returns true.

My opinion is the same. The condition would change from
module->GetLayer()==B_Cu to IsBackLayer(textitem->GetLayer()) or
something similar (to handle modules with text on their back). However
I'll need to inspect actual usage of these predicate to verify that's
the intended behaviour.

> These functions are actually only used when collecting (enumerating)
> pads anyway and is used to disregard all module text items. So the
> functionality will break that tool if we change it's meaning to not
> ignore all module texts.

It used only for that? Easy to check then :D

-- 
Lorenzo Marcantonio
Logos Srl


Follow ups

References