Merge pull request #16 from Bouni/fix-#15
Add support for KiCAD 6.99 (VECTOR2I / wxPoint + GetOrientation().AsDegrees())
This commit is contained in:
@ -18,6 +18,17 @@ import datetime
|
|||||||
import wx
|
import wx
|
||||||
from pcbnew import *
|
from pcbnew import *
|
||||||
|
|
||||||
|
# Make snap2grid compatible with KiCAD 6.99
|
||||||
|
if "6.99" in GetBuildVersion():
|
||||||
|
wxPoint = VECTOR2I
|
||||||
|
|
||||||
|
def getOrientation(fp):
|
||||||
|
o = fp.GetOrientation()
|
||||||
|
if "6.99" in GetBuildVersion():
|
||||||
|
return o.AsDegrees()
|
||||||
|
return o / 10
|
||||||
|
|
||||||
|
|
||||||
use_grid_origin = True
|
use_grid_origin = True
|
||||||
|
|
||||||
gridReference = 0.1 #1.27 #mm pcbnew.FromMM(1.0) #0.1mm
|
gridReference = 0.1 #1.27 #mm pcbnew.FromMM(1.0) #0.1mm
|
||||||
@ -209,7 +220,7 @@ def snap2grid(gridSizeMM,use_grid):
|
|||||||
Value = str(module.GetValue())
|
Value = str(module.GetValue())
|
||||||
Value=(Value[:17] + '..') if len(Value) > 19 else Value
|
Value=(Value[:17] + '..') if len(Value) > 19 else Value
|
||||||
Value="{0:<20}".format(Value)
|
Value="{0:<20}".format(Value)
|
||||||
Rotation='{0:.1f}'.format((module.GetOrientation()/10))
|
Rotation='{0:.1f}'.format(getOrientation(module))
|
||||||
Rotation="{0:>6}".format(Rotation)+' '
|
Rotation="{0:>6}".format(Rotation)+' '
|
||||||
if module.GetLayer() == 0:
|
if module.GetLayer() == 0:
|
||||||
Layer=" top"
|
Layer=" top"
|
||||||
|
@ -13,6 +13,18 @@ import datetime
|
|||||||
import wx
|
import wx
|
||||||
from pcbnew import *
|
from pcbnew import *
|
||||||
|
|
||||||
|
|
||||||
|
# Make snap2grid compatible with KiCAD 6.99
|
||||||
|
if "6.99" in GetBuildVersion():
|
||||||
|
wxPoint = VECTOR2I
|
||||||
|
|
||||||
|
def getOrientation(fp):
|
||||||
|
o = fp.GetOrientation()
|
||||||
|
if "6.99" in GetBuildVersion():
|
||||||
|
return o.AsDegrees()
|
||||||
|
return o / 10
|
||||||
|
|
||||||
|
|
||||||
use_grid_origin = True
|
use_grid_origin = True
|
||||||
gridReference = 0.127 #1.27 #mm pcbnew.FromMM(1.0) #0.1mm
|
gridReference = 0.127 #1.27 #mm pcbnew.FromMM(1.0) #0.1mm
|
||||||
|
|
||||||
@ -70,7 +82,7 @@ def Snap2Grid(gridSizeMM,use_grid_origin):
|
|||||||
Value = str(module.GetValue())
|
Value = str(module.GetValue())
|
||||||
Value=(Value[:17] + '..') if len(Value) > 19 else Value
|
Value=(Value[:17] + '..') if len(Value) > 19 else Value
|
||||||
Value="{0:<20}".format(Value)
|
Value="{0:<20}".format(Value)
|
||||||
Rotation='{0:.1f}'.format((module.GetOrientation()/10))
|
Rotation='{0:.1f}'.format(getOrientation(module))
|
||||||
Rotation="{0:>6}".format(Rotation)+' '
|
Rotation="{0:>6}".format(Rotation)+' '
|
||||||
if module.GetLayer() == 0:
|
if module.GetLayer() == 0:
|
||||||
Layer=" top"
|
Layer=" top"
|
||||||
|
Reference in New Issue
Block a user