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
ab76f94d
Commit
ab76f94d
authored
Jul 24, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Heavily decrease CPU usage of stlview by removing Refresh thread
parent
95316691
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
stlview.py
printrun/stlview.py
+2
-9
No files found.
printrun/stlview.py
View file @
ab76f94d
...
@@ -144,7 +144,6 @@ class StlViewPanel(wxGLPanel):
...
@@ -144,7 +144,6 @@ class StlViewPanel(wxGLPanel):
def
forceresize
(
self
):
def
forceresize
(
self
):
self
.
SetClientSize
((
self
.
GetClientSize
()[
0
],
self
.
GetClientSize
()[
1
]
+
1
))
self
.
SetClientSize
((
self
.
GetClientSize
()[
0
],
self
.
GetClientSize
()[
1
]
+
1
))
self
.
SetClientSize
((
self
.
GetClientSize
()[
0
],
self
.
GetClientSize
()[
1
]
-
1
))
self
.
SetClientSize
((
self
.
GetClientSize
()[
0
],
self
.
GetClientSize
()[
1
]
-
1
))
threading
.
Thread
(
target
=
self
.
update
)
.
start
()
self
.
initialized
=
0
self
.
initialized
=
0
def
move_shape
(
self
,
delta
):
def
move_shape
(
self
,
delta
):
...
@@ -249,6 +248,7 @@ class StlViewPanel(wxGLPanel):
...
@@ -249,6 +248,7 @@ class StlViewPanel(wxGLPanel):
self
.
zoom
(
factor
,
(
x
,
y
))
self
.
zoom
(
factor
,
(
x
,
y
))
else
:
else
:
self
.
zoom
(
1
/
factor
,
(
x
,
y
))
self
.
zoom
(
1
/
factor
,
(
x
,
y
))
wx
.
CallAfter
(
self
.
Refresh
)
def
keypress
(
self
,
event
):
def
keypress
(
self
,
event
):
"""gets keypress events and moves/rotates acive shape"""
"""gets keypress events and moves/rotates acive shape"""
...
@@ -278,14 +278,7 @@ class StlViewPanel(wxGLPanel):
...
@@ -278,14 +278,7 @@ class StlViewPanel(wxGLPanel):
if
keycode
==
93
:
if
keycode
==
93
:
self
.
rotate_shape
(
angle
)
self
.
rotate_shape
(
angle
)
event
.
Skip
()
event
.
Skip
()
wx
.
CallAfter
(
self
.
Refresh
)
def
update
(
self
):
while
True
:
time
.
sleep
(
0.05
)
try
:
wx
.
CallAfter
(
self
.
Refresh
)
except
:
return
def
anim
(
self
,
obj
):
def
anim
(
self
,
obj
):
g
=
50
*
9.8
g
=
50
*
9.8
...
...
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