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
6f9d618f
Commit
6f9d618f
authored
Aug 18, 2013
by
Gary Hodgson
Committed by
Guillaume Seguin
Aug 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
default project x y were floats, should be ints. - added check in projectlayer too
parent
8533e573
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
projectlayer.py
printrun/projectlayer.py
+8
-4
No files found.
printrun/projectlayer.py
View file @
6f9d618f
...
@@ -28,6 +28,7 @@ import copy
...
@@ -28,6 +28,7 @@ import copy
import
re
import
re
from
collections
import
OrderedDict
from
collections
import
OrderedDict
import
itertools
import
itertools
import
math
class
DisplayFrame
(
wx
.
Frame
):
class
DisplayFrame
(
wx
.
Frame
):
def
__init__
(
self
,
parent
,
title
,
res
=
(
1024
,
768
),
printer
=
None
,
scale
=
1.0
,
offset
=
(
0
,
0
)):
def
__init__
(
self
,
parent
,
title
,
res
=
(
1024
,
768
),
printer
=
None
,
scale
=
1.0
,
offset
=
(
0
,
0
)):
...
@@ -327,13 +328,15 @@ class SettingsFrame(wx.Frame):
...
@@ -327,13 +328,15 @@ class SettingsFrame(wx.Frame):
# Right Column
# Right Column
fieldsizer
.
Add
(
wx
.
StaticText
(
self
.
panel
,
-
1
,
"X (px):"
),
pos
=
(
0
,
2
),
flag
=
wx
.
ALIGN_CENTER_VERTICAL
)
fieldsizer
.
Add
(
wx
.
StaticText
(
self
.
panel
,
-
1
,
"X (px):"
),
pos
=
(
0
,
2
),
flag
=
wx
.
ALIGN_CENTER_VERTICAL
)
self
.
X
=
wx
.
SpinCtrl
(
self
.
panel
,
-
1
,
str
(
int
(
self
.
_get_setting
(
"project_x"
,
1920
))),
max
=
999999
,
size
=
(
80
,
-
1
))
projectX
=
int
(
math
.
floor
(
float
(
self
.
_get_setting
(
"project_x"
,
1920
))))
self
.
X
=
wx
.
SpinCtrl
(
self
.
panel
,
-
1
,
str
(
projectX
),
max
=
999999
,
size
=
(
80
,
-
1
))
self
.
X
.
Bind
(
wx
.
EVT_SPINCTRL
,
self
.
update_resolution
)
self
.
X
.
Bind
(
wx
.
EVT_SPINCTRL
,
self
.
update_resolution
)
self
.
X
.
SetHelpText
(
"The projector resolution in the X axis."
)
self
.
X
.
SetHelpText
(
"The projector resolution in the X axis."
)
fieldsizer
.
Add
(
self
.
X
,
pos
=
(
0
,
3
))
fieldsizer
.
Add
(
self
.
X
,
pos
=
(
0
,
3
))
fieldsizer
.
Add
(
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Y (px):"
),
pos
=
(
1
,
2
),
flag
=
wx
.
ALIGN_CENTER_VERTICAL
)
fieldsizer
.
Add
(
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Y (px):"
),
pos
=
(
1
,
2
),
flag
=
wx
.
ALIGN_CENTER_VERTICAL
)
self
.
Y
=
wx
.
SpinCtrl
(
self
.
panel
,
-
1
,
str
(
int
(
self
.
_get_setting
(
"project_y"
,
1200
))),
max
=
999999
,
size
=
(
80
,
-
1
))
projectY
=
int
(
math
.
floor
(
float
(
self
.
_get_setting
(
"project_y"
,
1200
))))
self
.
Y
=
wx
.
SpinCtrl
(
self
.
panel
,
-
1
,
str
(
projectY
),
max
=
999999
,
size
=
(
80
,
-
1
))
self
.
Y
.
Bind
(
wx
.
EVT_SPINCTRL
,
self
.
update_resolution
)
self
.
Y
.
Bind
(
wx
.
EVT_SPINCTRL
,
self
.
update_resolution
)
self
.
Y
.
SetHelpText
(
"The projector resolution in the Y axis."
)
self
.
Y
.
SetHelpText
(
"The projector resolution in the Y axis."
)
fieldsizer
.
Add
(
self
.
Y
,
pos
=
(
1
,
3
))
fieldsizer
.
Add
(
self
.
Y
,
pos
=
(
1
,
3
))
...
@@ -452,6 +455,7 @@ class SettingsFrame(wx.Frame):
...
@@ -452,6 +455,7 @@ class SettingsFrame(wx.Frame):
self
.
SetPosition
((
0
,
0
))
self
.
SetPosition
((
0
,
0
))
self
.
Show
()
self
.
Show
()
def
__del__
(
self
):
def
__del__
(
self
):
if
hasattr
(
self
,
'image_dir'
)
and
self
.
image_dir
!=
''
:
if
hasattr
(
self
,
'image_dir'
)
and
self
.
image_dir
!=
''
:
shutil
.
rmtree
(
self
.
image_dir
)
shutil
.
rmtree
(
self
.
image_dir
)
...
@@ -751,8 +755,8 @@ class SettingsFrame(wx.Frame):
...
@@ -751,8 +755,8 @@ class SettingsFrame(wx.Frame):
self
.
refresh_display
(
event
)
self
.
refresh_display
(
event
)
def
update_resolution
(
self
,
event
):
def
update_resolution
(
self
,
event
):
x
=
floa
t
(
self
.
X
.
GetValue
())
x
=
in
t
(
self
.
X
.
GetValue
())
y
=
floa
t
(
self
.
Y
.
GetValue
())
y
=
in
t
(
self
.
Y
.
GetValue
())
self
.
display_frame
.
resize
((
x
,
y
))
self
.
display_frame
.
resize
((
x
,
y
))
self
.
_set_setting
(
'project_x'
,
x
)
self
.
_set_setting
(
'project_x'
,
x
)
self
.
_set_setting
(
'project_y'
,
y
)
self
.
_set_setting
(
'project_y'
,
y
)
...
...
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