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
6f7ecce7
Commit
6f7ecce7
authored
Aug 06, 2012
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve responsivity by reducing sleep times
parent
04060416
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
printcore.py
printcore.py
+2
-2
pronterface.py
pronterface.py
+5
-1
No files found.
printcore.py
View file @
6f7ecce7
...
@@ -94,7 +94,7 @@ class printcore():
...
@@ -94,7 +94,7 @@ class printcore():
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
:
disable_hup
(
self
.
port
)
disable_hup
(
self
.
port
)
self
.
printer
=
Serial
(
port
=
self
.
port
,
baudrate
=
self
.
baud
,
timeout
=
1
)
self
.
printer
=
Serial
(
port
=
self
.
port
,
baudrate
=
self
.
baud
,
timeout
=
0.25
)
self
.
stop_read_thread
=
False
self
.
stop_read_thread
=
False
self
.
read_thread
=
Thread
(
target
=
self
.
_listen
)
self
.
read_thread
=
Thread
(
target
=
self
.
_listen
)
self
.
read_thread
.
start
()
self
.
read_thread
.
start
()
...
@@ -146,7 +146,7 @@ class printcore():
...
@@ -146,7 +146,7 @@ class printcore():
except
:
pass
except
:
pass
self
.
online
=
True
self
.
online
=
True
return
return
time
.
sleep
(
0.5
)
time
.
sleep
(
0.
2
5
)
def
_listen
(
self
):
def
_listen
(
self
):
"""This function acts on messages from the firmware
"""This function acts on messages from the firmware
...
...
pronterface.py
View file @
6f7ecce7
...
@@ -1367,7 +1367,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -1367,7 +1367,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
auto_monitor_pattern
=
re
.
compile
(
r"(ok\s+)?T:[\d\.]+(\s+B:[\d\.]+)?(\s+@:[\d\.]+)?\s*"
)
self
.
auto_monitor_pattern
=
re
.
compile
(
r"(ok\s+)?T:[\d\.]+(\s+B:[\d\.]+)?(\s+@:[\d\.]+)?\s*"
)
self
.
capture_skip
[
self
.
auto_monitor_pattern
]
=
self
.
capture_skip
.
setdefault
(
self
.
auto_monitor_pattern
,
0
)
+
1
self
.
capture_skip
[
self
.
auto_monitor_pattern
]
=
self
.
capture_skip
.
setdefault
(
self
.
auto_monitor_pattern
,
0
)
+
1
self
.
p
.
send_now
(
"M105"
)
self
.
p
.
send_now
(
"M105"
)
time
.
sleep
(
self
.
monitor_interval
)
cur_time
=
time
.
time
()
while
time
.
time
()
<
cur_time
+
self
.
monitor_interval
:
if
not
self
.
statuscheck
:
break
time
.
sleep
(
0.25
)
while
not
self
.
sentlines
.
empty
():
while
not
self
.
sentlines
.
empty
():
try
:
try
:
gc
=
self
.
sentlines
.
get_nowait
()
gc
=
self
.
sentlines
.
get_nowait
()
...
...
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