- Set created modules as virtual

- PEP8 syntax fixes
- Add __init__.py to use this extention in a directory
This commit is contained in:
Jean-Samuel Reynaud
2017-06-22 18:33:03 +02:00
parent 44c2f10520
commit 31626d6dcd
2 changed files with 10 additions and 4 deletions

View File

@ -61,6 +61,7 @@ FillArea.FillArea().SetDebug().SetNetname("GND").SetStepMM(1.27).SetSizeMM(0.6).
class FillArea:
"""
Automaticaly add via on area where there are no track/existing via,
pads and keepout areas
@ -197,6 +198,7 @@ class FillArea:
m.SetReference("V%s_%s" % (x, y))
m.SetValue("AUTO_VIA")
m.SetLastEditTime()
m.SetAttributes(MOD_VIRTUAL)
m.thisown = 0
self.pcb.AddNative(m, ADD_APPEND)
m.SetFlag(IS_NEW)
@ -263,7 +265,6 @@ class FillArea:
for x in range(rectangle.__len__()):
testResult = not keepOutMode # = False if is Keepout
offset = self.clearance + self.size / 2
#offset = int(self.inter / 2)
# For keepout area: Deny Via
# For same net area: Allow if not denied by keepout
current_x = origin.x + (x * self.step)
@ -406,7 +407,8 @@ class FillArea:
(self.step / 4.0)
ran_y = (random.random() * self.step / 2.0) - \
(self.step / 4.0)
self.AddModule(module, wxPoint(origin.x + (self.step * x) + ran_x,
self.AddModule(
module, wxPoint(origin.x + (self.step * x) + ran_x,
origin.y + (self.step * y) + ran_y), x, y)
self.RefillBoardAreas()

4
ViaStitching/__init__.py Normal file
View File

@ -0,0 +1,4 @@
# Two way of installation of this plugin:
# - Copy or link this directory to KiCad plugin directory (~/.kicad_plugin/ViaStitching/)
# - Copy files to ~/.kicad_plugin except __init__.py...
from FillAreaAction import *