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
bf589632
Commit
bf589632
authored
12 years ago
by
Gary Hodgson
Committed by
Guillaume Seguin
11 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added show 1st layer option to allow user deinfed longer times to fix 1st layer to base
parent
c14a7865
master
stable
printrun-20150310
printrun-20140801
printrun-20140730
printrun-20140406
printrun-20140328
printrun-20140126
printrun-20131019
printrun-20130711
printrun-20130604
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
9 deletions
+29
-9
projectlayer.py
projectlayer.py
+29
-9
No files found.
projectlayer.py
View file @
bf589632
...
@@ -24,7 +24,7 @@ import svg.document as wxpsvgdocument
...
@@ -24,7 +24,7 @@ import svg.document as wxpsvgdocument
import
imghdr
import
imghdr
class
dispframe
(
wx
.
Frame
):
class
dispframe
(
wx
.
Frame
):
def
__init__
(
self
,
parent
,
title
,
res
=
(
1024
,
768
),
printer
=
None
):
def
__init__
(
self
,
parent
,
title
,
res
=
(
1024
,
768
),
printer
=
None
,
scale
=
1.0
,
offset
=
(
0
,
0
)
):
wx
.
Frame
.
__init__
(
self
,
parent
=
parent
,
title
=
title
,
size
=
res
)
wx
.
Frame
.
__init__
(
self
,
parent
=
parent
,
title
=
title
,
size
=
res
)
self
.
p
=
printer
self
.
p
=
printer
self
.
pic
=
wx
.
StaticBitmap
(
self
)
self
.
pic
=
wx
.
StaticBitmap
(
self
)
...
@@ -43,6 +43,11 @@ class dispframe(wx.Frame):
...
@@ -43,6 +43,11 @@ class dispframe(wx.Frame):
self
.
brush
=
wx
.
Brush
(
"white"
)
self
.
brush
=
wx
.
Brush
(
"white"
)
self
.
SetDoubleBuffered
(
True
)
self
.
SetDoubleBuffered
(
True
)
self
.
Show
()
self
.
Show
()
self
.
scale
=
scale
self
.
index
=
0
self
.
size
=
res
self
.
offset
=
offset
def
clearlayer
(
self
):
def
clearlayer
(
self
):
try
:
try
:
...
@@ -99,17 +104,22 @@ class dispframe(wx.Frame):
...
@@ -99,17 +104,22 @@ class dispframe(wx.Frame):
def
showimgdelay
(
self
,
image
):
def
showimgdelay
(
self
,
image
):
self
.
drawlayer
(
image
,
self
.
slicer
)
self
.
drawlayer
(
image
,
self
.
slicer
)
print
"Showing"
self
.
pic
.
Show
()
self
.
pic
.
Show
()
self
.
Refresh
()
self
.
Refresh
()
def
rise
(
self
):
def
rise
(
self
):
print
"Rising"
if
self
.
p
!=
None
and
self
.
p
.
online
:
if
self
.
p
!=
None
and
self
.
p
.
online
:
self
.
p
.
send_now
(
"G91"
)
self
.
p
.
send_now
(
"G91"
)
self
.
p
.
send_now
(
"G1 Z
%
f F250"
%
(
self
.
thickness
,))
self
.
p
.
send_now
(
"G1 Z
%
f F250"
%
(
self
.
thickness
,))
self
.
p
.
send_now
(
"G90"
)
self
.
p
.
send_now
(
"G90"
)
def
hidePic
(
self
):
def
hidePic
(
self
):
print
"Hiding"
self
.
pic
.
Hide
()
self
.
pic
.
Hide
()
def
hidePicAndRise
(
self
):
self
.
hidePic
()
self
.
rise
()
self
.
rise
()
def
nextimg
(
self
,
event
):
def
nextimg
(
self
,
event
):
...
@@ -117,7 +127,7 @@ class dispframe(wx.Frame):
...
@@ -117,7 +127,7 @@ class dispframe(wx.Frame):
i
=
self
.
index
i
=
self
.
index
print
i
print
i
wx
.
CallAfter
(
self
.
showimgdelay
,
self
.
layers
[
i
])
wx
.
CallAfter
(
self
.
showimgdelay
,
self
.
layers
[
i
])
wx
.
FutureCall
(
1000
*
self
.
interval
,
self
.
hidePic
)
wx
.
FutureCall
(
1000
*
self
.
interval
,
self
.
hidePic
AndRise
)
self
.
index
+=
1
self
.
index
+=
1
else
:
else
:
print
"end"
print
"end"
...
@@ -189,6 +199,9 @@ class setframe(wx.Frame):
...
@@ -189,6 +199,9 @@ class setframe(wx.Frame):
self
.
bload
=
wx
.
Button
(
self
.
panel
,
-
1
,
"Present"
,
pos
=
(
leftlabelXPos
,
150
))
self
.
bload
=
wx
.
Button
(
self
.
panel
,
-
1
,
"Present"
,
pos
=
(
leftlabelXPos
,
150
))
self
.
bload
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
startdisplay
)
self
.
bload
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
startdisplay
)
self
.
pause
=
wx
.
Button
(
self
.
panel
,
-
1
,
"Pause"
,
pos
=
(
leftlabelXPos
,
180
))
self
.
pause
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
pausepresent
)
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Fullscreen:"
,
pos
=
(
rightlabelXPos
,
150
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Fullscreen:"
,
pos
=
(
rightlabelXPos
,
150
))
self
.
fullscreen
=
wx
.
CheckBox
(
self
.
panel
,
-
1
,
pos
=
(
rightValueXPos
,
150
))
self
.
fullscreen
=
wx
.
CheckBox
(
self
.
panel
,
-
1
,
pos
=
(
rightValueXPos
,
150
))
self
.
fullscreen
.
Bind
(
wx
.
EVT_CHECKBOX
,
self
.
updatefullscreen
)
self
.
fullscreen
.
Bind
(
wx
.
EVT_CHECKBOX
,
self
.
updatefullscreen
)
...
@@ -200,10 +213,11 @@ class setframe(wx.Frame):
...
@@ -200,10 +213,11 @@ class setframe(wx.Frame):
wx
.
StaticText
(
self
.
panel
,
-
1
,
"ProjectedX (mm):"
,
pos
=
(
rightlabelXPos
,
210
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"ProjectedX (mm):"
,
pos
=
(
rightlabelXPos
,
210
))
self
.
projectedXmm
=
floatspin
.
FloatSpin
(
self
.
panel
,
-
1
,
pos
=
(
rightValueXPos
+
40
,
210
),
value
=
150.0
,
increment
=
1
,
digits
=
1
)
self
.
projectedXmm
=
floatspin
.
FloatSpin
(
self
.
panel
,
-
1
,
pos
=
(
rightValueXPos
+
40
,
210
),
value
=
150.0
,
increment
=
1
,
digits
=
1
)
self
.
projectedXmm
.
Bind
(
floatspin
.
EVT_FLOATSPIN
,
self
.
updateprojectedXmm
)
self
.
projectedXmm
.
Bind
(
floatspin
.
EVT_FLOATSPIN
,
self
.
updateprojectedXmm
)
self
.
pause
=
wx
.
Button
(
self
.
panel
,
-
1
,
"Pause"
,
pos
=
(
leftlabelXPos
,
180
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"1st Layer:"
,
pos
=
(
rightlabelXPos
,
240
))
self
.
pause
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
pausePresent
)
self
.
showfirstlayer
=
wx
.
CheckBox
(
self
.
panel
,
-
1
,
pos
=
(
rightValueXPos
,
240
))
self
.
showfirstlayer
.
Bind
(
wx
.
EVT_CHECKBOX
,
self
.
presentfirstlayer
)
self
.
Show
()
self
.
Show
()
def
__del__
(
self
):
def
__del__
(
self
):
...
@@ -359,8 +373,7 @@ class setframe(wx.Frame):
...
@@ -359,8 +373,7 @@ class setframe(wx.Frame):
size
=
(
float
(
self
.
X
.
GetValue
()),
float
(
self
.
Y
.
GetValue
())),
size
=
(
float
(
self
.
X
.
GetValue
()),
float
(
self
.
Y
.
GetValue
())),
offset
=
(
float
(
self
.
offsetX
.
GetValue
()),
float
(
self
.
offsetY
.
GetValue
())))
offset
=
(
float
(
self
.
offsetX
.
GetValue
()),
float
(
self
.
offsetY
.
GetValue
())))
def
pausePresent
(
self
,
event
):
def
pausepresent
(
self
,
event
):
if
self
.
f
.
timer
.
IsRunning
():
if
self
.
f
.
timer
.
IsRunning
():
print
"Pause"
print
"Pause"
self
.
pause
.
SetLabel
(
"Continue"
)
self
.
pause
.
SetLabel
(
"Continue"
)
...
@@ -370,6 +383,13 @@ class setframe(wx.Frame):
...
@@ -370,6 +383,13 @@ class setframe(wx.Frame):
self
.
pause
.
SetLabel
(
"Pause"
)
self
.
pause
.
SetLabel
(
"Pause"
)
self
.
f
.
timer
.
Start
()
self
.
f
.
timer
.
Start
()
def
presentfirstlayer
(
self
,
event
):
if
(
self
.
showfirstlayer
.
GetValue
()):
self
.
f
.
drawlayer
(
self
.
layers
[
0
][
0
],
self
.
f
.
slicer
)
else
:
self
.
f
.
hidePic
()
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
#a = wx.App(redirect=True,filename="mylogfile.txt")
#a = wx.App(redirect=True,filename="mylogfile.txt")
a
=
wx
.
App
()
a
=
wx
.
App
()
...
...
This diff is collapsed.
Click to expand it.
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