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
90e32562
Commit
90e32562
authored
May 17, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More work on getting the gauges back
parent
89453bef
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
32 deletions
+42
-32
gui.py
printrun/gui.py
+25
-15
pronterface.py
pronterface.py
+17
-17
No files found.
printrun/gui.py
View file @
90e32562
...
...
@@ -26,6 +26,7 @@ from printrun import gviz
from
printrun.xybuttons
import
XYButtons
from
printrun.zbuttons
import
ZButtons
from
printrun.graph
import
Graph
from
printrun.pronterface_widgets
import
TempGauge
def
make_button
(
parent
,
label
,
callback
,
tooltip
,
container
=
None
,
size
=
wx
.
DefaultSize
,
style
=
0
):
button
=
wx
.
Button
(
parent
,
-
1
,
label
,
style
=
style
,
size
=
size
)
...
...
@@ -144,8 +145,6 @@ class LeftPane(wx.GridBagSizer):
if
(
'('
not
in
root
.
htemp
.
Value
):
root
.
htemp
.
SetValue
(
root
.
htemp
.
Value
+
' (user)'
)
#self.Add(root.btemp, pos = (4, 1), span = (1, 3))
#self.Add(root.setbbtn, pos = (4, 4), span = (1, 2))
root
.
tempdisp
=
wx
.
StaticText
(
root
.
panel
,
-
1
,
""
)
root
.
edist
=
wx
.
SpinCtrl
(
root
.
panel
,
-
1
,
"5"
,
min
=
0
,
max
=
1000
,
size
=
(
60
,
-
1
))
...
...
@@ -165,22 +164,33 @@ class LeftPane(wx.GridBagSizer):
root
.
zfeedc
.
Bind
(
wx
.
EVT_SPINCTRL
,
root
.
setfeeds
)
root
.
zfeedc
.
SetBackgroundColour
((
180
,
255
,
180
))
root
.
zfeedc
.
SetForegroundColour
(
"black"
)
# self.Add((10, 0), pos = (0, 11), span = (1, 1))
#root.hottgauge = TempGauge(root.panel, size = (200, 24), title = _("Heater:"), maxval = 230)
#self.Add(root.hottgauge, pos = (7, 0), span = (1, 4))
#root.bedtgauge = TempGauge(root.panel, size = (200, 24), title = _("Bed:"), maxval = 130)
#self.Add(root.bedtgauge, pos = (8, 0), span = (1, 4))
#def scroll_setpoint(e):
# if e.GetWheelRotation()>0:
# root.do_settemp(str(root.hsetpoint+1))
# elif e.GetWheelRotation()<0:
# root.do_settemp(str(max(0, root.hsetpoint-1)))
#root.tgauge.Bind(wx.EVT_MOUSEWHEEL, scroll_setpoint)
root
.
display_gauges
=
True
# FIXME : move to options or CLI options
if
root
.
display_gauges
:
root
.
hottgauge
=
TempGauge
(
root
.
panel
,
size
=
(
200
,
24
),
title
=
_
(
"Heater:"
),
maxval
=
300
)
self
.
Add
(
root
.
hottgauge
,
pos
=
(
6
,
0
),
span
=
(
1
,
6
))
root
.
bedtgauge
=
TempGauge
(
root
.
panel
,
size
=
(
200
,
24
),
title
=
_
(
"Bed:"
),
maxval
=
150
)
self
.
Add
(
root
.
bedtgauge
,
pos
=
(
7
,
0
),
span
=
(
1
,
6
))
def
hotendgauge_scroll_setpoint
(
e
):
rot
=
e
.
GetWheelRotation
()
if
rot
>
0
:
root
.
do_settemp
(
str
(
root
.
hsetpoint
+
1
))
elif
rot
<
0
:
root
.
do_settemp
(
str
(
max
(
0
,
root
.
hsetpoint
-
1
)))
def
bedgauge_scroll_setpoint
(
e
):
rot
=
e
.
GetWheelRotation
()
if
rot
>
0
:
root
.
do_settemp
(
str
(
root
.
bsetpoint
+
1
))
elif
rot
<
0
:
root
.
do_settemp
(
str
(
max
(
0
,
root
.
bsetpoint
-
1
)))
root
.
hottgauge
.
Bind
(
wx
.
EVT_MOUSEWHEEL
,
hotendgauge_scroll_setpoint
)
root
.
bedtgauge
.
Bind
(
wx
.
EVT_MOUSEWHEEL
,
bedgauge_scroll_setpoint
)
self
.
Add
(
root
.
tempdisp
,
pos
=
(
8
,
0
),
span
=
(
1
,
6
))
else
:
self
.
Add
(
root
.
tempdisp
,
pos
=
(
6
,
0
),
span
=
(
1
,
6
))
root
.
graph
=
Graph
(
root
.
panel
,
wx
.
ID_ANY
)
self
.
Add
(
root
.
graph
,
pos
=
(
4
,
5
),
span
=
(
2
,
1
))
self
.
Add
(
root
.
tempdisp
,
pos
=
(
6
,
0
),
span
=
(
1
,
6
))
class
VizPane
(
wx
.
BoxSizer
):
...
...
pronterface.py
View file @
90e32562
...
...
@@ -256,7 +256,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if
"S"
in
line
:
try
:
temp
=
float
(
line
.
split
(
"S"
)[
1
]
.
split
(
"*"
)[
0
])
#self.hottgauge.SetTarget(
temp)
if
self
.
display_gauges
:
wx
.
CallAfter
(
self
.
hottgauge
.
SetTarget
,
temp
)
wx
.
CallAfter
(
self
.
graph
.
SetExtruder0TargetTemperature
,
temp
)
except
:
pass
...
...
@@ -268,7 +268,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if
"S"
in
line
:
try
:
temp
=
float
(
line
.
split
(
"S"
)[
1
]
.
split
(
"*"
)[
0
])
#self.bedtgauge.SetTarget(
temp)
if
self
.
display_gauges
:
wx
.
CallAfter
(
self
.
bedtgauge
.
SetTarget
,
temp
)
wx
.
CallAfter
(
self
.
graph
.
SetBedTargetTemperature
,
temp
)
except
:
pass
...
...
@@ -295,7 +295,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
def
setbedgui
(
self
,
f
):
self
.
bsetpoint
=
f
#
self.bedtgauge.SetTarget(int(f))
if
self
.
display_gauges
:
self
.
bedtgauge
.
SetTarget
(
int
(
f
))
wx
.
CallAfter
(
self
.
graph
.
SetBedTargetTemperature
,
int
(
f
))
if
f
>
0
:
wx
.
CallAfter
(
self
.
btemp
.
SetValue
,
str
(
f
))
...
...
@@ -315,7 +315,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
def
sethotendgui
(
self
,
f
):
self
.
hsetpoint
=
f
#
self.hottgauge.SetTarget(int(f))
if
self
.
display_gauges
:
self
.
hottgauge
.
SetTarget
(
int
(
f
))
wx
.
CallAfter
(
self
.
graph
.
SetExtruder0TargetTemperature
,
int
(
f
))
if
f
>
0
:
wx
.
CallAfter
(
self
.
htemp
.
SetValue
,
str
(
f
))
...
...
@@ -1040,17 +1040,22 @@ class PronterWindow(MainWindow, pronsole.pronsole):
def
clearOutput
(
self
,
e
):
self
.
logbox
.
Clear
()
def
update_tempdisplay
(
self
):
try
:
hotend_temp
=
parse_temperature_report
(
self
.
tempreport
,
"T:"
)
wx
.
CallAfter
(
self
.
graph
.
SetExtruder0Temperature
,
hotend_temp
)
if
self
.
display_gauges
:
wx
.
CallAfter
(
self
.
hottgauge
.
SetValue
,
hotend_temp
)
bed_temp
=
parse_temperature_report
(
self
.
tempreport
,
"B:"
)
wx
.
CallAfter
(
self
.
graph
.
SetBedTemperature
,
bed_temp
)
if
self
.
display_gauges
:
wx
.
CallAfter
(
self
.
bedtgauge
.
SetValue
,
bed_temp
)
except
:
traceback
.
print_exc
()
def
statuschecker
(
self
):
while
self
.
statuscheck
:
string
=
""
wx
.
CallAfter
(
self
.
tempdisp
.
SetLabel
,
self
.
tempreport
.
strip
()
.
replace
(
"ok "
,
""
))
try
:
#self.hottgauge.SetValue(parse_temperature_report(self.tempreport, "T:"))
wx
.
CallAfter
(
self
.
graph
.
SetExtruder0Temperature
,
parse_temperature_report
(
self
.
tempreport
,
"T:"
))
#self.bedtgauge.SetValue(parse_temperature_report(self.tempreport, "B:"))
wx
.
CallAfter
(
self
.
graph
.
SetBedTemperature
,
parse_temperature_report
(
self
.
tempreport
,
"B:"
))
except
:
pass
self
.
update_tempdisplay
()
fractioncomplete
=
0.0
if
self
.
sdprinting
:
fractioncomplete
=
float
(
self
.
percentdone
/
100.0
)
...
...
@@ -1111,12 +1116,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if
"T:"
in
l
:
self
.
tempreport
=
l
wx
.
CallAfter
(
self
.
tempdisp
.
SetLabel
,
self
.
tempreport
.
strip
()
.
replace
(
"ok "
,
""
))
try
:
#self.hottgauge.SetValue(parse_temperature_report(self.tempreport, "T:"))
wx
.
CallAfter
(
self
.
graph
.
SetExtruder0Temperature
,
parse_temperature_report
(
self
.
tempreport
,
"T:"
))
wx
.
CallAfter
(
self
.
graph
.
SetBedTemperature
,
parse_temperature_report
(
self
.
tempreport
,
"B:"
))
except
:
traceback
.
print_exc
()
self
.
update_tempdisplay
()
tstring
=
l
.
rstrip
()
#print tstring
if
(
tstring
!=
"ok"
)
and
(
tstring
!=
"wait"
)
and
(
"ok T:"
not
in
tstring
)
and
(
not
self
.
p
.
loud
):
...
...
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