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
edaa0e93
Commit
edaa0e93
authored
Mar 29, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply
b597639e
to gviz
parent
b597639e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
gviz.py
printrun/gviz.py
+7
-1
pronsole.py
printrun/pronsole.py
+3
-2
pronterface.py
printrun/pronterface.py
+6
-2
No files found.
printrun/gviz.py
View file @
edaa0e93
...
@@ -436,7 +436,9 @@ class Gviz(wx.Panel):
...
@@ -436,7 +436,9 @@ class Gviz(wx.Panel):
def
add_parsed_gcodes
(
self
,
gcode
):
def
add_parsed_gcodes
(
self
,
gcode
):
start_time
=
time
.
time
()
start_time
=
time
.
time
()
for
layer_idx
,
layer
in
enumerate
(
gcode
.
all_layers
):
layer_idx
=
0
while
layer_idx
<
len
(
gcode
.
all_layers
):
layer
=
gcode
.
all_layers
[
layer_idx
]
has_move
=
False
has_move
=
False
for
gline
in
layer
:
for
gline
in
layer
:
if
gline
.
is_move
:
if
gline
.
is_move
:
...
@@ -467,11 +469,15 @@ class Gviz(wx.Panel):
...
@@ -467,11 +469,15 @@ class Gviz(wx.Panel):
# unfinished layer
# unfinished layer
self
.
layers
[
layer_idx
]
=
viz_layer
self
.
layers
[
layer_idx
]
=
viz_layer
self
.
layersz
.
append
(
layer
.
z
)
self
.
layersz
.
append
(
layer
.
z
)
# Refresh display if more than 0.2s have passed
# Refresh display if more than 0.2s have passed
if
time
.
time
()
-
start_time
>
0.2
:
if
time
.
time
()
-
start_time
>
0.2
:
start_time
=
time
.
time
()
start_time
=
time
.
time
()
self
.
dirty
=
1
self
.
dirty
=
1
wx
.
CallAfter
(
self
.
Refresh
)
wx
.
CallAfter
(
self
.
Refresh
)
layer_idx
+=
1
self
.
dirty
=
1
self
.
dirty
=
1
wx
.
CallAfter
(
self
.
Refresh
)
wx
.
CallAfter
(
self
.
Refresh
)
...
...
printrun/pronsole.py
View file @
edaa0e93
...
@@ -1104,9 +1104,10 @@ class pronsole(cmd.Cmd):
...
@@ -1104,9 +1104,10 @@ class pronsole(cmd.Cmd):
self
.
log
(
_
(
"Loaded
%
s,
%
d lines."
)
%
(
filename
,
len
(
self
.
fgcode
)))
self
.
log
(
_
(
"Loaded
%
s,
%
d lines."
)
%
(
filename
,
len
(
self
.
fgcode
)))
self
.
log
(
_
(
"Estimated duration:
%
d layers,
%
s"
)
%
self
.
fgcode
.
estimate_duration
())
self
.
log
(
_
(
"Estimated duration:
%
d layers,
%
s"
)
%
self
.
fgcode
.
estimate_duration
())
def
load_gcode
(
self
,
filename
):
def
load_gcode
(
self
,
filename
,
layer_callback
=
None
):
self
.
fgcode
=
gcoder
.
GCode
(
open
(
filename
,
"rU"
),
self
.
fgcode
=
gcoder
.
GCode
(
open
(
filename
,
"rU"
),
get_home_pos
(
self
.
build_dimensions_list
))
get_home_pos
(
self
.
build_dimensions_list
),
layer_callback
=
layer_callback
)
self
.
fgcode
.
estimate_duration
()
self
.
fgcode
.
estimate_duration
()
self
.
filename
=
filename
self
.
filename
=
filename
...
...
printrun/pronterface.py
View file @
edaa0e93
...
@@ -1248,7 +1248,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1248,7 +1248,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
fn
=
self
.
filename
fn
=
self
.
filename
try
:
try
:
self
.
filename
=
self
.
model_to_gcode_filename
(
self
.
filename
)
self
.
filename
=
self
.
model_to_gcode_filename
(
self
.
filename
)
self
.
load_gcode
(
self
.
filename
)
self
.
load_gcode
(
self
.
filename
,
layer_callback
=
self
.
layer_ready_cb
)
if
self
.
p
.
online
:
if
self
.
p
.
online
:
wx
.
CallAfter
(
self
.
printbtn
.
Enable
)
wx
.
CallAfter
(
self
.
printbtn
.
Enable
)
...
@@ -1342,7 +1342,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1342,7 +1342,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self
.
skein
(
name
)
self
.
skein
(
name
)
else
:
else
:
self
.
filename
=
name
self
.
filename
=
name
self
.
load_gcode
(
self
.
filename
)
self
.
load_gcode
(
self
.
filename
,
layer_callback
=
self
.
layer_ready_cb
)
self
.
statusbar
.
SetStatusText
(
_
(
"Loaded
%
s,
%
d lines"
)
%
(
name
,
len
(
self
.
fgcode
)))
self
.
statusbar
.
SetStatusText
(
_
(
"Loaded
%
s,
%
d lines"
)
%
(
name
,
len
(
self
.
fgcode
)))
print
_
(
"Loaded
%
s,
%
d lines"
)
%
(
name
,
len
(
self
.
fgcode
))
print
_
(
"Loaded
%
s,
%
d lines"
)
%
(
name
,
len
(
self
.
fgcode
))
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
_
(
"Print"
))
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
_
(
"Print"
))
...
@@ -1356,6 +1356,10 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1356,6 +1356,10 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
else
:
else
:
dlg
.
Destroy
()
dlg
.
Destroy
()
def
layer_ready_cb
(
self
,
gcode
,
layer
):
print
gcode
,
layer
print
gcode
.
all_layers
[
layer
]
.
z
def
post_gcode_load
(
self
,
print_stats
=
True
):
def
post_gcode_load
(
self
,
print_stats
=
True
):
if
print_stats
:
if
print_stats
:
self
.
output_gcode_stats
()
self
.
output_gcode_stats
()
...
...
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