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
c1df8ed4
Commit
c1df8ed4
authored
Jun 03, 2012
by
Gary Hodgson
Committed by
Guillaume Seguin
May 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed calibration resolution bug (was not showing squares) and added sort to bmp file list.
parent
a10defba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
projectlayer.py
projectlayer.py
+13
-4
No files found.
projectlayer.py
View file @
c1df8ed4
...
@@ -188,7 +188,7 @@ class setframe(wx.Frame):
...
@@ -188,7 +188,7 @@ class setframe(wx.Frame):
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
.
SetValue
(
True
)
self
.
fullscreen
.
Bind
(
wx
.
EVT_CHECKBOX
,
self
.
updatefullscreen
)
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Calibrate:"
,
pos
=
(
rightlabelXPos
,
180
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Calibrate:"
,
pos
=
(
rightlabelXPos
,
180
))
self
.
calibrate
=
wx
.
CheckBox
(
self
.
panel
,
-
1
,
pos
=
(
rightValueXPos
,
180
))
self
.
calibrate
=
wx
.
CheckBox
(
self
.
panel
,
-
1
,
pos
=
(
rightValueXPos
,
180
))
...
@@ -245,7 +245,9 @@ class setframe(wx.Frame):
...
@@ -245,7 +245,9 @@ class setframe(wx.Frame):
self
.
image_dir
=
tempfile
.
mkdtemp
()
self
.
image_dir
=
tempfile
.
mkdtemp
()
zipFile
.
extractall
(
self
.
image_dir
)
zipFile
.
extractall
(
self
.
image_dir
)
ol
=
[]
ol
=
[]
for
f
in
os
.
listdir
(
self
.
image_dir
):
imagefiles
=
os
.
listdir
(
self
.
image_dir
)
imagefiles
.
sort
()
for
f
in
imagefiles
:
path
=
os
.
path
.
join
(
self
.
image_dir
,
f
)
path
=
os
.
path
.
join
(
self
.
image_dir
,
f
)
if
os
.
path
.
isfile
(
path
)
and
imghdr
.
what
(
path
)
in
acceptedImageTypes
:
if
os
.
path
.
isfile
(
path
)
and
imghdr
.
what
(
path
)
in
acceptedImageTypes
:
ol
.
append
(
wx
.
Image
(
path
))
ol
.
append
(
wx
.
Image
(
path
))
...
@@ -293,7 +295,7 @@ class setframe(wx.Frame):
...
@@ -293,7 +295,7 @@ class setframe(wx.Frame):
dc
.
DrawLine
(
0
,
resolutionYPixels
,
resolutionXPixels
,
resolutionYPixels
);
dc
.
DrawLine
(
0
,
resolutionYPixels
,
resolutionXPixels
,
resolutionYPixels
);
dc
.
SetPen
(
wx
.
Pen
(
"red"
,
2
))
dc
.
SetPen
(
wx
.
Pen
(
"red"
,
2
))
aspectRatio
=
resolutionXPixels
/
resolutionYPixels
aspectRatio
=
float
(
resolutionXPixels
)
/
float
(
resolutionYPixels
)
projectedXmm
=
float
(
self
.
projectedXmm
.
GetValue
())
projectedXmm
=
float
(
self
.
projectedXmm
.
GetValue
())
projectedYmm
=
round
(
projectedXmm
/
aspectRatio
)
projectedYmm
=
round
(
projectedXmm
/
aspectRatio
)
...
@@ -304,7 +306,7 @@ class setframe(wx.Frame):
...
@@ -304,7 +306,7 @@ class setframe(wx.Frame):
gridCountX
=
int
(
projectedXmm
/
10
)
gridCountX
=
int
(
projectedXmm
/
10
)
gridCountY
=
int
(
projectedYmm
/
10
)
gridCountY
=
int
(
projectedYmm
/
10
)
for
y
in
xrange
(
0
,
gridCountY
):
for
y
in
xrange
(
0
,
gridCountY
+
1
):
for
x
in
xrange
(
0
,
gridCountX
+
1
):
for
x
in
xrange
(
0
,
gridCountX
+
1
):
dc
.
DrawLine
(
0
,
y
*
(
pixelsYPerMM
*
10
),
resolutionXPixels
,
y
*
(
pixelsYPerMM
*
10
));
dc
.
DrawLine
(
0
,
y
*
(
pixelsYPerMM
*
10
),
resolutionXPixels
,
y
*
(
pixelsYPerMM
*
10
));
dc
.
DrawLine
(
x
*
(
pixelsXPerMM
*
10
),
0
,
x
*
(
pixelsXPerMM
*
10
),
resolutionYPixels
);
dc
.
DrawLine
(
x
*
(
pixelsXPerMM
*
10
),
0
,
x
*
(
pixelsXPerMM
*
10
),
resolutionYPixels
);
...
@@ -324,6 +326,13 @@ class setframe(wx.Frame):
...
@@ -324,6 +326,13 @@ class setframe(wx.Frame):
self
.
f
.
scale
=
float
(
self
.
scale
.
GetValue
())
self
.
f
.
scale
=
float
(
self
.
scale
.
GetValue
())
self
.
startcalibrate
(
event
)
self
.
startcalibrate
(
event
)
def
updatefullscreen
(
self
,
event
):
if
(
self
.
fullscreen
.
GetValue
()):
self
.
f
.
ShowFullScreen
(
1
)
else
:
self
.
f
.
ShowFullScreen
(
0
)
self
.
startcalibrate
(
event
)
def
updateresolution
(
self
,
event
):
def
updateresolution
(
self
,
event
):
self
.
f
.
resize
((
float
(
self
.
X
.
GetValue
()),
float
(
self
.
Y
.
GetValue
())))
self
.
f
.
resize
((
float
(
self
.
X
.
GetValue
()),
float
(
self
.
Y
.
GetValue
())))
self
.
startcalibrate
(
event
)
self
.
startcalibrate
(
event
)
...
...
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