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
111f256a
Commit
111f256a
authored
Oct 20, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't clear numpy arrays in gcview before the end of load process
parent
dfb70f9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
actors.py
printrun/gl/libtatlin/actors.py
+18
-9
No files found.
printrun/gl/libtatlin/actors.py
View file @
111f256a
...
@@ -335,6 +335,7 @@ class GcodeModel(Model):
...
@@ -335,6 +335,7 @@ class GcodeModel(Model):
buffers_created
=
False
buffers_created
=
False
use_vbos
=
True
use_vbos
=
True
loaded
=
False
loaded
=
False
fully_loaded
=
False
gcode
=
None
gcode
=
None
...
@@ -648,6 +649,8 @@ class GcodeModel(Model):
...
@@ -648,6 +649,8 @@ class GcodeModel(Model):
self
.
num_layers_to_draw
=
self
.
max_layers
+
1
self
.
num_layers_to_draw
=
self
.
max_layers
+
1
self
.
loaded
=
True
self
.
loaded
=
True
self
.
initialized
=
False
self
.
initialized
=
False
self
.
loaded
=
True
self
.
fully_loaded
=
True
t_end
=
time
.
time
()
t_end
=
time
.
time
()
...
@@ -666,6 +669,7 @@ class GcodeModel(Model):
...
@@ -666,6 +669,7 @@ class GcodeModel(Model):
"gcode"
]:
"gcode"
]:
setattr
(
copy
,
var
,
getattr
(
self
,
var
))
setattr
(
copy
,
var
,
getattr
(
self
,
var
))
copy
.
loaded
=
True
copy
.
loaded
=
True
copy
.
fully_loaded
=
True
copy
.
initialized
=
False
copy
.
initialized
=
False
return
copy
return
copy
...
@@ -689,12 +693,13 @@ class GcodeModel(Model):
...
@@ -689,12 +693,13 @@ class GcodeModel(Model):
self
.
vertex_buffer
=
numpy2vbo
(
self
.
vertices
,
use_vbos
=
self
.
use_vbos
)
self
.
vertex_buffer
=
numpy2vbo
(
self
.
vertices
,
use_vbos
=
self
.
use_vbos
)
self
.
vertex_color_buffer
=
numpy2vbo
(
self
.
colors
,
use_vbos
=
self
.
use_vbos
)
self
.
vertex_color_buffer
=
numpy2vbo
(
self
.
colors
,
use_vbos
=
self
.
use_vbos
)
self
.
vertex_normal_buffer
=
numpy2vbo
(
self
.
normals
,
use_vbos
=
self
.
use_vbos
)
self
.
vertex_normal_buffer
=
numpy2vbo
(
self
.
normals
,
use_vbos
=
self
.
use_vbos
)
# Tentative memory optimization: delete numpy arrays after creating VBOs
if
self
.
fully_loaded
:
self
.
travels
=
None
# Delete numpy arrays after creating VBOs after full load
self
.
indices
=
None
self
.
travels
=
None
self
.
vertices
=
None
self
.
indices
=
None
self
.
colors
=
None
self
.
vertices
=
None
self
.
normals
=
None
self
.
colors
=
None
self
.
normals
=
None
self
.
buffers_created
=
True
self
.
buffers_created
=
True
def
display
(
self
,
mode_2d
=
False
):
def
display
(
self
,
mode_2d
=
False
):
...
@@ -843,6 +848,7 @@ class GcodeModelLight(Model):
...
@@ -843,6 +848,7 @@ class GcodeModelLight(Model):
buffers_created
=
False
buffers_created
=
False
use_vbos
=
True
use_vbos
=
True
loaded
=
False
loaded
=
False
fully_loaded
=
False
gcode
=
None
gcode
=
None
...
@@ -924,6 +930,7 @@ class GcodeModelLight(Model):
...
@@ -924,6 +930,7 @@ class GcodeModelLight(Model):
self
.
num_layers_to_draw
=
self
.
max_layers
+
1
self
.
num_layers_to_draw
=
self
.
max_layers
+
1
self
.
initialized
=
False
self
.
initialized
=
False
self
.
loaded
=
True
self
.
loaded
=
True
self
.
fully_loaded
=
True
t_end
=
time
.
time
()
t_end
=
time
.
time
()
...
@@ -939,6 +946,7 @@ class GcodeModelLight(Model):
...
@@ -939,6 +946,7 @@ class GcodeModelLight(Model):
"layer_idxs_map"
,
"gcode"
]:
"layer_idxs_map"
,
"gcode"
]:
setattr
(
copy
,
var
,
getattr
(
self
,
var
))
setattr
(
copy
,
var
,
getattr
(
self
,
var
))
copy
.
loaded
=
True
copy
.
loaded
=
True
copy
.
fully_loaded
=
True
copy
.
initialized
=
False
copy
.
initialized
=
False
return
copy
return
copy
...
@@ -955,9 +963,10 @@ class GcodeModelLight(Model):
...
@@ -955,9 +963,10 @@ class GcodeModelLight(Model):
self
.
vertex_color_buffer
.
delete
()
self
.
vertex_color_buffer
.
delete
()
self
.
vertex_buffer
=
numpy2vbo
(
self
.
vertices
,
use_vbos
=
self
.
use_vbos
)
self
.
vertex_buffer
=
numpy2vbo
(
self
.
vertices
,
use_vbos
=
self
.
use_vbos
)
self
.
vertex_color_buffer
=
numpy2vbo
(
self
.
colors
,
use_vbos
=
self
.
use_vbos
)
# each pair of vertices shares the color
self
.
vertex_color_buffer
=
numpy2vbo
(
self
.
colors
,
use_vbos
=
self
.
use_vbos
)
# each pair of vertices shares the color
# Tentative memory optimization: delete numpy arrays after creating VBOs
if
self
.
fully_loaded
:
self
.
vertices
=
None
# Delete numpy arrays after creating VBOs after full load
self
.
colors
=
None
self
.
vertices
=
None
self
.
colors
=
None
self
.
buffers_created
=
True
self
.
buffers_created
=
True
def
display
(
self
,
mode_2d
=
False
):
def
display
(
self
,
mode_2d
=
False
):
...
...
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