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
1e6885d2
Commit
1e6885d2
authored
Mar 04, 2012
by
Kliment Yanev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add blanking to projection for photopolymer printing
parent
28c05419
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
15 deletions
+39
-15
projectlayer.py
projectlayer.py
+39
-15
No files found.
projectlayer.py
View file @
1e6885d2
...
...
@@ -37,6 +37,13 @@ class dispframe(wx.Frame):
self
.
p
=
printer
self
.
pic
=
wx
.
StaticBitmap
(
self
)
self
.
bitmap
=
wx
.
EmptyBitmap
(
*
res
)
self
.
bbitmap
=
wx
.
EmptyBitmap
(
*
res
)
dc
=
wx
.
MemoryDC
()
dc
.
SelectObject
(
self
.
bbitmap
)
dc
.
SetBackground
(
wx
.
Brush
(
"black"
))
dc
.
Clear
()
dc
.
SelectObject
(
wx
.
NullBitmap
)
self
.
SetBackgroundColour
(
"black"
)
self
.
pic
.
Hide
()
self
.
pen
=
wx
.
Pen
(
"white"
)
...
...
@@ -61,20 +68,33 @@ class dispframe(wx.Frame):
self
.
pic
.
SetBitmap
(
self
.
bitmap
)
self
.
pic
.
Show
()
self
.
Refresh
()
#self.pic.SetBitmap(self.bitmap)
except
:
raise
pass
def
showimgdelay
(
self
,
image
):
self
.
drawlayer
(
image
)
self
.
pic
.
Show
()
self
.
Refresh
()
# time.sleep(self.interval)
#self.pic.Hide()
self
.
Refresh
()
if
self
.
p
!=
None
and
self
.
p
.
online
:
self
.
p
.
send_now
(
"G91"
)
self
.
p
.
send_now
(
"G1 Z
%
f F300"
%
(
self
.
thickness
,))
self
.
p
.
send_now
(
"G90"
)
def
nextimg
(
self
,
event
):
#print "b"
if
self
.
index
<
len
(
self
.
layers
):
i
=
self
.
index
#print self.layers[i]
print
i
wx
.
CallAfter
(
self
.
drawlayer
,
self
.
layers
[
i
])
if
self
.
p
!=
None
:
self
.
p
.
send_now
(
"G91"
)
self
.
p
.
send_now
(
"G1 Z
%
f F300"
%
(
self
.
thickness
,))
self
.
p
.
send_now
(
"G90"
)
wx
.
CallAfter
(
self
.
showimgdelay
,
self
.
layers
[
i
])
wx
.
FutureCall
(
1000
*
self
.
interval
,
self
.
pic
.
Hide
)
self
.
index
+=
1
else
:
print
"end"
...
...
@@ -84,7 +104,7 @@ class dispframe(wx.Frame):
wx
.
CallAfter
(
self
.
timer
.
Stop
)
def
present
(
self
,
layers
,
interval
=
0.5
,
thickness
=
0.4
,
scale
=
20
,
size
=
(
800
,
600
)):
def
present
(
self
,
layers
,
interval
=
0.5
,
pause
=
0.2
,
thickness
=
0.4
,
scale
=
20
,
size
=
(
800
,
600
)):
wx
.
CallAfter
(
self
.
pic
.
Hide
)
wx
.
CallAfter
(
self
.
Refresh
)
self
.
layers
=
layers
...
...
@@ -92,10 +112,11 @@ class dispframe(wx.Frame):
self
.
thickness
=
thickness
self
.
index
=
0
self
.
size
=
size
self
.
interval
=
interval
self
.
timer
=
wx
.
Timer
(
self
,
1
)
self
.
timer
.
Bind
(
wx
.
EVT_TIMER
,
self
.
nextimg
)
self
.
Bind
(
wx
.
EVT_TIMER
,
self
.
nextimg
)
self
.
timer
.
Start
(
1000
*
interval
)
self
.
timer
.
Start
(
1000
*
interval
+
1000
*
pause
)
#print "x"
...
...
@@ -111,16 +132,19 @@ class setframe(wx.Frame):
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Layer:"
,
pos
=
(
0
,
30
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"mm"
,
pos
=
(
130
,
30
))
self
.
thickness
=
wx
.
TextCtrl
(
self
.
panel
,
-
1
,
"0.5"
,
pos
=
(
50
,
30
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"
Interval
:"
,
pos
=
(
0
,
60
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"
Exposure
:"
,
pos
=
(
0
,
60
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"s"
,
pos
=
(
130
,
60
))
self
.
interval
=
wx
.
TextCtrl
(
self
.
panel
,
-
1
,
"0.5"
,
pos
=
(
50
,
60
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Scale:"
,
pos
=
(
0
,
90
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"x"
,
pos
=
(
130
,
90
))
self
.
scale
=
wx
.
TextCtrl
(
self
.
panel
,
-
1
,
"10"
,
pos
=
(
50
,
90
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Blank:"
,
pos
=
(
0
,
90
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"s"
,
pos
=
(
130
,
90
))
self
.
delay
=
wx
.
TextCtrl
(
self
.
panel
,
-
1
,
"0.5"
,
pos
=
(
50
,
90
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Scale:"
,
pos
=
(
0
,
120
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"x"
,
pos
=
(
130
,
120
))
self
.
scale
=
wx
.
TextCtrl
(
self
.
panel
,
-
1
,
"5"
,
pos
=
(
50
,
120
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"X:"
,
pos
=
(
160
,
30
))
self
.
X
=
wx
.
TextCtrl
(
self
.
panel
,
-
1
,
"
800
"
,
pos
=
(
180
,
30
))
self
.
X
=
wx
.
TextCtrl
(
self
.
panel
,
-
1
,
"
1024
"
,
pos
=
(
180
,
30
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Y:"
,
pos
=
(
160
,
60
))
self
.
Y
=
wx
.
TextCtrl
(
self
.
panel
,
-
1
,
"
600
"
,
pos
=
(
180
,
60
))
self
.
Y
=
wx
.
TextCtrl
(
self
.
panel
,
-
1
,
"
768
"
,
pos
=
(
180
,
60
))
self
.
bload
=
wx
.
Button
(
self
.
panel
,
-
1
,
"Present"
,
pos
=
(
0
,
150
))
self
.
bload
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
startdisplay
)
self
.
Show
()
...
...
@@ -146,7 +170,7 @@ class setframe(wx.Frame):
self
.
f
.
ShowFullScreen
(
1
)
l
=
self
.
layers
[
0
][:]
#l=list(reversed(l))
self
.
f
.
present
(
l
,
thickness
=
float
(
self
.
thickness
.
GetValue
()),
interval
=
float
(
self
.
interval
.
GetValue
()),
scale
=
float
(
self
.
scale
.
GetValue
()),
size
=
(
float
(
self
.
X
.
GetValue
()),
float
(
self
.
Y
.
GetValue
())))
self
.
f
.
present
(
l
,
thickness
=
float
(
self
.
thickness
.
GetValue
()),
interval
=
float
(
self
.
interval
.
GetValue
()),
scale
=
float
(
self
.
scale
.
GetValue
()),
pause
=
float
(
self
.
delay
.
GetValue
()),
size
=
(
float
(
self
.
X
.
GetValue
()),
float
(
self
.
Y
.
GetValue
())))
if
__name__
==
"__main__"
:
a
=
wx
.
App
()
...
...
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