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
07d66212
Commit
07d66212
authored
Feb 05, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't start tempgraph window from scratch but reuse main graph temps
parent
832f1fe8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
graph.py
printrun/graph.py
+18
-16
No files found.
printrun/graph.py
View file @
07d66212
...
...
@@ -24,12 +24,12 @@ install_locale('pronterface')
from
bufferedcanvas
import
BufferedCanvas
class
GraphWindow
(
wx
.
Frame
):
def
__init__
(
self
,
root
,
size
=
(
600
,
600
)):
def
__init__
(
self
,
root
,
parent_graph
=
None
,
size
=
(
600
,
600
)):
super
(
GraphWindow
,
self
)
.
__init__
(
None
,
title
=
_
(
"Temperature graph"
),
size
=
size
)
panel
=
wx
.
Panel
(
self
,
-
1
)
vbox
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
self
.
graph
=
Graph
(
panel
,
wx
.
ID_ANY
,
root
)
self
.
graph
=
Graph
(
panel
,
wx
.
ID_ANY
,
root
,
parent_graph
=
parent_graph
)
vbox
.
Add
(
self
.
graph
,
1
,
wx
.
EXPAND
)
panel
.
SetSizer
(
vbox
)
...
...
@@ -37,18 +37,26 @@ class Graph(BufferedCanvas):
'''A class to show a Graph with Pronterface.'''
def
__init__
(
self
,
parent
,
id
,
root
,
pos
=
wx
.
DefaultPosition
,
size
=
wx
.
Size
(
150
,
80
),
style
=
0
):
size
=
wx
.
Size
(
150
,
80
),
style
=
0
,
parent_graph
=
None
):
# Forcing a no full repaint to stop flickering
style
=
style
|
wx
.
NO_FULL_REPAINT_ON_RESIZE
super
(
Graph
,
self
)
.
__init__
(
parent
,
id
,
pos
,
size
,
style
)
self
.
root
=
root
self
.
extruder0temps
=
[
0
]
self
.
extruder0targettemps
=
[
0
]
self
.
extruder1temps
=
[
0
]
self
.
extruder1targettemps
=
[
0
]
self
.
bedtemps
=
[
0
]
self
.
bedtargettemps
=
[
0
]
if
parent_graph
is
not
None
:
self
.
extruder0temps
=
parent_graph
.
extruder0temps
self
.
extruder0targettemps
=
parent_graph
.
extruder0targettemps
self
.
extruder1temps
=
parent_graph
.
extruder1temps
self
.
extruder1targettemps
=
parent_graph
.
extruder1targettemps
self
.
bedtemps
=
parent_graph
.
bedtemps
self
.
bedtargettemps
=
parent_graph
.
bedtargettemps
else
:
self
.
extruder0temps
=
[
0
]
self
.
extruder0targettemps
=
[
0
]
self
.
extruder1temps
=
[
0
]
self
.
extruder1targettemps
=
[
0
]
self
.
bedtemps
=
[
0
]
self
.
bedtargettemps
=
[
0
]
self
.
timer
=
wx
.
Timer
(
self
)
self
.
Bind
(
wx
.
EVT_TIMER
,
self
.
updateTemperatures
,
self
.
timer
)
...
...
@@ -69,7 +77,7 @@ class Graph(BufferedCanvas):
def
showwin
(
self
,
event
=
None
):
if
not
self
.
window
:
self
.
window
=
GraphWindow
(
self
.
root
)
self
.
window
=
GraphWindow
(
self
.
root
,
self
)
self
.
window
.
Show
()
if
self
.
timer
.
IsRunning
():
self
.
window
.
graph
.
StartPlotting
(
self
.
timer
.
Interval
)
...
...
@@ -235,7 +243,6 @@ class Graph(BufferedCanvas):
def
SetBedTemperature
(
self
,
value
):
self
.
bedtemps
.
pop
()
self
.
bedtemps
.
append
(
value
)
if
self
.
window
:
self
.
window
.
graph
.
SetBedTemperature
(
value
)
def
AddBedTemperature
(
self
,
value
):
self
.
bedtemps
.
append
(
value
)
...
...
@@ -245,7 +252,6 @@ class Graph(BufferedCanvas):
def
SetBedTargetTemperature
(
self
,
value
):
self
.
bedtargettemps
.
pop
()
self
.
bedtargettemps
.
append
(
value
)
if
self
.
window
:
self
.
window
.
graph
.
SetBedTargetTemperature
(
value
)
def
AddBedTargetTemperature
(
self
,
value
):
self
.
bedtargettemps
.
append
(
value
)
...
...
@@ -255,7 +261,6 @@ class Graph(BufferedCanvas):
def
SetExtruder0Temperature
(
self
,
value
):
self
.
extruder0temps
.
pop
()
self
.
extruder0temps
.
append
(
value
)
if
self
.
window
:
self
.
window
.
graph
.
SetExtruder0Temperature
(
value
)
def
AddExtruder0Temperature
(
self
,
value
):
self
.
extruder0temps
.
append
(
value
)
...
...
@@ -265,7 +270,6 @@ class Graph(BufferedCanvas):
def
SetExtruder0TargetTemperature
(
self
,
value
):
self
.
extruder0targettemps
.
pop
()
self
.
extruder0targettemps
.
append
(
value
)
if
self
.
window
:
self
.
window
.
graph
.
SetExtruder0TargetTemperature
(
value
)
def
AddExtruder0TargetTemperature
(
self
,
value
):
self
.
extruder0targettemps
.
append
(
value
)
...
...
@@ -275,7 +279,6 @@ class Graph(BufferedCanvas):
def
SetExtruder1Temperature
(
self
,
value
):
self
.
extruder1temps
.
pop
()
self
.
extruder1temps
.
append
(
value
)
if
self
.
window
:
self
.
window
.
graph
.
SetExtruder1Temperature
(
value
)
def
AddExtruder1Temperature
(
self
,
value
):
self
.
extruder1temps
.
append
(
value
)
...
...
@@ -285,7 +288,6 @@ class Graph(BufferedCanvas):
def
SetExtruder1TargetTemperature
(
self
,
value
):
self
.
extruder1targettemps
.
pop
()
self
.
extruder1targettemps
.
append
(
value
)
if
self
.
window
:
self
.
window
.
graph
.
SetExtruder1TargetTemperature
(
value
)
def
AddExtruder1TargetTemperature
(
self
,
value
):
self
.
extruder1targettemps
.
append
(
value
)
...
...
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