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
193347b6
Commit
193347b6
authored
12 years ago
by
Kliment Yanev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set target temps to zero on reset.
parent
73055e59
master
py3
stable
printrun-20150310
printrun-20140801
printrun-20140730
printrun-20140406
printrun-20140328
printrun-20140126
printrun-20131019
printrun-20130711
printrun-20130604
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
36 deletions
+44
-36
pronterface.py
pronterface.py
+44
-36
No files found.
pronterface.py
View file @
193347b6
...
@@ -265,18 +265,27 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -265,18 +265,27 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
except
:
except
:
pass
pass
def
do_settemp
(
self
,
l
=
""
):
def
setbedgui
(
self
,
f
):
try
:
self
.
bsetpoint
=
f
if
not
(
l
.
__class__
==
""
.
__class__
or
l
.
__class__
==
u""
.
__class__
)
or
(
not
len
(
l
)):
#self.bedtgauge.SetTarget(int(f))
l
=
str
(
self
.
htemp
.
GetValue
()
.
split
()[
0
])
wx
.
CallAfter
(
self
.
graph
.
SetBedTargetTemperature
,
int
(
f
))
l
=
l
.
lower
()
.
replace
(
","
,
"."
)
if
f
>
0
:
for
i
in
self
.
temps
.
keys
():
wx
.
CallAfter
(
self
.
btemp
.
SetValue
,
l
)
l
=
l
.
replace
(
i
,
self
.
temps
[
i
])
self
.
set
(
"last_bed_temperature"
,
str
(
f
))
f
=
float
(
l
)
wx
.
CallAfter
(
self
.
setboff
.
SetBackgroundColour
,
""
)
if
f
>=
0
:
wx
.
CallAfter
(
self
.
setboff
.
SetForegroundColour
,
""
)
if
self
.
p
.
online
:
wx
.
CallAfter
(
self
.
setbbtn
.
SetBackgroundColour
,
"#FFAA66"
)
self
.
p
.
send_now
(
"M104 S"
+
l
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetForegroundColour
,
"#660000"
)
print
_
(
"Setting hotend temperature to
%
f degrees Celsius."
)
%
f
wx
.
CallAfter
(
self
.
btemp
.
SetBackgroundColour
,
"#FFDABB"
)
else
:
wx
.
CallAfter
(
self
.
setboff
.
SetBackgroundColour
,
"#0044CC"
)
wx
.
CallAfter
(
self
.
setboff
.
SetForegroundColour
,
"white"
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetBackgroundColour
,
""
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetForegroundColour
,
""
)
wx
.
CallAfter
(
self
.
btemp
.
SetBackgroundColour
,
"white"
)
wx
.
CallAfter
(
self
.
btemp
.
Refresh
)
def
sethotendgui
(
self
,
f
):
self
.
hsetpoint
=
f
self
.
hsetpoint
=
f
#self.hottgauge.SetTarget(int(f))
#self.hottgauge.SetTarget(int(f))
wx
.
CallAfter
(
self
.
graph
.
SetExtruder0TargetTemperature
,
int
(
f
))
wx
.
CallAfter
(
self
.
graph
.
SetExtruder0TargetTemperature
,
int
(
f
))
...
@@ -295,6 +304,20 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -295,6 +304,20 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
wx
.
CallAfter
(
self
.
settbtn
.
SetForegroundColour
,
""
)
wx
.
CallAfter
(
self
.
settbtn
.
SetForegroundColour
,
""
)
wx
.
CallAfter
(
self
.
htemp
.
SetBackgroundColour
,
"white"
)
wx
.
CallAfter
(
self
.
htemp
.
SetBackgroundColour
,
"white"
)
wx
.
CallAfter
(
self
.
htemp
.
Refresh
)
wx
.
CallAfter
(
self
.
htemp
.
Refresh
)
def
do_settemp
(
self
,
l
=
""
):
try
:
if
not
(
l
.
__class__
==
""
.
__class__
or
l
.
__class__
==
u""
.
__class__
)
or
(
not
len
(
l
)):
l
=
str
(
self
.
htemp
.
GetValue
()
.
split
()[
0
])
l
=
l
.
lower
()
.
replace
(
","
,
"."
)
for
i
in
self
.
temps
.
keys
():
l
=
l
.
replace
(
i
,
self
.
temps
[
i
])
f
=
float
(
l
)
if
f
>=
0
:
if
self
.
p
.
online
:
self
.
p
.
send_now
(
"M104 S"
+
l
)
print
_
(
"Setting hotend temperature to
%
f degrees Celsius."
)
%
f
self
.
sethotendgui
(
f
)
else
:
else
:
print
_
(
"Printer is not online."
)
print
_
(
"Printer is not online."
)
else
:
else
:
...
@@ -316,24 +339,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -316,24 +339,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if
self
.
p
.
online
:
if
self
.
p
.
online
:
self
.
p
.
send_now
(
"M140 S"
+
l
)
self
.
p
.
send_now
(
"M140 S"
+
l
)
print
_
(
"Setting bed temperature to
%
f degrees Celsius."
)
%
f
print
_
(
"Setting bed temperature to
%
f degrees Celsius."
)
%
f
self
.
bsetpoint
=
f
self
.
setbedgui
(
f
)
#self.bedtgauge.SetTarget(int(f))
wx
.
CallAfter
(
self
.
graph
.
SetBedTargetTemperature
,
int
(
f
))
if
f
>
0
:
wx
.
CallAfter
(
self
.
btemp
.
SetValue
,
l
)
self
.
set
(
"last_bed_temperature"
,
str
(
f
))
wx
.
CallAfter
(
self
.
setboff
.
SetBackgroundColour
,
""
)
wx
.
CallAfter
(
self
.
setboff
.
SetForegroundColour
,
""
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetBackgroundColour
,
"#FFAA66"
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetForegroundColour
,
"#660000"
)
wx
.
CallAfter
(
self
.
btemp
.
SetBackgroundColour
,
"#FFDABB"
)
else
:
wx
.
CallAfter
(
self
.
setboff
.
SetBackgroundColour
,
"#0044CC"
)
wx
.
CallAfter
(
self
.
setboff
.
SetForegroundColour
,
"white"
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetBackgroundColour
,
""
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetForegroundColour
,
""
)
wx
.
CallAfter
(
self
.
btemp
.
SetBackgroundColour
,
"white"
)
wx
.
CallAfter
(
self
.
btemp
.
Refresh
)
else
:
else
:
print
_
(
"Printer is not online."
)
print
_
(
"Printer is not online."
)
if
webavail
:
if
webavail
:
...
@@ -1713,6 +1719,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -1713,6 +1719,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
dlg
=
wx
.
MessageDialog
(
self
,
_
(
"Are you sure you want to reset the printer?"
),
_
(
"Reset?"
),
wx
.
YES
|
wx
.
NO
)
dlg
=
wx
.
MessageDialog
(
self
,
_
(
"Are you sure you want to reset the printer?"
),
_
(
"Reset?"
),
wx
.
YES
|
wx
.
NO
)
if
dlg
.
ShowModal
()
==
wx
.
ID_YES
:
if
dlg
.
ShowModal
()
==
wx
.
ID_YES
:
self
.
p
.
reset
()
self
.
p
.
reset
()
self
.
sethotendgui
(
0
)
self
.
setbedgui
(
0
)
self
.
p
.
printing
=
0
self
.
p
.
printing
=
0
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
_
(
"Print"
))
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
_
(
"Print"
))
if
self
.
paused
:
if
self
.
paused
:
...
...
This diff is collapsed.
Click to expand it.
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