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
55dbe0c6
Commit
55dbe0c6
authored
May 21, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display already printed lines in a different color in gcview
parent
ae0b2f19
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
actors.py
printrun/libtatlin/actors.py
+21
-4
No files found.
printrun/libtatlin/actors.py
View file @
55dbe0c6
...
...
@@ -206,6 +206,8 @@ class GcodeModel(Model):
[
0.4
,
0.1
,
0.0
],
],
'f'
)
color_printed
=
(
0.2
,
0.75
,
0
,
0.6
)
loaded
=
False
def
load_data
(
self
,
model_data
,
callback
=
None
):
...
...
@@ -234,6 +236,7 @@ class GcodeModel(Model):
color_list
.
append
(
vertex_color
)
prev_pos
=
gline
.
current_pos
gline
.
gcview_end_vertex
=
len
(
vertex_list
)
self
.
layer_stops
.
append
(
len
(
vertex_list
))
...
...
@@ -255,6 +258,7 @@ class GcodeModel(Model):
self
.
max_layers
=
len
(
self
.
layer_stops
)
-
1
self
.
num_layers_to_draw
=
self
.
max_layers
self
.
printed_until
=
-
1
self
.
arrows_enabled
=
True
self
.
initialized
=
False
self
.
loaded
=
True
...
...
@@ -324,9 +328,6 @@ class GcodeModel(Model):
self
.
vertex_buffer
.
bind
()
glVertexPointer
(
3
,
GL_FLOAT
,
0
,
None
)
self
.
vertex_color_buffer
.
bind
()
glColorPointer
(
4
,
GL_FLOAT
,
0
,
None
)
if
mode_2d
:
glScale
(
1.0
,
1.0
,
0.0
)
# discard z coordinates
start
=
self
.
layer_stops
[
self
.
num_layers_to_draw
-
1
]
...
...
@@ -334,8 +335,24 @@ class GcodeModel(Model):
else
:
# 3d
start
=
0
end
=
self
.
layer_stops
[
self
.
num_layers_to_draw
]
glDisableClientState
(
GL_COLOR_ARRAY
)
glColor4f
(
*
self
.
color_printed
)
printed_end
=
min
(
self
.
printed_until
,
end
)
if
start
<
printed_end
:
glDrawArrays
(
GL_LINES
,
start
,
printed_end
)
glEnableClientState
(
GL_COLOR_ARRAY
)
self
.
vertex_color_buffer
.
bind
()
glColorPointer
(
4
,
GL_FLOAT
,
0
,
None
)
glDrawArrays
(
GL_LINES
,
start
,
end
)
start
=
self
.
printed_until
+
1
end
=
end
-
start
if
end
>
0
:
glDrawArrays
(
GL_LINES
,
start
,
end
)
self
.
vertex_buffer
.
unbind
()
self
.
vertex_color_buffer
.
unbind
()
...
...
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