Add concept of max RPM

This commit is contained in:
XANTRONIX Development 2023-12-29 18:54:20 -05:00
parent 68ee09b8c1
commit 518de9cef8

View file

@ -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)