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
Show 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
...
@@ -2,8 +2,8 @@ import wx,time
class
window
(
wx
.
Frame
):
class
window
(
wx
.
Frame
):
def
__init__
(
self
):
def
__init__
(
self
):
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Slicetest"
,
size
=
(
200
,
2
00
))
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Slicetest"
,
size
=
(
600
,
6
00
))
self
.
p
=
gviz
(
self
,
size
=
(
200
,
2
00
),
bedsize
=
(
200
,
200
))
self
.
p
=
gviz
(
self
,
size
=
(
600
,
6
00
),
bedsize
=
(
200
,
200
))
s
=
time
.
time
()
s
=
time
.
time
()
for
i
in
open
(
"/home/kliment/designs/spinner/gearend_export.gcode"
):
for
i
in
open
(
"/home/kliment/designs/spinner/gearend_export.gcode"
):
self
.
p
.
addgcode
(
i
)
self
.
p
.
addgcode
(
i
)
...
@@ -33,6 +33,7 @@ class gviz(wx.Panel):
...
@@ -33,6 +33,7 @@ class gviz(wx.Panel):
self
.
mainpen
=
wx
.
Pen
(
wx
.
Colour
(
0
,
0
,
0
))
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
.
fades
=
[
wx
.
Pen
(
wx
.
Colour
(
150
+
20
*
i
,
150
+
20
*
i
,
150
+
20
*
i
))
for
i
in
xrange
(
6
)]
self
.
showall
=
0
self
.
showall
=
0
self
.
hilight
=
[]
def
clear
(
self
):
def
clear
(
self
):
self
.
lastpos
=
[
0
,
0
,
0
,
0
,
0
]
self
.
lastpos
=
[
0
,
0
,
0
,
0
,
0
]
...
@@ -53,6 +54,15 @@ class gviz(wx.Panel):
...
@@ -53,6 +54,15 @@ class gviz(wx.Panel):
self
.
layerindex
-=
1
self
.
layerindex
-=
1
self
.
Refresh
()
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
):
def
paint
(
self
,
event
):
dc
=
wx
.
PaintDC
(
self
)
dc
=
wx
.
PaintDC
(
self
)
dc
.
SetBackground
(
wx
.
Brush
((
250
,
250
,
200
)))
dc
.
SetBackground
(
wx
.
Brush
((
250
,
250
,
200
)))
...
...
pronterface.py
View file @
52a51fc7
...
@@ -45,7 +45,6 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -45,7 +45,6 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
os
.
putenv
(
"UBUNTU_MENUPROXY"
,
"0"
)
os
.
putenv
(
"UBUNTU_MENUPROXY"
,
"0"
)
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Printer Interface"
,
size
=
size
);
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Printer Interface"
,
size
=
size
);
self
.
panel
=
wx
.
Panel
(
self
,
-
1
,
size
=
size
)
self
.
panel
=
wx
.
Panel
(
self
,
-
1
,
size
=
size
)
self
.
p
=
printcore
.
printcore
()
self
.
statuscheck
=
False
self
.
statuscheck
=
False
self
.
tempreport
=
""
self
.
tempreport
=
""
self
.
monitor
=
0
self
.
monitor
=
0
...
@@ -91,17 +90,23 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -91,17 +90,23 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
btndict
=
{}
self
.
btndict
=
{}
self
.
popmenu
()
self
.
popmenu
()
self
.
popwindow
()
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
.
t
=
Tee
(
self
.
catchprint
)
self
.
stdout
=
sys
.
stdout
self
.
stdout
=
sys
.
stdout
self
.
mini
=
False
self
.
mini
=
False
self
.
load_rc
(
".pronsolerc"
)
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
=
""
):
def
do_extrude
(
self
,
l
=
""
):
try
:
try
:
...
...
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