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
b4316cbd
Commit
b4316cbd
authored
May 22, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use main window background color in temp graph (should fix #359)
parent
928458a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
14 deletions
+4
-14
graph.py
printrun/graph.py
+3
-13
gui.py
printrun/gui.py
+1
-1
No files found.
printrun/graph.py
View file @
b4316cbd
...
...
@@ -22,14 +22,12 @@ from bufferedcanvas import *
class
Graph
(
BufferedCanvas
):
'''A class to show a Graph with Pronterface.'''
def
__init__
(
self
,
parent
,
id
,
pos
=
wx
.
DefaultPosition
,
def
__init__
(
self
,
parent
,
id
,
root
,
pos
=
wx
.
DefaultPosition
,
size
=
wx
.
Size
(
150
,
80
),
style
=
0
):
# Forcing a no full repaint to stop flickering
style
=
style
|
wx
.
NO_FULL_REPAINT_ON_RESIZE
#call super function
super
(
Graph
,
self
)
.
__init__
(
parent
,
id
,
pos
,
size
,
style
)
#BufferedCanvas.__init__(self, parent, id)
self
.
root
=
root
self
.
extruder0temps
=
[
0
]
self
.
extruder0targettemps
=
[
0
]
...
...
@@ -50,18 +48,10 @@ class Graph(BufferedCanvas):
self
.
_lastyvalue
=
0
#self.sizer = wx.BoxSizer(wx.HORIZONTAL)
#self.sizer.Add(wx.Button(self, -1, "Button1", (0, 0)))
#self.SetSizer(self.sizer)
def
OnPaint
(
self
,
evt
):
dc
=
wx
.
PaintDC
(
self
)
gc
=
wx
.
GraphicsContext
.
Create
(
dc
)
def
Destroy
(
self
):
#call the super method
super
(
wx
.
Panel
,
self
)
.
Destroy
()
def
updateTemperatures
(
self
,
event
):
self
.
AddBedTemperature
(
self
.
bedtemps
[
-
1
])
self
.
AddBedTargetTemperature
(
self
.
bedtargettemps
[
-
1
])
...
...
@@ -236,7 +226,7 @@ class Graph(BufferedCanvas):
self
.
Refresh
()
def
draw
(
self
,
dc
,
w
,
h
):
dc
.
SetBackground
(
wx
.
Brush
(
wx
.
Colour
(
0
,
0
,
0
,
0
)
))
dc
.
SetBackground
(
wx
.
Brush
(
self
.
root
.
settings
.
bgcolor
))
dc
.
Clear
()
gc
=
wx
.
GraphicsContext
.
Create
(
dc
)
self
.
width
=
w
...
...
printrun/gui.py
View file @
b4316cbd
...
...
@@ -188,7 +188,7 @@ class LeftPane(wx.GridBagSizer):
else
:
self
.
Add
(
root
.
tempdisp
,
pos
=
(
6
,
0
),
span
=
(
1
,
6
))
root
.
graph
=
Graph
(
root
.
panel
,
wx
.
ID_ANY
)
root
.
graph
=
Graph
(
root
.
panel
,
wx
.
ID_ANY
,
root
)
self
.
Add
(
root
.
graph
,
pos
=
(
4
,
5
),
span
=
(
2
,
1
))
class
VizPane
(
wx
.
BoxSizer
):
...
...
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