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
174321aa
Commit
174321aa
authored
Jul 19, 2011
by
Keegi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save last used temperature in pronterface, to put it in combo box for next run.
parent
2dc82723
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
pronterface.py
pronterface.py
+12
-4
No files found.
pronterface.py
View file @
174321aa
...
...
@@ -38,6 +38,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
def
__init__
(
self
,
filename
=
None
,
size
=
winsize
):
pronsole
.
pronsole
.
__init__
(
self
)
self
.
settings
.
last_file_path
=
""
self
.
settings
.
last_temperature
=
0.0
self
.
settings
.
last_bed_temperature
=
0.0
self
.
filename
=
filename
os
.
putenv
(
"UBUNTU_MENUPROXY"
,
"0"
)
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Printer Interface"
,
size
=
size
);
...
...
@@ -163,6 +165,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
p
.
send_now
(
"M104 S"
+
l
)
print
"Setting hotend temperature to "
,
f
,
" degrees Celsius."
self
.
htemp
.
SetValue
(
l
)
self
.
set
(
"last_temperature"
,
str
(
f
))
else
:
print
"Printer is not online."
else
:
...
...
@@ -183,6 +186,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
p
.
send_now
(
"M140 S"
+
l
)
print
"Setting bed temperature to "
,
f
,
" degrees Celsius."
self
.
btemp
.
SetValue
(
l
)
self
.
set
(
"last_bed_temperature"
,
str
(
f
))
else
:
print
"Printer is not online."
else
:
...
...
@@ -370,9 +374,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
lls
.
Add
(
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Heater:"
,
pos
=
(
0
,
343
)),
pos
=
(
11
,
0
),
span
=
(
1
,
1
))
htemp_choices
=
[
self
.
temps
[
i
]
+
" ("
+
i
+
")"
for
i
in
sorted
(
self
.
temps
.
keys
(),
key
=
lambda
x
:
self
.
temps
[
x
])]
if
self
.
settings
.
last_temperature
not
in
map
(
float
,
self
.
temps
.
values
()):
htemp_choices
=
[
str
(
self
.
settings
.
last_temperature
)]
+
htemp_choices
self
.
htemp
=
wx
.
ComboBox
(
self
.
panel
,
-
1
,
choices
=
[
self
.
temps
[
i
]
+
" ("
+
i
+
")"
for
i
in
sorted
(
self
.
temps
.
keys
())],
style
=
wx
.
CB_DROPDOWN
,
size
=
(
90
,
25
),
pos
=
(
45
,
337
))
choices
=
htemp_choices
,
style
=
wx
.
CB_DROPDOWN
,
size
=
(
90
,
25
),
pos
=
(
45
,
337
))
self
.
htemp
.
SetValue
(
"0"
)
lls
.
Add
(
self
.
htemp
,
pos
=
(
11
,
1
),
span
=
(
1
,
3
))
self
.
settbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
"Set"
,
size
=
(
30
,
-
1
),
pos
=
(
135
,
335
))
...
...
@@ -380,9 +386,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
printerControls
.
append
(
self
.
settbtn
)
lls
.
Add
(
self
.
settbtn
,
pos
=
(
11
,
4
),
span
=
(
1
,
2
))
lls
.
Add
(
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Bed:"
,
pos
=
(
0
,
343
)),
pos
=
(
12
,
0
),
span
=
(
1
,
1
))
btemp_choices
=
[
self
.
bedtemps
[
i
]
+
" ("
+
i
+
")"
for
i
in
sorted
(
self
.
bedtemps
.
keys
(),
key
=
lambda
x
:
self
.
bedtemps
[
x
])]
if
self
.
settings
.
last_bed_temperature
not
in
map
(
float
,
self
.
bedtemps
.
values
()):
btemp_choices
=
[
str
(
self
.
settings
.
last_bed_temperature
)]
+
btemp_choices
self
.
btemp
=
wx
.
ComboBox
(
self
.
panel
,
-
1
,
choices
=
[
self
.
bedtemps
[
i
]
+
" ("
+
i
+
")"
for
i
in
sorted
(
self
.
temps
.
keys
())],
style
=
wx
.
CB_DROPDOWN
,
size
=
(
90
,
25
),
pos
=
(
45
,
367
))
choices
=
btemp_choices
,
style
=
wx
.
CB_DROPDOWN
,
size
=
(
90
,
25
),
pos
=
(
45
,
367
))
self
.
btemp
.
SetValue
(
"0"
)
lls
.
Add
(
self
.
btemp
,
pos
=
(
12
,
1
),
span
=
(
1
,
3
))
self
.
setbbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
"Set"
,
size
=
(
30
,
-
1
),
pos
=
(
135
,
365
))
...
...
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