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
47d0b016
Commit
47d0b016
authored
May 24, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use thread-unsafe deepcopy() and copy GcodeModel by hand
parent
1950681f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
gcview.py
printrun/gcview.py
+1
-2
actors.py
printrun/libtatlin/actors.py
+8
-0
No files found.
printrun/gcview.py
View file @
47d0b016
...
@@ -17,7 +17,6 @@
...
@@ -17,7 +17,6 @@
import
os
import
os
import
math
import
math
import
copy
import
wx
import
wx
from
wx
import
glcanvas
from
wx
import
glcanvas
...
@@ -530,7 +529,7 @@ class GcodeViewFrame(wx.Frame):
...
@@ -530,7 +529,7 @@ class GcodeViewFrame(wx.Frame):
def
addfile
(
self
,
gcode
=
None
):
def
addfile
(
self
,
gcode
=
None
):
if
self
.
clonefrom
:
if
self
.
clonefrom
:
self
.
model
=
copy
.
deepcopy
(
self
.
clonefrom
[
-
1
]
.
model
)
self
.
model
=
self
.
clonefrom
[
-
1
]
.
model
.
copy
(
)
else
:
else
:
self
.
model
=
actors
.
GcodeModel
()
self
.
model
=
actors
.
GcodeModel
()
if
gcode
:
if
gcode
:
...
...
printrun/libtatlin/actors.py
View file @
47d0b016
...
@@ -273,6 +273,14 @@ class GcodeModel(Model):
...
@@ -273,6 +273,14 @@ class GcodeModel(Model):
print
>>
sys
.
stderr
,
_
(
'Initialized 3D visualization in
%.2
f seconds'
)
%
(
t_end
-
t_start
)
print
>>
sys
.
stderr
,
_
(
'Initialized 3D visualization in
%.2
f seconds'
)
%
(
t_end
-
t_start
)
print
>>
sys
.
stderr
,
_
(
'Vertex count:
%
d'
)
%
len
(
self
.
vertices
)
print
>>
sys
.
stderr
,
_
(
'Vertex count:
%
d'
)
%
len
(
self
.
vertices
)
def
copy
(
self
):
copy
=
GcodeModel
()
for
var
in
[
"vertices"
,
"arrows"
,
"colors"
,
"max_layers"
,
"num_layers_to_draw"
,
"printed_until"
,
"arrows_enabled"
,
"layer_stops"
]:
setattr
(
copy
,
var
,
getattr
(
self
,
var
))
copy
.
loaded
=
True
copy
.
initialized
=
False
return
copy
def
movement_color
(
self
,
move
):
def
movement_color
(
self
,
move
):
"""
"""
Return the color to use for particular type of movement.
Return the color to use for particular type of movement.
...
...
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