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
e494faa6
Commit
e494faa6
authored
Apr 02, 2016
by
Kliment Yanev
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:kliment/Printrun
parents
9615e7bc
df58e5bc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
116 additions
and
16 deletions
+116
-16
README.md
README.md
+1
-1
plater.py
plater.py
+25
-0
printcore.py
printcore.py
+41
-13
stlplater.py
printrun/stlplater.py
+2
-2
pronsole.py
pronsole.py
+23
-0
pronterface.py
pronterface.py
+24
-0
No files found.
README.md
View file @
e494faa6
...
@@ -23,7 +23,7 @@ A precompiled version is available at http://koti.kapsi.fi/~kliment/printrun/
...
@@ -23,7 +23,7 @@ A precompiled version is available at http://koti.kapsi.fi/~kliment/printrun/
You can run Printrun directly from source, as there are no packages available yet. Fetch and install the dependencies using
You can run Printrun directly from source, as there are no packages available yet. Fetch and install the dependencies using
1.
`sudo apt-get install python-serial python-wxgtk2.8 python-pyglet python-numpy cython python-libxml2 python-gobject python-dbus python-psutil git`
1.
`sudo apt-get install python-serial python-wxgtk2.8 python-pyglet python-numpy cython python-libxml2 python-gobject python-dbus python-psutil
python-cairosvg
git`
Clone the repository
Clone the repository
...
...
plater.py
View file @
e494faa6
...
@@ -17,10 +17,35 @@
...
@@ -17,10 +17,35 @@
import
sys
import
sys
import
wx
import
wx
import
getopt
from
printrun.stlplater
import
StlPlater
from
printrun.stlplater
import
StlPlater
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
from
printrun.printcore
import
__version__
as
printcore_version
usage
=
"Usage:
\n
"
+
\
" plater [OPTION]
\n
"
+
\
" plater FILES
\n\n
"
+
\
"Options:
\n
"
+
\
" -V, --version
\t\t\t
Print program's version number and exit
\n
"
+
\
" -h, --help
\t\t\t
Print this help message and exit
\n
"
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"hV"
,
[
"help"
,
"version"
])
except
getopt
.
GetoptError
,
err
:
print
str
(
err
)
print
usage
sys
.
exit
(
2
)
for
o
,
a
in
opts
:
if
o
in
(
'-V'
,
'--version'
):
print
"printrun "
+
printcore_version
sys
.
exit
(
0
)
elif
o
in
(
'-h'
,
'--help'
):
print
usage
sys
.
exit
(
0
)
app
=
wx
.
App
(
False
)
app
=
wx
.
App
(
False
)
main
=
StlPlater
(
filenames
=
sys
.
argv
[
1
:])
main
=
StlPlater
(
filenames
=
sys
.
argv
[
1
:])
main
.
Show
()
main
.
Show
()
...
...
printcore.py
View file @
e494faa6
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
import
time
import
time
import
getopt
import
getopt
import
sys
import
sys
import
getopt
from
printrun.printcore
import
printcore
from
printrun.printcore
import
printcore
from
printrun.utils
import
setup_logging
from
printrun.utils
import
setup_logging
...
@@ -28,32 +29,59 @@ if __name__ == '__main__':
...
@@ -28,32 +29,59 @@ if __name__ == '__main__':
baud
=
115200
baud
=
115200
loud
=
False
loud
=
False
statusreport
=
False
statusreport
=
False
from
printrun.printcore
import
__version__
as
printcore_version
usage
=
"Usage:
\n
"
+
\
" printcore [OPTIONS] PORT FILE
\n\n
"
+
\
"Options:
\n
"
+
\
" -b, --baud=BAUD_RATE"
+
\
"
\t\t
Set baud rate value. Default value is 115200
\n
"
+
\
" -s, --statusreport
\t\t
Print progress as percentage
\n
"
+
\
" -v, --verbose
\t\t\t
Print additional progress information
\n
"
+
\
" -V, --version
\t\t\t
Print program's version number and exit
\n
"
+
\
" -h, --help
\t\t\t
Print this help message and exit
\n
"
try
:
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"
h,b:,v,s
"
,
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"
b:svVh
"
,
[
"help"
,
"baud"
,
"verbose"
,
"statusreport
"
])
[
"baud="
,
"statusreport"
,
"verbose"
,
"version"
,
"help
"
])
except
getopt
.
GetoptError
,
err
:
except
getopt
.
GetoptError
,
err
:
print
str
(
err
)
print
str
(
err
)
print
usage
sys
.
exit
(
2
)
sys
.
exit
(
2
)
for
o
,
a
in
opts
:
for
o
,
a
in
opts
:
if
o
in
(
'-h'
,
'--help'
):
if
o
in
(
'-h'
,
'--help'
):
# FIXME: Fix help
print
usage
print
(
"Opts are: --help, -b --baud = baudrate, -v --verbose, "
sys
.
exit
(
0
)
"-s --statusreport"
)
elif
o
in
(
'-V'
,
'--version'
):
sys
.
exit
(
1
)
print
"printrun "
+
printcore_version
if
o
in
(
'-b'
,
'--baud'
):
sys
.
exit
(
0
)
baud
=
int
(
a
)
elif
o
in
(
'-b'
,
'--baud'
):
if
o
in
(
'-v'
,
'--verbose'
):
try
:
baud
=
int
(
a
)
except
ValueError
:
print
"ValueError:"
print
"
\t
Invalid BAUD_RATE value '
%
s'"
%
a
print
"
\t
BAUD_RATE must be an integer
\n
"
# FIXME: This should output a more apropiate error message when
# not a good baud rate is passed as an argument
# i.e: when baud <= 1000 or > 225000
print
usage
sys
.
exit
(
2
)
elif
o
in
(
'-v'
,
'--verbose'
):
loud
=
True
loud
=
True
elif
o
in
(
'-s'
,
'--statusreport'
):
elif
o
in
(
'-s'
,
'--statusreport'
):
statusreport
=
True
statusreport
=
True
if
len
(
args
)
>
1
:
if
len
(
args
)
<=
1
:
print
"Error: Port or gcode file were not specified.
\n
"
print
usage
sys
.
exit
(
2
)
elif
len
(
args
)
>
1
:
port
=
args
[
-
2
]
port
=
args
[
-
2
]
filename
=
args
[
-
1
]
filename
=
args
[
-
1
]
print
"Printing:
%
s on
%
s with baudrate
%
d"
%
(
filename
,
port
,
baud
)
print
"Printing:
%
s on
%
s with baudrate
%
d"
%
(
filename
,
port
,
baud
)
else
:
print
"Usage: python [-h|-b|-v|-s] printcore.py /dev/tty[USB|ACM]x filename.gcode"
sys
.
exit
(
2
)
p
=
printcore
(
port
,
baud
)
p
=
printcore
(
port
,
baud
)
p
.
loud
=
loud
p
.
loud
=
loud
time
.
sleep
(
2
)
time
.
sleep
(
2
)
...
...
printrun/stlplater.py
View file @
e494faa6
...
@@ -482,9 +482,9 @@ class StlPlaterPanel(PlaterPanel):
...
@@ -482,9 +482,9 @@ class StlPlaterPanel(PlaterPanel):
logging
.
warning
(
_
(
"Failed to use simarrange for plating, "
logging
.
warning
(
_
(
"Failed to use simarrange for plating, "
"falling back to the standard method. "
"falling back to the standard method. "
"The error was: "
)
+
e
)
"The error was: "
)
+
e
)
super
(
StlPlater
,
self
)
.
autoplate
()
super
(
StlPlater
Panel
,
self
)
.
autoplate
()
else
:
else
:
super
(
StlPlater
,
self
)
.
autoplate
()
super
(
StlPlater
Panel
,
self
)
.
autoplate
()
def
autoplate_simarrange
(
self
):
def
autoplate_simarrange
(
self
):
logging
.
info
(
_
(
"Autoplating using simarrange"
))
logging
.
info
(
_
(
"Autoplating using simarrange"
))
...
...
pronsole.py
View file @
e494faa6
...
@@ -19,9 +19,32 @@ import sys
...
@@ -19,9 +19,32 @@ import sys
import
traceback
import
traceback
import
logging
import
logging
from
printrun.pronsole
import
pronsole
from
printrun.pronsole
import
pronsole
import
getopt
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
from
printrun.printcore
import
__version__
as
printcore_version
usage
=
"Usage:
\n
"
+
\
" pronsole [OPTION]
\n\n
"
+
\
"Options:
\n
"
+
\
" -V, --version
\t\t\t
Print program's version number and exit
\n
"
+
\
" -h, --help
\t\t\t
Print this help message and exit
\n
"
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"hV"
,
[
"help"
,
"version"
])
except
getopt
.
GetoptError
,
err
:
print
str
(
err
)
print
usage
sys
.
exit
(
2
)
for
o
,
a
in
opts
:
if
o
in
(
'-V'
,
'--version'
):
print
"printrun "
+
printcore_version
sys
.
exit
(
0
)
elif
o
in
(
'-h'
,
'--help'
):
print
usage
sys
.
exit
(
0
)
interp
=
pronsole
()
interp
=
pronsole
()
interp
.
parse_cmdline
(
sys
.
argv
[
1
:])
interp
.
parse_cmdline
(
sys
.
argv
[
1
:])
try
:
try
:
...
...
pronterface.py
View file @
e494faa6
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
import
sys
import
sys
import
getopt
try
:
try
:
import
wx
# NOQA
import
wx
# NOQA
...
@@ -32,6 +33,29 @@ not yet available for python3. You should try running with python2 instead.""")
...
@@ -32,6 +33,29 @@ not yet available for python3. You should try running with python2 instead.""")
from
printrun.pronterface
import
PronterApp
from
printrun.pronterface
import
PronterApp
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
from
printrun.printcore
import
__version__
as
printcore_version
usage
=
"Usage:
\n
"
+
\
" pronterface [OPTION]
\n\n
"
+
\
"Options:
\n
"
+
\
" -V, --version
\t\t\t
Print program's version number and exit
\n
"
+
\
" -h, --help
\t\t\t
Print this help message and exit
\n
"
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"hV"
,
[
"help"
,
"version"
])
except
getopt
.
GetoptError
,
err
:
print
str
(
err
)
print
usage
sys
.
exit
(
2
)
for
o
,
a
in
opts
:
if
o
in
(
'-V'
,
'--version'
):
print
"printrun "
+
printcore_version
sys
.
exit
(
0
)
elif
o
in
(
'-h'
,
'--help'
):
print
usage
sys
.
exit
(
0
)
app
=
PronterApp
(
False
)
app
=
PronterApp
(
False
)
try
:
try
:
app
.
MainLoop
()
app
.
MainLoop
()
...
...
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