Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
068d0636
Commit
068d0636
authored
Mar 30, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename "skein" variables and commands to "slice"
parent
959fb1a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
26 deletions
+26
-26
pronsole.py
printrun/pronsole.py
+6
-6
pronterface.py
printrun/pronterface.py
+20
-20
No files found.
printrun/pronsole.py
View file @
068d0636
...
@@ -1128,7 +1128,7 @@ class pronsole(cmd.Cmd):
...
@@ -1128,7 +1128,7 @@ class pronsole(cmd.Cmd):
def
help_load
(
self
):
def
help_load
(
self
):
self
.
log
(
"Loads a gcode file (with tab-completion)"
)
self
.
log
(
"Loads a gcode file (with tab-completion)"
)
def
do_s
kein
(
self
,
l
):
def
do_s
lice
(
self
,
l
):
l
=
l
.
split
()
l
=
l
.
split
()
if
len
(
l
)
==
0
:
if
len
(
l
)
==
0
:
self
.
logError
(
_
(
"No file name given."
))
self
.
logError
(
_
(
"No file name given."
))
...
@@ -1160,7 +1160,7 @@ class pronsole(cmd.Cmd):
...
@@ -1160,7 +1160,7 @@ class pronsole(cmd.Cmd):
except
Exception
,
e
:
except
Exception
,
e
:
self
.
logError
(
_
(
"Slicing failed:
%
s"
)
%
e
)
self
.
logError
(
_
(
"Slicing failed:
%
s"
)
%
e
)
def
complete_s
kein
(
self
,
text
,
line
,
begidx
,
endidx
):
def
complete_s
lice
(
self
,
text
,
line
,
begidx
,
endidx
):
s
=
line
.
split
()
s
=
line
.
split
()
if
len
(
s
)
>
2
:
if
len
(
s
)
>
2
:
return
[]
return
[]
...
@@ -1170,11 +1170,11 @@ class pronsole(cmd.Cmd):
...
@@ -1170,11 +1170,11 @@ class pronsole(cmd.Cmd):
else
:
else
:
return
glob
.
glob
(
"*/"
)
+
glob
.
glob
(
"*.stl"
)
return
glob
.
glob
(
"*/"
)
+
glob
.
glob
(
"*.stl"
)
def
help_s
kein
(
self
):
def
help_s
lice
(
self
):
self
.
log
(
_
(
"Creates a gcode file from an stl model using the slicer (with tab-completion)"
))
self
.
log
(
_
(
"Creates a gcode file from an stl model using the slicer (with tab-completion)"
))
self
.
log
(
_
(
"s
kein
filename.stl - create gcode file"
))
self
.
log
(
_
(
"s
lice
filename.stl - create gcode file"
))
self
.
log
(
_
(
"s
kein filename.stl view - create gcode file and view using skeiniso
"
))
self
.
log
(
_
(
"s
lice filename.stl view - create gcode file and view using skeiniso (if using skeinforge)
"
))
self
.
log
(
_
(
"s
kein
set - adjust slicer settings"
))
self
.
log
(
_
(
"s
lice
set - adjust slicer settings"
))
## --------------------------------------------------------------
## --------------------------------------------------------------
## Print/upload handling
## Print/upload handling
...
...
printrun/pronterface.py
View file @
068d0636
...
@@ -139,7 +139,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -139,7 +139,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self
.
m105_waitcycles
=
0
self
.
m105_waitcycles
=
0
self
.
fgcode
=
None
self
.
fgcode
=
None
self
.
excluder
=
None
self
.
excluder
=
None
self
.
s
kein
p
=
None
self
.
s
lice
p
=
None
self
.
monitor_interval
=
3
self
.
monitor_interval
=
3
self
.
current_pos
=
[
0
,
0
,
0
]
self
.
current_pos
=
[
0
,
0
,
0
]
self
.
paused
=
False
self
.
paused
=
False
...
@@ -210,7 +210,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -210,7 +210,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self
.
t
=
Tee
(
self
.
catchprint
)
self
.
t
=
Tee
(
self
.
catchprint
)
self
.
stdout
=
sys
.
stdout
self
.
stdout
=
sys
.
stdout
self
.
s
kein
ing
=
0
self
.
s
lic
ing
=
0
self
.
mini
=
False
self
.
mini
=
False
self
.
p
.
sendcb
=
self
.
sentcb
self
.
p
.
sendcb
=
self
.
sentcb
self
.
p
.
preprintsendcb
=
self
.
preprintsendcb
self
.
p
.
preprintsendcb
=
self
.
preprintsendcb
...
@@ -703,7 +703,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -703,7 +703,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self
.
Bind
(
wx
.
EVT_MENU
,
self
.
new_macro
,
self
.
macros_menu
.
Append
(
-
1
,
_
(
"<&New...>"
)))
self
.
Bind
(
wx
.
EVT_MENU
,
self
.
new_macro
,
self
.
macros_menu
.
Append
(
-
1
,
_
(
"<&New...>"
)))
self
.
Bind
(
wx
.
EVT_MENU
,
lambda
*
e
:
PronterOptions
(
self
),
m
.
Append
(
-
1
,
_
(
"&Options"
),
_
(
" Options dialog"
)))
self
.
Bind
(
wx
.
EVT_MENU
,
lambda
*
e
:
PronterOptions
(
self
),
m
.
Append
(
-
1
,
_
(
"&Options"
),
_
(
" Options dialog"
)))
self
.
Bind
(
wx
.
EVT_MENU
,
lambda
x
:
threading
.
Thread
(
target
=
lambda
:
self
.
do_s
kein
(
"set"
))
.
start
(),
m
.
Append
(
-
1
,
_
(
"Slicing settings"
),
_
(
" Adjust slicing settings"
)))
self
.
Bind
(
wx
.
EVT_MENU
,
lambda
x
:
threading
.
Thread
(
target
=
lambda
:
self
.
do_s
lice
(
"set"
))
.
start
(),
m
.
Append
(
-
1
,
_
(
"Slicing settings"
),
_
(
" Adjust slicing settings"
)))
mItem
=
m
.
AppendCheckItem
(
-
1
,
_
(
"Debug communications"
),
mItem
=
m
.
AppendCheckItem
(
-
1
,
_
(
"Debug communications"
),
_
(
"Print all G-code sent to and received from the printer."
))
_
(
"Print all G-code sent to and received from the printer."
))
...
@@ -1215,7 +1215,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1215,7 +1215,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
filename
=
filename
.
replace
(
ext
.
upper
(),
suffix
)
filename
=
filename
.
replace
(
ext
.
upper
(),
suffix
)
return
filename
return
filename
def
s
kein
_func
(
self
):
def
s
lice
_func
(
self
):
try
:
try
:
output_filename
=
self
.
model_to_gcode_filename
(
self
.
filename
)
output_filename
=
self
.
model_to_gcode_filename
(
self
.
filename
)
pararray
=
prepare_command
(
self
.
settings
.
slicecommand
,
pararray
=
prepare_command
(
self
.
settings
.
slicecommand
,
...
@@ -1226,19 +1226,19 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1226,19 +1226,19 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
fpath
=
os
.
path
.
join
(
self
.
slic3r_configpath
,
cat
,
config
)
fpath
=
os
.
path
.
join
(
self
.
slic3r_configpath
,
cat
,
config
)
pararray
+=
[
"--load"
,
fpath
]
pararray
+=
[
"--load"
,
fpath
]
print
_
(
"Slicing "
)
+
" "
.
join
(
pararray
)
print
_
(
"Slicing "
)
+
" "
.
join
(
pararray
)
self
.
s
kein
p
=
subprocess
.
Popen
(
pararray
,
stderr
=
subprocess
.
STDOUT
,
stdout
=
subprocess
.
PIPE
)
self
.
s
lice
p
=
subprocess
.
Popen
(
pararray
,
stderr
=
subprocess
.
STDOUT
,
stdout
=
subprocess
.
PIPE
)
while
True
:
while
True
:
o
=
self
.
s
kein
p
.
stdout
.
read
(
1
)
o
=
self
.
s
lice
p
.
stdout
.
read
(
1
)
if
o
==
''
and
self
.
s
kein
p
.
poll
()
is
not
None
:
break
if
o
==
''
and
self
.
s
lice
p
.
poll
()
is
not
None
:
break
sys
.
stdout
.
write
(
o
)
sys
.
stdout
.
write
(
o
)
self
.
s
kein
p
.
wait
()
self
.
s
lice
p
.
wait
()
self
.
stopsf
=
1
self
.
stopsf
=
1
except
:
except
:
logging
.
error
(
_
(
"Failed to execute slicing software: "
))
logging
.
error
(
_
(
"Failed to execute slicing software: "
))
self
.
stopsf
=
1
self
.
stopsf
=
1
traceback
.
print_exc
(
file
=
sys
.
stdout
)
traceback
.
print_exc
(
file
=
sys
.
stdout
)
def
s
kein
_monitor
(
self
):
def
s
lice
_monitor
(
self
):
while
not
self
.
stopsf
:
while
not
self
.
stopsf
:
try
:
try
:
wx
.
CallAfter
(
self
.
statusbar
.
SetStatusText
,
_
(
"Slicing..."
))
# +self.cout.getvalue().split("\n")[-1])
wx
.
CallAfter
(
self
.
statusbar
.
SetStatusText
,
_
(
"Slicing..."
))
# +self.cout.getvalue().split("\n")[-1])
...
@@ -1250,19 +1250,19 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1250,19 +1250,19 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self
.
load_gcode_async
(
self
.
model_to_gcode_filename
(
self
.
filename
))
self
.
load_gcode_async
(
self
.
model_to_gcode_filename
(
self
.
filename
))
except
:
except
:
self
.
filename
=
fn
self
.
filename
=
fn
self
.
s
kein
ing
=
0
self
.
s
lic
ing
=
0
self
.
s
kein
p
=
None
self
.
s
lice
p
=
None
def
s
kein
(
self
,
filename
):
def
s
lice
(
self
,
filename
):
wx
.
CallAfter
(
self
.
loadbtn
.
SetLabel
,
_
(
"Cancel"
))
wx
.
CallAfter
(
self
.
loadbtn
.
SetLabel
,
_
(
"Cancel"
))
wx
.
CallAfter
(
self
.
toolbarsizer
.
Layout
)
wx
.
CallAfter
(
self
.
toolbarsizer
.
Layout
)
print
_
(
"Slicing "
)
+
filename
print
_
(
"Slicing "
)
+
filename
self
.
cout
=
StringIO
.
StringIO
()
self
.
cout
=
StringIO
.
StringIO
()
self
.
filename
=
filename
self
.
filename
=
filename
self
.
stopsf
=
0
self
.
stopsf
=
0
self
.
s
kein
ing
=
1
self
.
s
lic
ing
=
1
threading
.
Thread
(
target
=
self
.
s
kein
_func
)
.
start
()
threading
.
Thread
(
target
=
self
.
s
lice
_func
)
.
start
()
threading
.
Thread
(
target
=
self
.
s
kein
_monitor
)
.
start
()
threading
.
Thread
(
target
=
self
.
s
lice
_monitor
)
.
start
()
def
cmdline_filename_callback
(
self
,
filename
):
def
cmdline_filename_callback
(
self
,
filename
):
# Do nothing when processing a filename from command line, as we'll
# Do nothing when processing a filename from command line, as we'll
...
@@ -1270,7 +1270,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1270,7 +1270,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self
.
filename
=
filename
self
.
filename
=
filename
def
do_load
(
self
,
l
):
def
do_load
(
self
,
l
):
if
hasattr
(
self
,
's
kein
ing'
):
if
hasattr
(
self
,
's
lic
ing'
):
self
.
loadfile
(
None
,
l
)
self
.
loadfile
(
None
,
l
)
else
:
else
:
self
.
_do_load
(
l
)
self
.
_do_load
(
l
)
...
@@ -1281,8 +1281,8 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1281,8 +1281,8 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self
.
loadfile
(
None
,
filename
=
path
)
self
.
loadfile
(
None
,
filename
=
path
)
def
loadfile
(
self
,
event
,
filename
=
None
):
def
loadfile
(
self
,
event
,
filename
=
None
):
if
self
.
s
keining
and
self
.
skein
p
is
not
None
:
if
self
.
s
licing
and
self
.
slice
p
is
not
None
:
self
.
s
kein
p
.
terminate
()
self
.
s
lice
p
.
terminate
()
return
return
basedir
=
self
.
settings
.
last_file_path
basedir
=
self
.
settings
.
last_file_path
if
not
os
.
path
.
exists
(
basedir
):
if
not
os
.
path
.
exists
(
basedir
):
...
@@ -1325,8 +1325,8 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1325,8 +1325,8 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self
.
logError
(
_
(
"Could not update recent files list:"
)
+
self
.
logError
(
_
(
"Could not update recent files list:"
)
+
"
\n
"
+
traceback
.
format_exc
())
"
\n
"
+
traceback
.
format_exc
())
if
name
.
lower
()
.
endswith
(
".stl"
)
or
name
.
lower
()
.
endswith
(
".obj"
):
if
name
.
lower
()
.
endswith
(
".stl"
)
or
name
.
lower
()
.
endswith
(
".obj"
):
self
.
s
kein
(
name
)
self
.
s
lice
(
name
)
self
.
s
kein
(
name
)
self
.
s
lice
(
name
)
else
:
else
:
self
.
load_gcode_async
(
name
)
self
.
load_gcode_async
(
name
)
else
:
else
:
...
...
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