← Back to team overview

kicad-developers team mailing list archive

Re: Rename proposal

 

On 10 September 2014 14:56, Lorenzo Marcantonio
<l.marcantonio@xxxxxxxxxxxx> wrote:
> 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.

Yep, I understood all that before I proposed the names.

>> 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.

Hopefully here you mean IsBackLayer(module->GetLayer()) otherwise
you're breaking stuff. I don't really have an opinion about the test
for the front or back layer. I don't see any ambiguity in the == F_Cu
or == B_Cu test against the module's layer.

The collector must exclude ALL text in a module (forget about what
layer that text is on) when IgnoreMTextsOnCopper() returns true.

If you are getting confused between text layers and module layers then
you can further play around with the function name to something like

    IgnoreTextInModulesOnF_Cu()
    IgnoreTextInModulesOnB_Cu()

Which more accurately describes their meaning. But then I thought the
previous effort was pretty obvious too. :P

Along with this, we can also expand the doxygen text for these
functions to describe their meaning more verbosely such that we're all
aware of their intention.

>> 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

Yep, or at least that's what grep says!

Best Regards,

Brian.


Follow ups

References