Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pcbdrill
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
pcbdrill
Commits
cb5cda3b
Commit
cb5cda3b
authored
Jul 18, 2014
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First push
parent
88d42775
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
622 additions
and
0 deletions
+622
-0
excellon.py
excellon.py
+59
-0
pcbdrill.py
pcbdrill.py
+563
-0
No files found.
excellon.py
0 → 100644
View file @
cb5cda3b
import
Tkinter
as
tk
class
Excellon
(
file
):
def
__init__
(
self
,
file
):
self
.
header
=
[]
self
.
drills
=
{}
row_index
=
0
while
row_index
<
len
(
file
):
if
file
[
row_index
]
.
startswith
(
'M48'
):
row_index
+=
1
while
not
file
[
row_index
]
.
startswith
(
'
%
'
):
self
.
header
.
append
(
file
[
row_index
]
.
replace
(
'
\n
'
,
''
))
row_index
+=
1
if
file
[
row_index
]
.
startswith
(
'T'
):
toolNumber
=
file
[
row_index
]
.
replace
(
'
\n
'
,
''
)
.
replace
(
'
\r
'
,
''
)
self
.
drills
[
toolNumber
]
=
[]
row_index
+=
1
while
row_index
<
len
(
file
)
and
not
file
[
row_index
]
.
startswith
(
'T'
)
and
not
file
[
row_index
]
.
startswith
(
'M30'
):
self
.
drills
[
toolNumber
]
.
append
(
file
[
row_index
]
.
replace
(
'
\n
'
,
''
)
.
replace
(
'
\r
'
,
''
))
row_index
+=
1
else
:
row_index
+=
1
class
GcodeISO
:
def
__init__
(
self
,
excellonFile
,
parameters
):
self
.
units
,
self
.
zSafe
,
self
.
zDepth
,
self
.
inCutFeed
=
parameters
self
.
header
=
[
'G17 G40 G54 G64 G90 '
]
if
self
.
units
.
get
()
==
'mm'
:
self
.
header
.
append
(
'G21
\n
'
)
elif
self
.
units
.
get
()
==
'inch'
:
self
.
header
.
append
(
'G20
\n
'
)
else
:
self
.
header
.
append
(
'
\n
'
)
self
.
body
=
[]
for
tool
in
excellonFile
.
drills
:
self
.
body
.
append
(
tool
+
' M6
\n
'
)
self
.
body
.
append
(
'G0 Z'
+
str
(
self
.
zSafe
)
+
'
\n
'
)
for
hole
in
excellonFile
.
drills
[
tool
]:
self
.
body
.
append
(
'G98 G81 '
+
hole
.
replace
(
'Y'
,
' Y'
)
+
' Z-'
+
str
(
self
.
zDepth
)
+
' R'
+
str
(
self
.
zSafe
)
+
' F'
+
str
(
self
.
inCutFeed
)
+
'
\n
'
)
self
.
body
.
append
(
'G80
\n
'
)
self
.
body
.
append
(
'M30
\n
'
)
def
toText
(
self
):
return
self
.
header
+
self
.
body
def
excellonToGcode
(
file
,
parameters
):
with
open
(
file
,
'r'
)
as
f
:
file
=
f
.
readlines
()
excellonFile
=
Excellon
(
file
)
gcodeFile
=
GcodeISO
(
excellonFile
,
parameters
)
return
gcodeFile
.
toText
()
pcbdrill.py
0 → 100644
View file @
cb5cda3b
This diff is collapsed.
Click to expand it.
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