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
aa0a045e
Commit
aa0a045e
authored
Nov 22, 2011
by
Kliment Yanev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce memory usage by clearing gviz cache. Avoid delays by using a queue to draw executed gcodes.
parent
d05a3996
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
gviz.py
gviz.py
+4
-0
pronterface.py
pronterface.py
+13
-2
No files found.
gviz.py
View file @
aa0a045e
...
@@ -88,7 +88,11 @@ class gviz(wx.Panel):
...
@@ -88,7 +88,11 @@ class gviz(wx.Panel):
self
.
lastpos
=
[
0
,
0
,
0
,
0
,
0
,
0
,
0
]
self
.
lastpos
=
[
0
,
0
,
0
,
0
,
0
,
0
,
0
]
self
.
lines
=
{}
self
.
lines
=
{}
self
.
pens
=
{}
self
.
pens
=
{}
self
.
arcs
=
{}
self
.
arcpens
=
{}
self
.
layers
=
[]
self
.
layers
=
[]
self
.
hilight
=
[]
self
.
hilightarcs
=
[]
self
.
layerindex
=
0
self
.
layerindex
=
0
self
.
showall
=
0
self
.
showall
=
0
self
.
dirty
=
1
self
.
dirty
=
1
...
...
pronterface.py
View file @
aa0a045e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# Set up Internationalization using gettext
# Set up Internationalization using gettext
# searching for installed locales on /usr/share; uses relative folder if not found (windows)
# searching for installed locales on /usr/share; uses relative folder if not found (windows)
import
os
,
gettext
import
os
,
gettext
,
Queue
if
os
.
path
.
exists
(
'/usr/share/pronterface/locale'
):
if
os
.
path
.
exists
(
'/usr/share/pronterface/locale'
):
gettext
.
install
(
'pronterface'
,
'/usr/share/pronterface/locale'
,
unicode
=
1
)
gettext
.
install
(
'pronterface'
,
'/usr/share/pronterface/locale'
,
unicode
=
1
)
...
@@ -75,6 +75,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -75,6 +75,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
skeinp
=
None
self
.
skeinp
=
None
self
.
monitor_interval
=
3
self
.
monitor_interval
=
3
self
.
paused
=
False
self
.
paused
=
False
self
.
sentlines
=
Queue
.
Queue
(
30
)
xcol
=
(
245
,
245
,
108
)
xcol
=
(
245
,
245
,
108
)
ycol
=
(
180
,
180
,
255
)
ycol
=
(
180
,
180
,
255
)
zcol
=
(
180
,
255
,
180
)
zcol
=
(
180
,
255
,
180
)
...
@@ -158,7 +159,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -158,7 +159,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
threading
.
Thread
(
target
=
wx
.
CallAfter
,
args
=
(
self
.
gviz
.
setlayer
,
layer
))
.
start
()
threading
.
Thread
(
target
=
wx
.
CallAfter
,
args
=
(
self
.
gviz
.
setlayer
,
layer
))
.
start
()
except
:
except
:
pass
pass
threading
.
Thread
(
target
=
self
.
gviz
.
addgcode
,
args
=
(
line
,
1
))
.
start
()
try
:
self
.
sentlines
.
put_nowait
(
line
)
except
:
pass
#threading.Thread(target=self.gviz.addgcode,args=(line,1)).start()
#self.gwindow.p.addgcode(line,hilight=1)
#self.gwindow.p.addgcode(line,hilight=1)
def
do_extrude
(
self
,
l
=
""
):
def
do_extrude
(
self
,
l
=
""
):
...
@@ -1118,6 +1123,12 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -1118,6 +1123,12 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
p
.
send_now
(
"M27"
)
self
.
p
.
send_now
(
"M27"
)
self
.
p
.
send_now
(
"M105"
)
self
.
p
.
send_now
(
"M105"
)
time
.
sleep
(
self
.
monitor_interval
)
time
.
sleep
(
self
.
monitor_interval
)
while
not
self
.
sentlines
.
empty
():
try
:
gc
=
self
.
sentlines
.
get_nowait
()
wx
.
CallAfter
(
self
.
gviz
.
addgcode
(
gc
,
1
))
except
:
break
wx
.
CallAfter
(
self
.
status
.
SetStatusText
,
_
(
"Not connected to printer."
))
wx
.
CallAfter
(
self
.
status
.
SetStatusText
,
_
(
"Not connected to printer."
))
except
:
except
:
pass
#if window has been closed
pass
#if window has been closed
...
...
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