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
52a51fc7
Commit
52a51fc7
authored
Jun 22, 2011
by
kliment
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show current layer in visualization instead of all layers
parent
39245779
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
9 deletions
+24
-9
gviz.py
gviz.py
+12
-2
pronterface.py
pronterface.py
+12
-7
No files found.
gviz.py
View file @
52a51fc7
...
...
@@ -2,8 +2,8 @@ import wx,time
class
window
(
wx
.
Frame
):
def
__init__
(
self
):
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Slicetest"
,
size
=
(
200
,
2
00
))
self
.
p
=
gviz
(
self
,
size
=
(
200
,
2
00
),
bedsize
=
(
200
,
200
))
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Slicetest"
,
size
=
(
600
,
6
00
))
self
.
p
=
gviz
(
self
,
size
=
(
600
,
6
00
),
bedsize
=
(
200
,
200
))
s
=
time
.
time
()
for
i
in
open
(
"/home/kliment/designs/spinner/gearend_export.gcode"
):
self
.
p
.
addgcode
(
i
)
...
...
@@ -33,6 +33,7 @@ class gviz(wx.Panel):
self
.
mainpen
=
wx
.
Pen
(
wx
.
Colour
(
0
,
0
,
0
))
self
.
fades
=
[
wx
.
Pen
(
wx
.
Colour
(
150
+
20
*
i
,
150
+
20
*
i
,
150
+
20
*
i
))
for
i
in
xrange
(
6
)]
self
.
showall
=
0
self
.
hilight
=
[]
def
clear
(
self
):
self
.
lastpos
=
[
0
,
0
,
0
,
0
,
0
]
...
...
@@ -52,6 +53,15 @@ class gviz(wx.Panel):
if
(
self
.
layerindex
>
0
):
self
.
layerindex
-=
1
self
.
Refresh
()
def
setlayer
(
self
,
layer
):
try
:
self
.
layerindex
=
self
.
layers
.
index
(
layer
)
wx
.
CallAfter
(
self
.
Refresh
)
self
.
showall
=
0
except
:
pass
def
paint
(
self
,
event
):
dc
=
wx
.
PaintDC
(
self
)
...
...
pronterface.py
View file @
52a51fc7
...
...
@@ -45,7 +45,6 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
os
.
putenv
(
"UBUNTU_MENUPROXY"
,
"0"
)
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Printer Interface"
,
size
=
size
);
self
.
panel
=
wx
.
Panel
(
self
,
-
1
,
size
=
size
)
self
.
p
=
printcore
.
printcore
()
self
.
statuscheck
=
False
self
.
tempreport
=
""
self
.
monitor
=
0
...
...
@@ -91,18 +90,24 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
btndict
=
{}
self
.
popmenu
()
self
.
popwindow
()
self
.
recvlisteners
=
[]
self
.
p
.
recvcb
=
self
.
recvcb
self
.
sdfiles
=
[]
self
.
listing
=
0
self
.
sdprinting
=
0
self
.
percentdone
=
0
self
.
t
=
Tee
(
self
.
catchprint
)
self
.
stdout
=
sys
.
stdout
self
.
mini
=
False
self
.
load_rc
(
".pronsolerc"
)
self
.
p
.
sendcb
=
self
.
sentcb
def
online
(
self
):
print
"Printer is now online"
def
sentcb
(
self
,
line
):
if
(
"Z"
in
line
and
"G1"
in
line
):
try
:
layer
=
float
(
line
.
split
(
"Z"
)[
1
]
.
split
()[
0
])
wx
.
CallAfter
(
self
.
gviz
.
setlayer
,
layer
)
except
:
pass
def
do_extrude
(
self
,
l
=
""
):
try
:
if
not
(
l
.
__class__
==
""
.
__class__
or
l
.
__class__
==
u""
.
__class__
)
or
(
not
len
(
l
)):
...
...
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