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
8a196812
Commit
8a196812
authored
Mar 27, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factorize post gcode load actions
parent
f4b22c47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
pronterface.py
printrun/pronterface.py
+10
-3
No files found.
printrun/pronterface.py
View file @
8a196812
...
...
@@ -1676,7 +1676,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
wx
.
CallAfter
(
self
.
pausebtn
.
Disable
)
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
_
(
"Print"
))
threading
.
Thread
(
target
=
self
.
loadviz
)
.
start
()
self
.
post_gcode_load
()
except
:
self
.
filename
=
fn
wx
.
CallAfter
(
self
.
loadbtn
.
SetLabel
,
_
(
"Load File"
))
...
...
@@ -1768,11 +1768,15 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
wx
.
CallAfter
(
self
.
recoverbtn
.
Disable
)
if
self
.
p
.
online
:
wx
.
CallAfter
(
self
.
printbtn
.
Enable
)
threading
.
Thread
(
target
=
self
.
loadviz
)
.
start
()
self
.
post_gcode_load
()
else
:
dlg
.
Destroy
()
def
loadviz
(
self
):
def
post_gcode_load
(
self
):
self
.
output_gcode_stats
()
threading
.
Thread
(
target
=
self
.
loadviz
)
.
start
()
def
output_gcode_stats
(
self
):
gcode
=
self
.
fgcode
print
gcode
.
filament_length
,
_
(
"mm of filament used in this print"
)
print
_
(
"The print goes:"
)
...
...
@@ -1780,6 +1784,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
print
_
(
"- from
%.2
f mm to
%.2
f mm in Y and is
%.2
f mm deep"
)
%
(
gcode
.
ymin
,
gcode
.
ymax
,
gcode
.
depth
)
print
_
(
"- from
%.2
f mm to
%.2
f mm in Z and is
%.2
f mm high"
)
%
(
gcode
.
zmin
,
gcode
.
zmax
,
gcode
.
height
)
print
_
(
"Estimated duration:
%
s"
)
%
gcode
.
estimate_duration
()
def
loadviz
(
self
):
gcode
=
self
.
fgcode
self
.
gviz
.
clear
()
self
.
gwindow
.
p
.
clear
()
self
.
gviz
.
addfile
(
gcode
,
True
)
...
...
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