mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-08 23:22:04 +08:00
Abstract classes inherit from ABC (#23246)
old-commit-hash: 14bf834fefc136bec817a69e066c325055841474
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
import time
|
||||
from abc import abstractmethod
|
||||
from abc import abstractmethod, ABC
|
||||
from typing import Dict, Tuple, List
|
||||
|
||||
from cereal import car
|
||||
@@ -23,7 +23,7 @@ ACCEL_MIN = -3.5
|
||||
# generic car and radar interfaces
|
||||
|
||||
|
||||
class CarInterfaceBase():
|
||||
class CarInterfaceBase(ABC):
|
||||
def __init__(self, CP, CarController, CarState):
|
||||
self.CP = CP
|
||||
self.VM = VehicleModel(CP)
|
||||
@@ -170,7 +170,7 @@ class CarInterfaceBase():
|
||||
return events
|
||||
|
||||
|
||||
class RadarInterfaceBase():
|
||||
class RadarInterfaceBase(ABC):
|
||||
def __init__(self, CP):
|
||||
self.pts = {}
|
||||
self.delay = 0
|
||||
@@ -184,7 +184,7 @@ class RadarInterfaceBase():
|
||||
return ret
|
||||
|
||||
|
||||
class CarStateBase:
|
||||
class CarStateBase(ABC):
|
||||
def __init__(self, CP):
|
||||
self.CP = CP
|
||||
self.car_fingerprint = CP.carFingerprint
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from abc import abstractmethod
|
||||
from abc import abstractmethod, ABC
|
||||
from collections import namedtuple
|
||||
|
||||
ThermalConfig = namedtuple('ThermalConfig', ['cpu', 'gpu', 'mem', 'bat', 'ambient', 'pmic'])
|
||||
|
||||
class HardwareBase:
|
||||
class HardwareBase(ABC):
|
||||
@staticmethod
|
||||
def get_cmdline():
|
||||
with open('/proc/cmdline') as f:
|
||||
|
||||
Reference in New Issue
Block a user