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
b4cc74f8
Commit
b4cc74f8
authored
Aug 02, 2012
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor serial connection improvement
parent
ffd655d8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
printcore.py
printrun/printcore.py
+6
-3
No files found.
printrun/printcore.py
View file @
b4cc74f8
...
@@ -74,7 +74,7 @@ class printcore():
...
@@ -74,7 +74,7 @@ class printcore():
if
baud
is
not
None
:
if
baud
is
not
None
:
self
.
baud
=
baud
self
.
baud
=
baud
if
self
.
port
is
not
None
and
self
.
baud
is
not
None
:
if
self
.
port
is
not
None
and
self
.
baud
is
not
None
:
self
.
printer
=
Serial
(
self
.
port
,
self
.
baud
,
timeout
=
5
)
self
.
printer
=
Serial
(
port
=
self
.
port
,
baudrate
=
self
.
baud
,
timeout
=
5
)
Thread
(
target
=
self
.
_listen
)
.
start
()
Thread
(
target
=
self
.
_listen
)
.
start
()
def
reset
(
self
):
def
reset
(
self
):
...
@@ -89,8 +89,11 @@ class printcore():
...
@@ -89,8 +89,11 @@ class printcore():
"""This function acts on messages from the firmware
"""This function acts on messages from the firmware
"""
"""
self
.
clear
=
True
self
.
clear
=
True
time
.
sleep
(
1.0
)
if
self
.
printer
.
inWaiting
():
# flush receive buffer
if
(
not
self
.
online
and
not
self
.
printing
):
self
.
printer
.
read
(
self
.
printer
.
inWaiting
())
while
not
self
.
printer
.
inWaiting
():
# wait for new data to read
time
.
sleep
(
0.5
)
if
(
not
self
.
online
and
not
self
.
printing
):
# send M105 to initiate connection
self
.
_send
(
"M105"
)
self
.
_send
(
"M105"
)
while
(
True
):
while
(
True
):
if
(
not
self
.
printer
or
not
self
.
printer
.
isOpen
):
if
(
not
self
.
printer
or
not
self
.
printer
.
isOpen
):
...
...
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