Python interface: add methods to add or remove layers to/from a layer set. Usefull to modify the layer set of pads
Very minor other fixes.
This commit is contained in:
parent
bedf0b6aec
commit
cf09129387
|
@ -110,8 +110,6 @@ LSET D_PAD::ConnSMDMask()
|
|||
|
||||
LSET D_PAD::UnplatedHoleMask()
|
||||
{
|
||||
// was #define PAD_ATTRIB_HOLE_NOT_PLATED_DEFAULT_LAYERS ALL_CU_LAYERS |
|
||||
// SILKSCREEN_LAYER_FRONT | SOLDERMASK_LAYER_BACK | SOLDERMASK_LAYER_FRONT
|
||||
static LSET saved = LSET::AllCuMask() | LSET( 3, F_SilkS, B_Mask, F_Mask );
|
||||
return saved;
|
||||
}
|
||||
|
|
|
@ -5,3 +5,6 @@ A PCAD ASCII sample file can be downloaded from http://www.pcadbegin.webtm.ru
|
|||
(Provided by its author Andrey Manin <pcadbegin[at]rambler.ru>)
|
||||
|
||||
http://www.pcadbegin.webtm.ru/schetchik.php?scach=1 (CK1202_V1.pcb)
|
||||
|
||||
Other sample:
|
||||
http://www.firstpr.com.au/temp/kicad-bugs/P-CAD-conversion/S1000MA-1992-09-08-via-Altium-P-CAD-ASCII.pcb
|
||||
|
|
|
@ -167,4 +167,28 @@
|
|||
%include "plugins.i"
|
||||
%include "units.i"
|
||||
|
||||
// Extend LSET by 2 methods to add or remove layers from the layer list
|
||||
// Mainly used to add or remove layers of a pad layer list
|
||||
%extend LSET
|
||||
{
|
||||
LSET addLayer( LAYER_ID aLayer) { return self->set(aLayer); }
|
||||
LSET removeLayer( LAYER_ID aLayer) { return self->reset(aLayer); }
|
||||
LSET addLayerSet( LSET aLayerSet) { return *self |= aLayerSet; }
|
||||
LSET removeLayerSet( LSET aLayerSet) { return *self &= ~aLayerSet; }
|
||||
|
||||
%pythoncode
|
||||
%{
|
||||
def AddLayer(self, layer):
|
||||
return self.addLayer( layer )
|
||||
|
||||
def AddLayerSet(self, layers):
|
||||
return self.addLayerSet( layers )
|
||||
|
||||
def RemoveLayer(self, layer):
|
||||
return self.removeLayer( layer )
|
||||
|
||||
def RemoveLayerSet(self, layers):
|
||||
return self.removeLayerSet( layers )
|
||||
%}
|
||||
}
|
||||
|
||||
|
|
|
@ -168,6 +168,12 @@ class PadGridArray(PadArray):
|
|||
pad.SetPadName(self.GetName(x,y))
|
||||
self.AddPad(pad)
|
||||
|
||||
class EPADGridArray(PadGridArray):
|
||||
|
||||
def NamingFunction(self, nx, ny):
|
||||
return self.firstPadNum
|
||||
|
||||
|
||||
|
||||
class PadZGridArray(PadArray):
|
||||
|
||||
|
|
Loading…
Reference in New Issue