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
d2c59593
Commit
d2c59593
authored
Jul 08, 2013
by
D1plo1d
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing prontserve's estop so it updates all the client's pushed values.
parent
a33d62e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
prontserve.py
prontserve.py
+21
-5
No files found.
prontserve.py
View file @
d2c59593
...
@@ -479,6 +479,21 @@ class Prontserve(pronsole.pronsole, EventEmitter):
...
@@ -479,6 +479,21 @@ class Prontserve(pronsole.pronsole, EventEmitter):
raise
Exception
(
"Continuous movement not supported"
)
raise
Exception
(
"Continuous movement not supported"
)
def
do_estop
(
self
):
def
do_estop
(
self
):
self
.
reset
()
print
"Emergency Stop!"
self
.
fire
(
"estop"
)
# Updating the job progress
print
self
.
print_progress
()
self
.
update_job_progress
(
self
.
print_progress
())
for
k
,
v
in
self
.
target_values
.
iteritems
():
self
.
_set_target_temp
(
k
,
0
)
self
.
do_set_motors
(
"off"
)
self
.
do_set_fan
(
"off"
)
progress
=
{
'eta'
:
0
,
'percent'
:
100
}
self
.
fire
(
"target_temp_progress_changed"
,
{
'e0'
:
progress
})
def
reset
(
self
):
self
.
printing_jobs
=
False
self
.
printing_jobs
=
False
self
.
current_job
=
None
self
.
current_job
=
None
self
.
waiting_to_reach_temp
=
False
self
.
waiting_to_reach_temp
=
False
...
@@ -492,8 +507,9 @@ class Prontserve(pronsole.pronsole, EventEmitter):
...
@@ -492,8 +507,9 @@ class Prontserve(pronsole.pronsole, EventEmitter):
# restart the firmware
# restart the firmware
pronsole
.
pronsole
.
do_reset
(
self
,
""
)
pronsole
.
pronsole
.
do_reset
(
self
,
""
)
print
"Emergency Stop!"
self
.
p
.
printing
=
False
self
.
fire
(
"estop"
)
def
do_construct_set
(
self
,
subCmd
,
*
args
,
**
kwargs
):
def
do_construct_set
(
self
,
subCmd
,
*
args
,
**
kwargs
):
method
=
"do_set_
%
s"
%
subCmd
method
=
"do_set_
%
s"
%
subCmd
...
@@ -591,7 +607,7 @@ class Prontserve(pronsole.pronsole, EventEmitter):
...
@@ -591,7 +607,7 @@ class Prontserve(pronsole.pronsole, EventEmitter):
gen
.
Task
(
self
.
ioloop
.
add_timeout
(
next_timeout
,
self
.
run_print_queue_loop
))
gen
.
Task
(
self
.
ioloop
.
add_timeout
(
next_timeout
,
self
.
run_print_queue_loop
))
def
update_job_progress
(
self
,
progress
):
def
update_job_progress
(
self
,
progress
):
if
progress
!=
self
.
previous_job_progress
and
self
.
current_job
!=
None
:
if
progress
!=
self
.
previous_job_progress
:
self
.
previous_job_progress
=
progress
self
.
previous_job_progress
=
progress
self
.
fire
(
"job_progress_changed"
,
progress
)
self
.
fire
(
"job_progress_changed"
,
progress
)
...
@@ -600,7 +616,7 @@ class Prontserve(pronsole.pronsole, EventEmitter):
...
@@ -600,7 +616,7 @@ class Prontserve(pronsole.pronsole, EventEmitter):
return
100
*
float
(
self
.
p
.
queueindex
)
/
len
(
self
.
p
.
mainqueue
)
return
100
*
float
(
self
.
p
.
queueindex
)
/
len
(
self
.
p
.
mainqueue
)
if
(
self
.
sdprinting
):
if
(
self
.
sdprinting
):
return
self
.
percentdone
return
self
.
percentdone
return
"0"
return
0
def
run_sensor_loop
(
self
):
def
run_sensor_loop
(
self
):
# A number of conditions that must be met for us to send a temperature
# A number of conditions that must be met for us to send a temperature
...
@@ -821,7 +837,7 @@ if __name__ == "__main__":
...
@@ -821,7 +837,7 @@ if __name__ == "__main__":
sys
.
exit
(
1
)
sys
.
exit
(
1
)
time
.
sleep
(
2
)
time
.
sleep
(
2
)
prontserve
.
do_estop
()
prontserve
.
reset
()
prontserve
.
run_sensor_loop
()
prontserve
.
run_sensor_loop
()
prontserve
.
run_print_queue_loop
()
prontserve
.
run_print_queue_loop
()
...
...
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