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
69702567
Commit
69702567
authored
Jul 09, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add C keybinding to gcview to only show current layer
parent
5301e434
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
gcview.py
printrun/gcview.py
+5
-0
actors.py
printrun/gl/libtatlin/actors.py
+9
-6
No files found.
printrun/gcview.py
View file @
69702567
...
...
@@ -210,6 +210,7 @@ class GcodeViewPanel(wxGLPanel):
kzi
=
[
wx
.
WXK_PAGEDOWN
,
388
,
316
,
61
]
# Zoom In Keys
kzo
=
[
wx
.
WXK_PAGEUP
,
390
,
314
,
45
]
# Zoom Out Keys
kfit
=
[
70
]
# Fit to print keys
kshowcurrent
=
[
67
]
# Show only current layer keys
kreset
=
[
82
]
# Reset keys
key
=
event
.
GetKeyCode
()
if
key
in
kup
:
...
...
@@ -223,6 +224,10 @@ class GcodeViewPanel(wxGLPanel):
self
.
zoom
(
1
/
step
,
(
x
,
y
))
if
key
in
kfit
:
self
.
fit
()
if
key
in
kshowcurrent
:
if
not
self
.
parent
.
model
or
not
self
.
parent
.
model
.
loaded
:
return
self
.
parent
.
model
.
only_current
=
not
self
.
parent
.
model
.
only_current
if
key
in
kreset
:
self
.
reset_mview
(
0.9
)
self
.
basequat
=
[
0
,
0
,
0
,
1
]
...
...
printrun/gl/libtatlin/actors.py
View file @
69702567
...
...
@@ -289,6 +289,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
.
only_current
=
False
self
.
initialized
=
False
self
.
loaded
=
True
...
...
@@ -365,6 +366,7 @@ class GcodeModel(Model):
# Draw printed stuff until end or end_prev_layer
cur_end
=
min
(
self
.
printed_until
,
end
)
if
not
self
.
only_current
:
if
0
<=
end_prev_layer
<=
cur_end
:
glDrawArrays
(
GL_LINES
,
start
,
end_prev_layer
)
elif
cur_end
>=
0
:
...
...
@@ -375,6 +377,7 @@ class GcodeModel(Model):
# Draw nonprinted stuff until end_prev_layer
start
=
max
(
cur_end
,
0
)
if
end_prev_layer
>=
start
:
if
not
self
.
only_current
:
glDrawArrays
(
GL_LINES
,
start
,
end_prev_layer
-
start
)
cur_end
=
end_prev_layer
...
...
@@ -405,7 +408,7 @@ class GcodeModel(Model):
# Draw non printed stuff until end (if not ending at a given layer)
start
=
max
(
self
.
printed_until
,
0
)
end
=
end
-
start
if
end_prev_layer
<
0
and
end
>
0
:
if
end_prev_layer
<
0
and
end
>
0
and
not
self
.
only_current
:
glDrawArrays
(
GL_LINES
,
start
,
end
)
self
.
vertex_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