Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
946ddbaa
Commit
946ddbaa
authored
Apr 08, 2012
by
Miguel Angel Ajo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix units.i and add some extra wrappers wxSizeMM, wxSizeMils wxRectMM wxRectMils
parent
be150579
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
createPcb.py
pcbnew/scripting/examples/createPcb.py
+2
-1
units.i
pcbnew/scripting/units.i
+22
-1
No files found.
pcbnew/scripting/examples/createPcb.py
View file @
946ddbaa
#!/usr/bin/env python2.7
import
pcbnew
from
pcbnew
import
*
size_0_6mm
=
wxSize
(
FromMM
(
0.6
),
FromMM
(
0.6
)
)
size_0_6mm
=
wxSize
MM
(
0.6
,
0.6
)
# create a blank board
...
...
pcbnew/scripting/units.i
View file @
946ddbaa
...
...
@@ -50,9 +50,30 @@
elif type(iu) in [wxPoint,wxSize]:
return tuple(map(ToMils,iu))
def FromMils(
mils
):
def FromMils(
iu
):
if type(iu) in [int,float]:
return mils*10.0
elif type(iu) in [wxPoint,wxSize]:
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)
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment