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
ab9bea8f
Commit
ab9bea8f
authored
May 26, 2013
by
Spencer Bliven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing draw_temperature bug
Temperatures were being plotted upside down.
parent
dc4d2404
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
graph.py
printrun/graph.py
+5
-8
No files found.
printrun/graph.py
View file @
ab9bea8f
...
@@ -57,6 +57,7 @@ class Graph(BufferedCanvas):
...
@@ -57,6 +57,7 @@ class Graph(BufferedCanvas):
gc
=
wx
.
GraphicsContext
.
Create
(
dc
)
gc
=
wx
.
GraphicsContext
.
Create
(
dc
)
def
updateTemperatures
(
self
,
event
):
def
updateTemperatures
(
self
,
event
):
#print "ypos(%f)=%d"%(self.extruder0temps[-1],self._y_pos(self.extruder0temps[-1]))
self
.
AddBedTemperature
(
self
.
bedtemps
[
-
1
])
self
.
AddBedTemperature
(
self
.
bedtemps
[
-
1
])
self
.
AddBedTargetTemperature
(
self
.
bedtargettemps
[
-
1
])
self
.
AddBedTargetTemperature
(
self
.
bedtargettemps
[
-
1
])
self
.
AddExtruder0Temperature
(
self
.
extruder0temps
[
-
1
])
self
.
AddExtruder0Temperature
(
self
.
extruder0temps
[
-
1
])
...
@@ -151,18 +152,16 @@ class Graph(BufferedCanvas):
...
@@ -151,18 +152,16 @@ class Graph(BufferedCanvas):
x_add
=
float
(
self
.
width
)
/
self
.
xsteps
x_add
=
float
(
self
.
width
)
/
self
.
xsteps
x_pos
=
0.0
x_pos
=
0.0
lastxvalue
=
0.0
lastxvalue
=
0.0
lastyvalue
=
0.0
lastyvalue
=
temperature_list
[
-
1
]
for
temperature
in
(
temperature_list
):
for
temperature
in
(
temperature_list
):
#y_pos = int((float(self.height-self.y_offset)/self.maxyvalue)*temperature) + self.y_offset
#y_pos = int( float(temperature-self.minyvalue)/(self.maxyvalue-self.minyvalue)*(self.height-self.y_offset) + self.y_offset )
y_pos
=
self
.
_y_pos
(
temperature
)
y_pos
=
self
.
_y_pos
(
temperature
)
if
(
x_pos
>
0.0
):
# One need 2 points to draw a line.
if
(
x_pos
>
0.0
):
# One need 2 points to draw a line.
dc
.
DrawLine
(
lastxvalue
,
self
.
height
-
self
.
_lastyvalue
,
x_pos
,
self
.
height
-
y_pos
)
dc
.
DrawLine
(
lastxvalue
,
lastyvalue
,
x_pos
,
y_pos
)
lastxvalue
=
x_pos
lastxvalue
=
x_pos
x_pos
=
float
(
x_pos
)
+
x_add
x_pos
=
float
(
x_pos
)
+
x_add
self
.
_
lastyvalue
=
y_pos
lastyvalue
=
y_pos
if
len
(
text
)
>
0
:
if
len
(
text
)
>
0
:
font
=
wx
.
Font
(
8
,
wx
.
DEFAULT
,
wx
.
NORMAL
,
wx
.
BOLD
)
font
=
wx
.
Font
(
8
,
wx
.
DEFAULT
,
wx
.
NORMAL
,
wx
.
BOLD
)
...
@@ -172,9 +171,7 @@ class Graph(BufferedCanvas):
...
@@ -172,9 +171,7 @@ class Graph(BufferedCanvas):
else
:
else
:
gc
.
SetFont
(
font
,
wx
.
Colour
(
r
,
g
,
b
))
gc
.
SetFont
(
font
,
wx
.
Colour
(
r
,
g
,
b
))
#gc.DrawText(text, self.width - (font.GetPointSize() * ((len(text) * text_xoffset + 1))), self.height - self._lastyvalue - (font.GetPointSize() / 2))
gc
.
DrawText
(
text
,
x_pos
-
x_add
-
(
font
.
GetPointSize
()
*
((
len
(
text
)
*
text_xoffset
+
1
))),
lastyvalue
-
(
font
.
GetPointSize
()
/
2
))
gc
.
DrawText
(
text
,
x_pos
-
x_add
-
(
font
.
GetPointSize
()
*
((
len
(
text
)
*
text_xoffset
+
1
))),
self
.
height
-
self
.
_lastyvalue
-
(
font
.
GetPointSize
()
/
2
))
#gc.DrawText(text, self.width - (font.GetPixelSize().GetWidth() * ((len(text) * text_xoffset + 1) + 1)), self.height - self._lastyvalue - (font.GetPointSize() / 2))
def
drawbedtemp
(
self
,
dc
,
gc
):
def
drawbedtemp
(
self
,
dc
,
gc
):
...
...
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