fab positions compatible kv5,kv6,kv7

This commit is contained in:
U-CAD\userC
2023-03-03 09:45:46 +01:00
parent 94ae19a5f1
commit 15c0c97518

View File

@ -13,7 +13,7 @@
#pcbnew.GetWizardsBackTrace() #pcbnew.GetWizardsBackTrace()
___version___="1.2.9" ___version___="1.3.0"
#wx.LogMessage("My message") #wx.LogMessage("My message")
#mm_ius = 1000000.0 #mm_ius = 1000000.0
@ -29,6 +29,19 @@ from wx.lib.embeddedimage import PyEmbeddedImage
execfile ("C:/kicad-wb-1602/msys64/home/userC/out3Dm/pack-x86_64/share/kicad/scripting/plugins/getpos.py") execfile ("C:/kicad-wb-1602/msys64/home/userC/out3Dm/pack-x86_64/share/kicad/scripting/plugins/getpos.py")
""" """
# Make positions compatible with KiCAD 7.0
if hasattr(pcbnew, 'EDA_RECT'): # kv5,kv6
pass
else: # kv7
wxPoint = VECTOR2I
def getOrientation(fp):
o = fp.GetOrientation()
if hasattr(pcbnew, 'EDA_RECT'): # kv5,kv6
return o / 10
else: # kv7
return o.AsDegrees()
def find_pcbnew_w(): def find_pcbnew_w():
windows = wx.GetTopLevelWindows() windows = wx.GetTopLevelWindows()
pcbneww = [w for w in windows if "pcbnew" in w.GetTitle().lower()] pcbneww = [w for w in windows if "pcbnew" in w.GetTitle().lower()]
@ -183,7 +196,7 @@ def generate_POS(dir):
PIN1_YPOS="{0:<11}".format(PIN1_YPOS) PIN1_YPOS="{0:<11}".format(PIN1_YPOS)
break break
Rotation='{0:.1f}'.format((module.GetOrientation()/10)) Rotation='{0:.1f}'.format((getOrientation(module)/10))
Rotation="{0:>6}".format(Rotation)+' ' Rotation="{0:>6}".format(Rotation)+' '
if module.GetLayer() == 0: if module.GetLayer() == 0:
Layer=" top" Layer=" top"