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
17894653
Commit
17894653
authored
Aug 26, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Append config load calls based on selected presets for Slic3r integration
parent
04dbebe8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
pronterface.py
printrun/pronterface.py
+14
-2
No files found.
printrun/pronterface.py
View file @
17894653
...
...
@@ -724,14 +724,20 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self
.
app
.
SetAppName
(
"Slic3r"
)
configpath
=
wx
.
StandardPaths
.
Get
()
.
GetUserDataDir
()
self
.
app
.
SetAppName
(
orig_appname
)
self
.
slic3r_configpath
=
configpath
configfile
=
os
.
path
.
join
(
configpath
,
"slic3r.ini"
)
config
=
self
.
read_slic3r_config
(
configfile
)
self
.
slic3r_configs
=
{}
for
cat
in
menus
:
menu
=
menus
[
cat
]
pattern
=
os
.
path
.
join
(
configpath
,
cat
,
"*.ini"
)
files
=
sorted
(
glob
.
glob
(
pattern
))
try
:
preset
=
config
.
get
(
"presets"
,
cat
)
except
:
preset
=
None
try
:
preset
=
config
.
get
(
"presets"
,
cat
)
self
.
slic3r_configs
[
cat
]
=
preset
except
:
preset
=
None
self
.
slic3r_configs
[
cat
]
=
None
for
f
in
files
:
name
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
f
))[
0
]
item
=
menu
.
Append
(
-
1
,
name
,
f
,
wx
.
ITEM_RADIO
)
...
...
@@ -759,6 +765,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
return
parser
def
set_slic3r_config
(
self
,
configfile
,
cat
,
file
):
self
.
slic3r_configs
[
cat
]
=
file
if
self
.
settings
.
slic3rupdate
:
config
=
self
.
read_slic3r_config
(
configfile
)
config
.
set
(
"presets"
,
cat
,
os
.
path
.
basename
(
file
))
...
...
@@ -1593,6 +1600,11 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
param
=
self
.
expandcommand
(
self
.
settings
.
slicecommand
)
output_filename
=
self
.
model_to_gcode_filename
(
self
.
filename
)
pararray
=
[
i
.
replace
(
"$s"
,
self
.
filename
)
.
replace
(
"$o"
,
output_filename
)
for
i
in
shlex
.
split
(
param
.
replace
(
"
\\
"
,
"
\\\\
"
))]
if
self
.
settings
.
slic3rintegration
:
for
cat
,
config
in
self
.
slic3r_configs
.
items
():
if
config
:
fpath
=
os
.
path
.
join
(
self
.
slic3r_configpath
,
cat
,
config
)
pararray
+=
[
"--load"
,
fpath
]
print
"Slicing: "
+
" "
.
join
(
pararray
)
self
.
skeinp
=
subprocess
.
Popen
(
pararray
,
stderr
=
subprocess
.
STDOUT
,
stdout
=
subprocess
.
PIPE
)
while
True
:
...
...
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