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
a14732c2
Commit
a14732c2
authored
Apr 03, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make temp gauges aware of background color
parent
ea6eec47
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
controls.py
printrun/gui/controls.py
+2
-2
widgets.py
printrun/gui/widgets.py
+5
-3
No files found.
printrun/gui/controls.py
View file @
a14732c2
...
@@ -213,9 +213,9 @@ def add_extra_controls(self, root, parentpanel, extra_buttons = None, mini_mode
...
@@ -213,9 +213,9 @@ def add_extra_controls(self, root, parentpanel, extra_buttons = None, mini_mode
## Temperature gauges
## Temperature gauges
if
root
.
display_gauges
:
if
root
.
display_gauges
:
root
.
hottgauge
=
TempGauge
(
parentpanel
,
size
=
(
-
1
,
24
),
title
=
_
(
"Heater:"
),
maxval
=
300
)
root
.
hottgauge
=
TempGauge
(
parentpanel
,
size
=
(
-
1
,
24
),
title
=
_
(
"Heater:"
),
maxval
=
300
,
bgcolor
=
root
.
bgcolor
)
add
(
"htemp_gauge"
,
root
.
hottgauge
,
flag
=
wx
.
EXPAND
)
add
(
"htemp_gauge"
,
root
.
hottgauge
,
flag
=
wx
.
EXPAND
)
root
.
bedtgauge
=
TempGauge
(
parentpanel
,
size
=
(
-
1
,
24
),
title
=
_
(
"Bed:"
),
maxval
=
150
)
root
.
bedtgauge
=
TempGauge
(
parentpanel
,
size
=
(
-
1
,
24
),
title
=
_
(
"Bed:"
),
maxval
=
150
,
bgcolor
=
root
.
bgcolor
)
add
(
"btemp_gauge"
,
root
.
bedtgauge
,
flag
=
wx
.
EXPAND
)
add
(
"btemp_gauge"
,
root
.
bedtgauge
,
flag
=
wx
.
EXPAND
)
def
hotendgauge_scroll_setpoint
(
e
):
def
hotendgauge_scroll_setpoint
(
e
):
...
...
printrun/gui/widgets.py
View file @
a14732c2
...
@@ -246,10 +246,12 @@ class ButtonEdit(wx.Dialog):
...
@@ -246,10 +246,12 @@ class ButtonEdit(wx.Dialog):
class
TempGauge
(
wx
.
Panel
):
class
TempGauge
(
wx
.
Panel
):
def
__init__
(
self
,
parent
,
size
=
(
200
,
22
),
title
=
""
,
def
__init__
(
self
,
parent
,
size
=
(
200
,
22
),
title
=
""
,
maxval
=
240
,
gaugeColour
=
None
):
maxval
=
240
,
gaugeColour
=
None
,
bgcolor
=
"#FFFFFF"
):
wx
.
Panel
.
__init__
(
self
,
parent
,
-
1
,
size
=
size
)
wx
.
Panel
.
__init__
(
self
,
parent
,
-
1
,
size
=
size
)
self
.
Bind
(
wx
.
EVT_PAINT
,
self
.
paint
)
self
.
Bind
(
wx
.
EVT_PAINT
,
self
.
paint
)
self
.
SetBackgroundStyle
(
wx
.
BG_STYLE_CUSTOM
)
self
.
SetBackgroundStyle
(
wx
.
BG_STYLE_CUSTOM
)
self
.
bgcolor
=
wx
.
Colour
()
self
.
bgcolor
.
SetFromName
(
bgcolor
)
self
.
width
,
self
.
height
=
size
self
.
width
,
self
.
height
=
size
self
.
title
=
title
self
.
title
=
title
self
.
max
=
maxval
self
.
max
=
maxval
...
@@ -288,11 +290,11 @@ class TempGauge(wx.Panel):
...
@@ -288,11 +290,11 @@ class TempGauge(wx.Panel):
self
.
recalc
()
self
.
recalc
()
x0
,
y0
,
x1
,
y1
,
xE
,
yE
=
1
,
1
,
self
.
ypt
+
1
,
1
,
self
.
width
+
1
-
2
,
20
x0
,
y0
,
x1
,
y1
,
xE
,
yE
=
1
,
1
,
self
.
ypt
+
1
,
1
,
self
.
width
+
1
-
2
,
20
dc
=
wx
.
PaintDC
(
self
)
dc
=
wx
.
PaintDC
(
self
)
dc
.
SetBackground
(
wx
.
Brush
(
(
255
,
255
,
255
)
))
dc
.
SetBackground
(
wx
.
Brush
(
self
.
bgcolor
))
dc
.
Clear
()
dc
.
Clear
()
cold
,
medium
,
hot
=
wx
.
Colour
(
0
,
167
,
223
),
wx
.
Colour
(
239
,
233
,
119
),
wx
.
Colour
(
210
,
50.100
)
cold
,
medium
,
hot
=
wx
.
Colour
(
0
,
167
,
223
),
wx
.
Colour
(
239
,
233
,
119
),
wx
.
Colour
(
210
,
50.100
)
gauge1
,
gauge2
=
wx
.
Colour
(
255
,
255
,
210
),
(
self
.
gaugeColour
or
wx
.
Colour
(
234
,
82
,
0
))
gauge1
,
gauge2
=
wx
.
Colour
(
255
,
255
,
210
),
(
self
.
gaugeColour
or
wx
.
Colour
(
234
,
82
,
0
))
shadow1
,
shadow2
=
wx
.
Colour
(
110
,
110
,
110
),
wx
.
Colour
(
255
,
255
,
255
)
shadow1
,
shadow2
=
wx
.
Colour
(
110
,
110
,
110
),
self
.
bgcolor
gc
=
wx
.
GraphicsContext
.
Create
(
dc
)
gc
=
wx
.
GraphicsContext
.
Create
(
dc
)
# draw shadow first
# draw shadow first
# corners
# corners
...
...
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