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
6a006d78
Commit
6a006d78
authored
Aug 03, 2012
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup
parent
898a43e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
33 deletions
+31
-33
printcore.py
printrun/printcore.py
+31
-33
No files found.
printrun/printcore.py
View file @
6a006d78
...
@@ -292,55 +292,53 @@ class printcore():
...
@@ -292,55 +292,53 @@ class printcore():
#callback for printing done
#callback for printing done
def
_sendnext
(
self
):
def
_sendnext
(
self
):
if
(
not
self
.
printer
)
:
if
not
self
.
printer
:
return
return
while
self
.
printer
and
self
.
printing
and
not
self
.
clear
:
while
self
.
printer
and
self
.
printing
and
not
self
.
clear
:
time
.
sleep
(
0.001
)
time
.
sleep
(
0.001
)
self
.
clear
=
False
self
.
clear
=
False
if
not
(
self
.
printing
and
self
.
printer
and
self
.
online
):
if
not
(
self
.
printing
and
self
.
printer
and
self
.
online
):
self
.
clear
=
True
self
.
clear
=
True
return
return
if
(
self
.
resendfrom
<
self
.
lineno
and
self
.
resendfrom
>-
1
)
:
if
self
.
resendfrom
<
self
.
lineno
and
self
.
resendfrom
>
-
1
:
self
.
_send
(
self
.
sentlines
[
self
.
resendfrom
],
self
.
resendfrom
,
False
)
self
.
_send
(
self
.
sentlines
[
self
.
resendfrom
],
self
.
resendfrom
,
False
)
self
.
resendfrom
+=
1
self
.
resendfrom
+=
1
return
return
self
.
resendfrom
=
-
1
self
.
resendfrom
=
-
1
for
i
in
self
.
priqueue
[:]:
for
i
in
self
.
priqueue
[:]:
self
.
_send
(
i
)
self
.
_send
(
i
)
del
(
self
.
priqueue
[
0
])
del
self
.
priqueue
[
0
]
return
return
if
(
self
.
printing
and
self
.
queueindex
<
len
(
self
.
mainqueue
)
):
if
self
.
printing
and
self
.
queueindex
<
len
(
self
.
mainqueue
):
tline
=
self
.
mainqueue
[
self
.
queueindex
]
tline
=
self
.
mainqueue
[
self
.
queueindex
]
tline
=
tline
.
split
(
";"
)[
0
]
tline
=
tline
.
split
(
";"
)[
0
]
if
(
len
(
tline
)
>
0
)
:
if
len
(
tline
)
>
0
:
self
.
_send
(
tline
,
self
.
lineno
,
True
)
self
.
_send
(
tline
,
self
.
lineno
,
True
)
self
.
lineno
+=
1
self
.
lineno
+=
1
else
:
else
:
self
.
clear
=
True
self
.
clear
=
True
self
.
queueindex
+=
1
self
.
queueindex
+=
1
else
:
else
:
self
.
printing
=
False
self
.
printing
=
False
self
.
clear
=
True
self
.
clear
=
True
if
(
not
self
.
paused
)
:
if
not
self
.
paused
:
self
.
queueindex
=
0
self
.
queueindex
=
0
self
.
lineno
=
0
self
.
lineno
=
0
self
.
_send
(
"M110"
,
-
1
,
True
)
self
.
_send
(
"M110"
,
-
1
,
True
)
def
_send
(
self
,
command
,
lineno
=
0
,
calcchecksum
=
False
):
def
_send
(
self
,
command
,
lineno
=
0
,
calcchecksum
=
False
):
if
(
calcchecksum
)
:
if
calcchecksum
:
prefix
=
"N"
+
str
(
lineno
)
+
" "
+
command
prefix
=
"N"
+
str
(
lineno
)
+
" "
+
command
command
=
prefix
+
"*"
+
str
(
self
.
_checksum
(
prefix
))
command
=
prefix
+
"*"
+
str
(
self
.
_checksum
(
prefix
))
if
(
"M110"
not
in
command
)
:
if
"M110"
not
in
command
:
self
.
sentlines
[
lineno
]
=
command
self
.
sentlines
[
lineno
]
=
command
if
(
self
.
printer
)
:
if
self
.
printer
:
self
.
sent
+=
[
command
]
self
.
sent
.
append
(
command
)
if
self
.
loud
:
if
self
.
loud
:
print
"SENT: "
,
command
print
"SENT: "
,
command
if
self
.
sendcb
is
not
None
:
if
self
.
sendcb
is
not
None
:
try
:
try
:
self
.
sendcb
(
command
)
self
.
sendcb
(
command
)
except
:
pass
except
:
pass
try
:
try
:
self
.
printer
.
write
(
str
(
command
+
"
\n
"
))
self
.
printer
.
write
(
str
(
command
+
"
\n
"
))
except
SerialException
,
e
:
except
SerialException
,
e
:
...
...
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