Add concept of max RPM
This commit is contained in:
parent
68ee09b8c1
commit
518de9cef8
1 changed files with 9 additions and 7 deletions
|
@ -70,12 +70,13 @@ class ShiftIndicator(Gauge):
|
|||
(4,),
|
||||
)
|
||||
|
||||
__slots__ = 'x', 'y', 'redline',
|
||||
__slots__ = 'x', 'y', 'rpm_redline', 'rpm_max',
|
||||
|
||||
def __init__(self, x: float, y: float, redline: float):
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.redline = redline
|
||||
def __init__(self, x: float, y: float, rpm_redline: float, rpm_max: float):
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.rpm_redline = rpm_redline
|
||||
self.rpm_max = rpm_max
|
||||
|
||||
def draw_bg(self, cr: cairo.Context):
|
||||
for level in range(0, len(self.LIGHT_LEVELS)):
|
||||
|
@ -104,7 +105,7 @@ class Cluster():
|
|||
|
||||
__slots__ = 'gauges',
|
||||
|
||||
def __init__(self, redline: float):
|
||||
def __init__(self, rpm_redline: float, rpm_max: float):
|
||||
self.gauges = list()
|
||||
|
||||
for x in (self.HEIGHT / 2, self.WIDTH - self.HEIGHT / 2):
|
||||
|
@ -112,7 +113,8 @@ class Cluster():
|
|||
|
||||
self.gauges.append(ShiftIndicator(self.SHIFT_INDICATOR_X,
|
||||
self.SHIFT_INDICATOR_Y,
|
||||
redline))
|
||||
rpm_redline,
|
||||
rpm_max))
|
||||
|
||||
def draw_bg(self, cr: cairo.Context):
|
||||
cr.set_source_rgb(0, 0, 0)
|
||||
|
|
Loading…
Add table
Reference in a new issue