From 6879e1f7437cb2a1c60326e1a97a641c313d80f8 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sun, 31 Dec 2023 22:42:25 -0500 Subject: [PATCH] Less cursed??? :( --- py/hexagram/cluster.py | 4 ++-- py/hexagram/speedo.py | 4 ++-- py/hexagram/tacho.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/py/hexagram/cluster.py b/py/hexagram/cluster.py index 0256ad0..008a6ec 100644 --- a/py/hexagram/cluster.py +++ b/py/hexagram/cluster.py @@ -10,6 +10,8 @@ from hexagram.speedo import Speedo from hexagram.tacho import Tacho class ShiftIndicator(Gauge): + __slots__ = 'x', 'y', 'rpm_redline', 'rpm_max', + LIGHT_WIDTH = 48 LIGHT_HEIGHT = 12 LIGHT_SPACING = 8 @@ -31,8 +33,6 @@ class ShiftIndicator(Gauge): (4,), ) - __slots__ = 'x', 'y', 'rpm_redline', 'rpm_max', - def __init__(self, x: float, y: float, rpm_redline: float, rpm_max: float): self.x = x self.y = y diff --git a/py/hexagram/speedo.py b/py/hexagram/speedo.py index 0a243e1..59865f8 100644 --- a/py/hexagram/speedo.py +++ b/py/hexagram/speedo.py @@ -9,13 +9,13 @@ class SpeedUnits(enum.Enum): MPH = 1 class Speedo(Dial): + __slots__ = 'units', + MIN_ANGLE = 232.0 * (math.pi / 180.0) MAX_ANGLE = 488.0 * (math.pi / 180.0) FONT_FACE = "Muli" - __slots__ = 'units', - def __init__(self, x: float, y: float, radius: float, max_value: float, units: SpeedUnits=SpeedUnits.KPH): super().__init__(x, y, radius, self.MIN_ANGLE, self.MAX_ANGLE, max_value) diff --git a/py/hexagram/tacho.py b/py/hexagram/tacho.py index a17afd7..9a751b1 100644 --- a/py/hexagram/tacho.py +++ b/py/hexagram/tacho.py @@ -5,13 +5,13 @@ import cairo from hexagram.dial import Dial class Tacho(Dial): + __slots__ = 'units', + MIN_ANGLE = 232.0 * (math.pi / 180.0) MAX_ANGLE = 488.0 * (math.pi / 180.0) FONT_FACE = "Muli" - __slots__ = 'units', - def __init__(self, x: float, y: float, radius: float, max_value: float): super().__init__(x, y, radius, self.MIN_ANGLE, self.MAX_ANGLE, max_value)