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
00e43ae9
Commit
00e43ae9
authored
Jun 11, 2013
by
D1plo1d
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring set temp to work with the prontserve logError exceptions
parent
c942bc6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
pronsole.py
pronsole.py
+18
-16
No files found.
pronsole.py
View file @
00e43ae9
...
@@ -1082,25 +1082,27 @@ class pronsole(cmd.Cmd):
...
@@ -1082,25 +1082,27 @@ class pronsole(cmd.Cmd):
self
.
log
(
_
(
"Read the extruder and bed temperature."
))
self
.
log
(
_
(
"Read the extruder and bed temperature."
))
def
do_settemp
(
self
,
l
):
def
do_settemp
(
self
,
l
):
l
=
l
.
lower
()
.
replace
(
", "
,
"."
)
for
i
in
self
.
temps
.
keys
():
l
=
l
.
replace
(
i
,
self
.
temps
[
i
])
try
:
try
:
l
=
l
.
lower
()
.
replace
(
", "
,
"."
)
f
=
float
(
l
)
for
i
in
self
.
temps
.
keys
():
l
=
l
.
replace
(
i
,
self
.
temps
[
i
])
f
=
float
(
l
)
if
f
>=
0
:
if
f
>
250
:
print
_
(
"
%
s is a high temperature to set your extruder to. Are you sure you want to do that?"
)
%
f
if
not
confirm
():
return
if
self
.
p
.
online
:
self
.
p
.
send_now
(
"M104 S"
+
l
)
self
.
log
(
_
(
"Setting hotend temperature to
%
s degrees Celsius."
)
%
f
)
else
:
self
.
logError
(
_
(
"Printer is not online."
))
else
:
self
.
logError
(
_
(
"You cannot set negative temperatures. To turn the hotend off entirely, set its temperature to 0."
))
except
:
except
:
self
.
logError
(
_
(
"You must enter a temperature."
))
self
.
logError
(
_
(
"You must enter a temperature."
))
return
if
f
>=
0
:
if
f
>
250
:
print
_
(
"
%
s is a high temperature to set your extruder to. Are you sure you want to do that?"
)
%
f
if
not
confirm
():
return
if
self
.
p
.
online
:
self
.
p
.
send_now
(
"M104 S"
+
l
)
self
.
log
(
_
(
"Setting hotend temperature to
%
s degrees Celsius."
)
%
f
)
else
:
self
.
logError
(
_
(
"Printer is not online."
))
else
:
self
.
logError
(
_
(
"You cannot set negative temperatures. To turn the hotend off entirely, set its temperature to 0."
))
def
help_settemp
(
self
):
def
help_settemp
(
self
):
self
.
log
(
_
(
"Sets the hotend temperature to the value entered."
))
self
.
log
(
_
(
"Sets the hotend temperature to the value entered."
))
...
...
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