dd38751a7c
- Add Komatsu specific rules - Possibility to expand to any brand
30 lines
750 B
Python
30 lines
750 B
Python
# File: vehicle/komatsu.py
|
|
# Copyright (C) 2026 Erick Ahmed
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
from vehicle.base import (
|
|
SignalDef, FrameDef, normalize_id, decode_dataframe as _decode_dataframe, plot_signal
|
|
)
|
|
|
|
DECODER_RULES = {
|
|
normalize_id("0x011F"): FrameDef(
|
|
can_id="0x011F",
|
|
description="Engine RPM",
|
|
signals=[
|
|
SignalDef(
|
|
name="RPM",
|
|
bit_start=0,
|
|
bit_length=8,
|
|
factor=20.0,
|
|
offset=0.0,
|
|
is_signed=False,
|
|
byte_order="little",
|
|
unit="rpm",
|
|
),
|
|
],
|
|
),
|
|
}
|
|
|
|
def decode_dataframe(df, can_id):
|
|
return _decode_dataframe(df, can_id, DECODER_RULES)
|