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
5e20fcce
Commit
5e20fcce
authored
Mar 30, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sleep a little in layer_ready_cb at times to let UI refresh
parent
8dc45fa9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
pronterface.py
printrun/pronterface.py
+5
-0
No files found.
printrun/pronterface.py
View file @
5e20fcce
...
...
@@ -1335,6 +1335,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
gcode
=
self
.
pre_gcode_load
()
threading
.
Thread
(
target
=
self
.
load_gcode_async_thread
,
args
=
(
gcode
,))
.
start
()
# FIXME: this thread and the loadviz one are not tracked at all
def
load_gcode_async_thread
(
self
,
gcode
):
self
.
load_gcode
(
self
.
filename
,
layer_callback
=
self
.
layer_ready_cb
,
...
...
@@ -1343,12 +1344,16 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
def
layer_ready_cb
(
self
,
gcode
,
layer
):
self
.
viz_last_layer
=
layer
if
time
.
time
()
-
self
.
viz_last_yield
>
0.8
:
time
.
sleep
(
0.2
)
self
.
viz_last_yield
=
time
.
time
()
def
start_viz_thread
(
self
,
gcode
=
None
):
threading
.
Thread
(
target
=
self
.
loadviz
,
args
=
(
gcode
,))
.
start
()
def
pre_gcode_load
(
self
):
gcode
=
gcoder
.
GCode
(
deferred
=
True
)
self
.
viz_last_yield
=
0
self
.
viz_last_layer
=
-
1
self
.
start_viz_thread
(
gcode
)
return
gcode
...
...
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