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
d56973d0
Commit
d56973d0
authored
Jun 28, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'experimental' of github.com:kliment/Printrun into experimental
parents
25ab41f3
e49db513
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
prontserve.py
prontserve.py
+14
-2
No files found.
prontserve.py
View file @
d56973d0
...
@@ -365,6 +365,7 @@ class Prontserve(pronsole.pronsole, EventEmitter):
...
@@ -365,6 +365,7 @@ class Prontserve(pronsole.pronsole, EventEmitter):
self
.
silent
=
True
self
.
silent
=
True
self
.
_sensor_update_received
=
True
self
.
_sensor_update_received
=
True
self
.
max_w_val
=
0
self
.
max_w_val
=
0
self
.
waiting_to_reach_temp
=
False
self
.
p
.
sendcb
=
self
.
sendcb
self
.
p
.
sendcb
=
self
.
sendcb
self
.
init_mdns
()
self
.
init_mdns
()
self
.
jobs
.
listeners
.
add
(
self
)
self
.
jobs
.
listeners
.
add
(
self
)
...
@@ -417,6 +418,7 @@ class Prontserve(pronsole.pronsole, EventEmitter):
...
@@ -417,6 +418,7 @@ class Prontserve(pronsole.pronsole, EventEmitter):
def
do_estop
(
self
):
def
do_estop
(
self
):
self
.
printing_jobs
=
False
self
.
printing_jobs
=
False
self
.
current_job
=
None
self
.
current_job
=
None
self
.
waiting_to_reach_temp
=
False
# pause the print job if any is printing
# pause the print job if any is printing
if
self
.
p
.
printing
:
if
self
.
p
.
printing
:
pronsole
.
pronsole
.
do_pause
(
self
,
""
)
pronsole
.
pronsole
.
do_pause
(
self
,
""
)
...
@@ -538,7 +540,14 @@ class Prontserve(pronsole.pronsole, EventEmitter):
...
@@ -538,7 +540,14 @@ class Prontserve(pronsole.pronsole, EventEmitter):
return
0
return
0
def
run_sensor_loop
(
self
):
def
run_sensor_loop
(
self
):
if
self
.
_sensor_update_received
and
(
time
.
time
()
-
self
.
reset_timeout
)
>
0
:
# A number of conditions that must be met for us to send a temperature
# request to the printer. This safeguards this printer from being overloaded
# by temperature requests it cannot presently respond to.
ready
=
self
.
_sensor_update_received
ready
=
ready
and
(
time
.
time
()
-
self
.
reset_timeout
)
>
0
ready
=
ready
and
(
not
self
.
waiting_to_reach_temp
)
if
ready
:
self
.
_sensor_update_received
=
False
self
.
_sensor_update_received
=
False
if
self
.
dry_run
:
if
self
.
dry_run
:
self
.
_receive_sensor_update
(
"ok T:
%
i"
%
random
.
randint
(
20
,
50
))
self
.
_receive_sensor_update
(
"ok T:
%
i"
%
random
.
randint
(
20
,
50
))
...
@@ -554,6 +563,8 @@ class Prontserve(pronsole.pronsole, EventEmitter):
...
@@ -554,6 +563,8 @@ class Prontserve(pronsole.pronsole, EventEmitter):
""" Parses a line of output from the printer via printcore """
""" Parses a line of output from the printer via printcore """
l
=
l
.
rstrip
()
l
=
l
.
rstrip
()
#print l
#print l
if
self
.
waiting_to_reach_temp
and
(
"ok"
in
l
):
self
.
waiting_to_reach_temp
=
False
if
"T:"
in
l
:
if
"T:"
in
l
:
self
.
_receive_sensor_update
(
l
)
self
.
_receive_sensor_update
(
l
)
if
l
!=
"ok"
and
not
l
.
startswith
(
"ok T"
)
and
not
l
.
startswith
(
"T:"
):
if
l
!=
"ok"
and
not
l
.
startswith
(
"ok T"
)
and
not
l
.
startswith
(
"T:"
):
...
@@ -563,7 +574,8 @@ class Prontserve(pronsole.pronsole, EventEmitter):
...
@@ -563,7 +574,8 @@ class Prontserve(pronsole.pronsole, EventEmitter):
# Monitor the sent commands for new extruder target temperatures
# Monitor the sent commands for new extruder target temperatures
if
(
"M109"
in
l
)
or
(
"M104"
in
l
):
if
(
"M109"
in
l
)
or
(
"M104"
in
l
):
temp
=
float
(
re
.
search
(
'S([0-9]+)'
,
l
)
.
group
(
1
))
temp
=
float
(
re
.
search
(
'S([0-9]+)'
,
l
)
.
group
(
1
))
self
.
_set_target_temp
(
"e0"
,
temp
)
self
.
_set_target_temp
(
"e0"
,
temp
)
self
.
waiting_to_reach_temp
=
True
def
_set_target_temp
(
self
,
key
,
temp
):
def
_set_target_temp
(
self
,
key
,
temp
):
self
.
target_values
[
key
]
=
temp
self
.
target_values
[
key
]
=
temp
...
...
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