Fix units.i and add some extra wrappers wxSizeMM, wxSizeMils wxRectMM wxRectMils
This commit is contained in:
parent
be15057977
commit
946ddbaa08
|
@ -1,7 +1,8 @@
|
||||||
#!/usr/bin/env python2.7
|
#!/usr/bin/env python2.7
|
||||||
|
import pcbnew
|
||||||
from pcbnew import *
|
from pcbnew import *
|
||||||
|
|
||||||
size_0_6mm = wxSize(FromMM(0.6),FromMM(0.6))
|
size_0_6mm = wxSizeMM(0.6,0.6)
|
||||||
|
|
||||||
|
|
||||||
# create a blank board
|
# create a blank board
|
||||||
|
|
|
@ -50,9 +50,30 @@
|
||||||
elif type(iu) in [wxPoint,wxSize]:
|
elif type(iu) in [wxPoint,wxSize]:
|
||||||
return tuple(map(ToMils,iu))
|
return tuple(map(ToMils,iu))
|
||||||
|
|
||||||
def FromMils(mils):
|
def FromMils(iu):
|
||||||
if type(iu) in [int,float]:
|
if type(iu) in [int,float]:
|
||||||
return mils*10.0
|
return mils*10.0
|
||||||
elif type(iu) in [wxPoint,wxSize]:
|
elif type(iu) in [wxPoint,wxSize]:
|
||||||
return tuple(map(FromMils,iu))
|
return tuple(map(FromMils,iu))
|
||||||
|
|
||||||
|
def wxSizeMM(mmx,mmy): return wxSize(FromMM(mmx),FromMM(mmy))
|
||||||
|
def wxSizeMils(mmx,mmy): return wxSize(FromMils(mmx),FromMils(mmy))
|
||||||
|
|
||||||
|
def wxPointMM(mmx,mmy): return wxPoint(FromMM(mmx),FromMM(mmy))
|
||||||
|
def wxPointMils(mmx,mmy): return wxPoint(FromMils(mmx),FromMils(mmy))
|
||||||
|
|
||||||
|
def wxRectMM(x,y,wx,wy):
|
||||||
|
x = int(FromMM(x))
|
||||||
|
y = int(FromMM(y))
|
||||||
|
wx = int(FromMM(wx))
|
||||||
|
wy = int (FromMM(wy))
|
||||||
|
return wxRect(x,y,wx,wy)
|
||||||
|
|
||||||
|
def wxRectMils(x,y,wx,wy):
|
||||||
|
x = int(FromMils(x))
|
||||||
|
y = int(FromMils(y))
|
||||||
|
wx = int(FromMils(wx))
|
||||||
|
wy = int (FromMils(wy))
|
||||||
|
return wxRect(x,y,wx,wy)
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue