← Back to team overview

kicad-developers team mailing list archive

About MODULE::GetLayer

 

In BOARD::GetFootprint there is this segment:

        /* Calculate priority: the priority is given to the layer of the
         * module and the copper layer if the module layer is indelible,
         * adhesive copper, a layer if cmp module layer is indelible,
         * adhesive component.
 
        layer = pt_module->GetLayer();

        if( layer==ADHESIVE_N_BACK || layer==SILKSCREEN_N_BACK )
            layer = LAYER_N_BACK;
        else if( layer==ADHESIVE_N_FRONT || layer==SILKSCREEN_N_FRONT )
            layer = LAYER_N_FRONT;


where pt_module is iterate over all the modules on the board.

How is it possible that a module layer would be different than LAYER_N_FRONT or LAYER_N_BACK?

If that was the case, the function MODULE::IsFlipped wouldn't be correct, since it only tests for LAYER_N_BACK

Maybe the intent was to do the check on the 'active' layer, something like: "if I am on the top silk or on top adhesive, match a module on the top layer" ?

As it's written I can't find a sense in this code block...

-- 
Lorenzo Marcantonio
Logos Srl