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
7a374952
Commit
7a374952
authored
May 22, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build dimensions settings parser
parent
3ac85be7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
13 deletions
+6
-13
pronterface.py
pronterface.py
+6
-13
No files found.
pronterface.py
View file @
7a374952
...
@@ -89,18 +89,9 @@ def parse_build_dimensions(bdim):
...
@@ -89,18 +89,9 @@ def parse_build_dimensions(bdim):
# "XXXxYYY+xxx-yyy"
# "XXXxYYY+xxx-yyy"
# "XXX,YYY,ZZZ+xxx+yyy-zzz"
# "XXX,YYY,ZZZ+xxx+yyy-zzz"
# etc
# etc
bdl
=
re
.
match
(
bdl
=
re
.
findall
(
"([-+]?[0-9]*
\
.?[0-9]*)"
,
bdim
)
"[^
\
d+-]*(
\
d+)?"
+
# X build size
"[^
\
d+-]*(
\
d+)?"
+
# Y build size
"[^
\
d+-]*(
\
d+)?"
+
# Z build size
"[^
\
d+-]*([+-]
\
d+)?"
+
# X corner coordinate
"[^
\
d+-]*([+-]
\
d+)?"
+
# Y corner coordinate
"[^
\
d+-]*([+-]
\
d+)?"
+
# Z corner coordinate
"[^
\
d+-]*([+-]
\
d+)?"
+
# X endstop
"[^
\
d+-]*([+-]
\
d+)?"
+
# Y endstop
"[^
\
d+-]*([+-]
\
d+)?"
# Z endstop
,
bdim
)
.
groups
()
defaults
=
[
200
,
200
,
100
,
0
,
0
,
0
,
0
,
0
,
0
]
defaults
=
[
200
,
200
,
100
,
0
,
0
,
0
,
0
,
0
,
0
]
bdl
=
filter
(
None
,
bdl
)
bdl_float
=
[
float
(
value
)
if
value
else
defaults
[
i
]
for
i
,
value
in
enumerate
(
bdl
)]
bdl_float
=
[
float
(
value
)
if
value
else
defaults
[
i
]
for
i
,
value
in
enumerate
(
bdl
)]
return
bdl_float
return
bdl_float
...
@@ -116,7 +107,8 @@ class BuildDimensionsSetting(wxSetting):
...
@@ -116,7 +107,8 @@ class BuildDimensionsSetting(wxSetting):
def
_set_widgets_values
(
self
,
value
):
def
_set_widgets_values
(
self
,
value
):
build_dimensions_list
=
parse_build_dimensions
(
value
)
build_dimensions_list
=
parse_build_dimensions
(
value
)
for
i
in
range
(
len
(
widgets
)):
print
build_dimensions_list
for
i
in
range
(
len
(
self
.
widgets
)):
self
.
widgets
[
i
]
.
SetValue
(
build_dimensions_list
[
i
])
self
.
widgets
[
i
]
.
SetValue
(
build_dimensions_list
[
i
])
def
get_widget
(
self
,
parent
):
def
get_widget
(
self
,
parent
):
...
@@ -158,7 +150,8 @@ class BuildDimensionsSetting(wxSetting):
...
@@ -158,7 +150,8 @@ class BuildDimensionsSetting(wxSetting):
return
self
.
widget
return
self
.
widget
def
update
(
self
):
def
update
(
self
):
self
.
value
=
"
%.02
fx
%.02
fx
%.02
f+
%.02
f+
%.02
f+
%.02
f+
%.02
f+
%.02
f+
%.02
f"
%
(
w
.
GetValue
()
for
w
in
self
.
widgets
)
values
=
[
w
.
GetValue
()
for
w
in
self
.
widgets
]
self
.
value
=
"
%.02
fx
%.02
fx
%.02
f+
%.02
f+
%.02
f+
%.02
f+
%.02
f+
%.02
f+
%.02
f"
%
tuple
(
values
)
class
StringSetting
(
wxSetting
):
class
StringSetting
(
wxSetting
):
...
...
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