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
ace66376
Commit
ace66376
authored
Feb 12, 2016
by
Kliment Yanev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add fan power (0-255) to temperature graph
parent
72063a1f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
graph.py
printrun/gui/graph.py
+22
-1
pronterface.py
printrun/pronterface.py
+8
-0
No files found.
printrun/gui/graph.py
View file @
ace66376
...
...
@@ -50,6 +50,7 @@ class Graph(BufferedCanvas):
self
.
extruder1targettemps
=
parent_graph
.
extruder1targettemps
self
.
bedtemps
=
parent_graph
.
bedtemps
self
.
bedtargettemps
=
parent_graph
.
bedtargettemps
self
.
fanpowers
=
parent_graph
.
fanpowers
else
:
self
.
extruder0temps
=
[
0
]
self
.
extruder0targettemps
=
[
0
]
...
...
@@ -57,12 +58,13 @@ class Graph(BufferedCanvas):
self
.
extruder1targettemps
=
[
0
]
self
.
bedtemps
=
[
0
]
self
.
bedtargettemps
=
[
0
]
self
.
fanpowers
=
[
0
]
self
.
timer
=
wx
.
Timer
(
self
)
self
.
Bind
(
wx
.
EVT_TIMER
,
self
.
updateTemperatures
,
self
.
timer
)
self
.
minyvalue
=
0
self
.
maxyvalue
=
2
5
0
self
.
maxyvalue
=
2
6
0
self
.
rescaley
=
True
# should the Y axis be rescaled dynamically?
if
self
.
rescaley
:
self
.
_ybounds
=
Graph
.
_YBounds
(
self
)
...
...
@@ -94,6 +96,7 @@ class Graph(BufferedCanvas):
self
.
AddExtruder0TargetTemperature
(
self
.
extruder0targettemps
[
-
1
])
self
.
AddExtruder1Temperature
(
self
.
extruder1temps
[
-
1
])
self
.
AddExtruder1TargetTemperature
(
self
.
extruder1targettemps
[
-
1
])
self
.
AddFanPower
(
self
.
fanpowers
[
-
1
])
if
self
.
rescaley
:
self
.
_ybounds
.
update
()
self
.
Refresh
()
...
...
@@ -216,6 +219,10 @@ class Graph(BufferedCanvas):
x_pos
-
x_add
-
(
font
.
GetPointSize
()
*
text_size
),
lastyvalue
-
(
font
.
GetPointSize
()
/
2
))
def
drawfanpower
(
self
,
dc
,
gc
):
self
.
drawtemperature
(
dc
,
gc
,
self
.
fanpowers
,
"Fan"
,
1
,
0
,
0
,
0
,
128
)
def
drawbedtemp
(
self
,
dc
,
gc
):
self
.
drawtemperature
(
dc
,
gc
,
self
.
bedtemps
,
"Bed"
,
2
,
255
,
0
,
0
,
128
)
...
...
@@ -240,6 +247,15 @@ class Graph(BufferedCanvas):
self
.
drawtemperature
(
dc
,
gc
,
self
.
extruder1targettemps
,
"Ex1 Target"
,
2
,
55
,
55
,
0
,
128
)
def
SetFanPower
(
self
,
value
):
self
.
fanpowers
.
pop
()
self
.
fanpowers
.
append
(
value
)
def
AddFanPower
(
self
,
value
):
self
.
fanpowers
.
append
(
value
)
if
float
(
len
(
self
.
fanpowers
)
-
1
)
/
self
.
xsteps
>
1
:
self
.
fanpowers
.
pop
(
0
)
def
SetBedTemperature
(
self
,
value
):
self
.
bedtemps
.
pop
()
self
.
bedtemps
.
append
(
value
)
...
...
@@ -313,6 +329,7 @@ class Graph(BufferedCanvas):
self
.
drawgrid
(
dc
,
gc
)
self
.
drawbedtargettemp
(
dc
,
gc
)
self
.
drawbedtemp
(
dc
,
gc
)
self
.
drawfanpower
(
dc
,
gc
)
self
.
drawextruder0targettemp
(
dc
,
gc
)
self
.
drawextruder0temp
(
dc
,
gc
)
self
.
drawextruder1targettemp
(
dc
,
gc
)
...
...
@@ -385,6 +402,8 @@ class Graph(BufferedCanvas):
if
bed_target
>
0
or
bed_max
>
5
:
# use HBP
miny
=
min
(
miny
,
bed_min
,
bed_target
)
maxy
=
max
(
maxy
,
bed_max
,
bed_target
)
miny
=
min
(
0
,
miny
);
maxy
=
max
(
260
,
maxy
);
padding
=
(
maxy
-
miny
)
*
self
.
buffer
/
(
1.0
-
2
*
self
.
buffer
)
miny
-=
padding
...
...
@@ -417,6 +436,8 @@ class Graph(BufferedCanvas):
if
bed_target
>
0
or
bed_max
>
5
:
# use HBP
miny
=
min
(
miny
,
bed_min
,
bed_target
)
maxy
=
max
(
maxy
,
bed_max
,
bed_target
)
miny
=
min
(
0
,
miny
);
maxy
=
max
(
260
,
maxy
);
# We have to rescale, so add padding
bufratio
=
self
.
buffer
/
(
1.0
-
self
.
buffer
)
...
...
printrun/pronterface.py
View file @
ace66376
...
...
@@ -1556,6 +1556,14 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
temp
=
gline_s
if
self
.
display_gauges
:
wx
.
CallAfter
(
self
.
bedtgauge
.
SetTarget
,
temp
)
if
self
.
display_graph
:
wx
.
CallAfter
(
self
.
graph
.
SetBedTargetTemperature
,
temp
)
elif
gline
.
command
in
[
"M106"
]:
gline_s
=
gcoder
.
S
(
gline
)
fanpow
=
255
if
gline_s
is
not
None
:
fanpow
=
gline_s
if
self
.
display_graph
:
wx
.
CallAfter
(
self
.
graph
.
SetFanPower
,
fanpow
)
elif
gline
.
command
in
[
"M107"
]:
if
self
.
display_graph
:
wx
.
CallAfter
(
self
.
graph
.
SetFanPower
,
0
)
elif
gline
.
command
.
startswith
(
"T"
):
tool
=
gline
.
command
[
1
:]
if
hasattr
(
self
,
"extrudersel"
):
wx
.
CallAfter
(
self
.
extrudersel
.
SetValue
,
tool
)
...
...
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