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
d730755e
Commit
d730755e
authored
May 24, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show viz window upon double clicking the main window 3D viewer
parent
4f1a0175
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
gcview.py
printrun/gcview.py
+3
-7
gui.py
printrun/gui.py
+3
-2
No files found.
printrun/gcview.py
View file @
d730755e
...
...
@@ -304,13 +304,8 @@ class GcodeViewPanel(wxGLPanel):
glPopMatrix
()
def
double
(
self
,
event
):
p
=
event
.
GetPositionTuple
()
sz
=
self
.
GetClientSize
()
v
=
map
(
lambda
m
,
w
,
b
:
b
*
m
/
w
,
p
,
sz
,
self
.
bedsize
)
v
[
1
]
=
self
.
bedsize
[
1
]
-
v
[
1
]
v
+=
[
300
]
print
"Double-click at "
+
str
(
v
)
+
" in "
print
self
if
self
.
parent
.
clickcb
:
self
.
parent
.
clickcb
(
event
)
def
move
(
self
,
event
):
"""react to mouse actions:
...
...
@@ -472,6 +467,7 @@ class GcodeViewMainWrapper(object):
def
__init__
(
self
,
parent
,
build_dimensions
,
*
args
,
**
kwargs
):
self
.
glpanel
=
GcodeViewPanel
(
parent
,
realparent
=
self
)
self
.
glpanel
.
SetMinSize
((
150
,
150
))
self
.
clickcb
=
None
self
.
widget
=
self
.
glpanel
self
.
refresh_timer
=
wx
.
CallLater
(
100
,
self
.
Refresh
)
self
.
p
=
self
# Hack for backwards compatibility with gviz API
...
...
printrun/gui.py
View file @
d730755e
...
...
@@ -223,6 +223,7 @@ class VizPane(wx.BoxSizer):
try
:
import
printrun.gcview
root
.
gviz
=
printrun
.
gcview
.
GcodeViewMainWrapper
(
root
.
panel
,
root
.
build_dimensions_list
)
root
.
gviz
.
clickcb
=
root
.
showwin
except
:
use2dview
=
True
print
"3D view mode requested, but we failed to initialize it."
...
...
@@ -235,6 +236,7 @@ class VizPane(wx.BoxSizer):
extrusion_width
=
root
.
settings
.
preview_extrusion_width
)
root
.
gviz
.
SetToolTip
(
wx
.
ToolTip
(
"Click to examine / edit
\n
layers of loaded file"
))
root
.
gviz
.
showall
=
1
root
.
gviz
.
Bind
(
wx
.
EVT_LEFT_DOWN
,
root
.
showwin
)
use3dview
=
root
.
settings
.
viz3d
if
use3dview
:
try
:
...
...
@@ -250,9 +252,8 @@ class VizPane(wx.BoxSizer):
build_dimensions
=
root
.
build_dimensions_list
,
grid
=
(
root
.
settings
.
preview_grid_step1
,
root
.
settings
.
preview_grid_step2
),
extrusion_width
=
root
.
settings
.
preview_extrusion_width
)
root
.
gwindow
.
Bind
(
wx
.
EVT_CLOSE
,
lambda
x
:
root
.
gwindow
.
Hide
())
root
.
gwindow
.
Bind
(
wx
.
EVT_CLOSE
,
lambda
x
:
root
.
gwindow
.
Hide
())
if
not
isinstance
(
root
.
gviz
,
NoViz
):
root
.
gviz
.
Bind
(
wx
.
EVT_LEFT_DOWN
,
root
.
showwin
)
self
.
Add
(
root
.
gviz
.
widget
,
1
,
flag
=
wx
.
SHAPED
)
root
.
centersizer
=
wx
.
GridBagSizer
()
self
.
Add
(
root
.
centersizer
,
0
,
flag
=
wx
.
EXPAND
)
...
...
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