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
4728fd1f
Commit
4728fd1f
authored
Nov 05, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factorize gcode loading in pronsole and pronterface
parent
ee16eeba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
pronsole.py
printrun/pronsole.py
+5
-1
pronterface.py
printrun/pronterface.py
+3
-6
No files found.
printrun/pronsole.py
View file @
4728fd1f
...
@@ -897,10 +897,14 @@ class pronsole(cmd.Cmd):
...
@@ -897,10 +897,14 @@ class pronsole(cmd.Cmd):
if
not
os
.
path
.
exists
(
filename
):
if
not
os
.
path
.
exists
(
filename
):
self
.
logError
(
"File not found!"
)
self
.
logError
(
"File not found!"
)
return
return
self
.
load_gcode
(
filename
)
self
.
log
(
"Loaded
%
s,
%
d lines."
%
(
filename
,
len
(
self
.
fgcode
)))
def
load_gcode
(
self
,
filename
):
self
.
fgcode
=
gcoder
.
GCode
(
open
(
filename
,
"rU"
),
self
.
fgcode
=
gcoder
.
GCode
(
open
(
filename
,
"rU"
),
get_home_pos
(
self
.
build_dimensions_list
))
get_home_pos
(
self
.
build_dimensions_list
))
self
.
fgcode
.
estimate_duration
()
self
.
filename
=
filename
self
.
filename
=
filename
self
.
log
(
"Loaded
%
s,
%
d lines."
%
(
filename
,
len
(
self
.
fgcode
)))
def
complete_load
(
self
,
text
,
line
,
begidx
,
endidx
):
def
complete_load
(
self
,
text
,
line
,
begidx
,
endidx
):
s
=
line
.
split
()
s
=
line
.
split
()
...
...
printrun/pronterface.py
View file @
4728fd1f
...
@@ -30,8 +30,7 @@ import logging
...
@@ -30,8 +30,7 @@ import logging
from
.
import
pronsole
from
.
import
pronsole
from
.
import
printcore
from
.
import
printcore
from
printrun.printrun_utils
import
install_locale
,
setup_logging
,
\
from
printrun.printrun_utils
import
install_locale
,
setup_logging
get_home_pos
install_locale
(
'pronterface'
)
install_locale
(
'pronterface'
)
try
:
try
:
...
@@ -1511,8 +1510,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1511,8 +1510,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
fn
=
self
.
filename
fn
=
self
.
filename
try
:
try
:
self
.
filename
=
self
.
model_to_gcode_filename
(
self
.
filename
)
self
.
filename
=
self
.
model_to_gcode_filename
(
self
.
filename
)
self
.
fgcode
=
gcoder
.
GCode
(
open
(
self
.
filename
,
"rU"
),
self
.
load_gcode
(
self
.
filename
)
get_home_pos
(
self
.
build_dimensions_list
))
if
self
.
p
.
online
:
if
self
.
p
.
online
:
wx
.
CallAfter
(
self
.
printbtn
.
Enable
)
wx
.
CallAfter
(
self
.
printbtn
.
Enable
)
...
@@ -1582,8 +1580,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1582,8 +1580,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self
.
skein
(
name
)
self
.
skein
(
name
)
else
:
else
:
self
.
filename
=
name
self
.
filename
=
name
self
.
fgcode
=
gcoder
.
GCode
(
open
(
self
.
filename
,
"rU"
),
self
.
load_gcode
(
self
.
filename
)
get_home_pos
(
self
.
build_dimensions_list
))
self
.
statusbar
.
SetStatusText
(
_
(
"Loaded
%
s,
%
d lines"
)
%
(
name
,
len
(
self
.
fgcode
)))
self
.
statusbar
.
SetStatusText
(
_
(
"Loaded
%
s,
%
d lines"
)
%
(
name
,
len
(
self
.
fgcode
)))
print
_
(
"Loaded
%
s,
%
d lines"
)
%
(
name
,
len
(
self
.
fgcode
))
print
_
(
"Loaded
%
s,
%
d lines"
)
%
(
name
,
len
(
self
.
fgcode
))
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
_
(
"Print"
))
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
_
(
"Print"
))
...
...
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