Initial Commit
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TuneBoss.Core.Models
|
||||
{
|
||||
public enum OneDimGroup
|
||||
{
|
||||
SensorCalibration,
|
||||
FuelCompensation,
|
||||
SparkCompensation,
|
||||
IdleControl,
|
||||
TractionControl,
|
||||
Quickshifter,
|
||||
Nitrous,
|
||||
OutputsAndHardware,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stable identity of a 1D table slot. The ECU ADDRESS is generation-dependent and
|
||||
/// is resolved at connect time (see MemoryLayout) — it is intentionally NOT stored
|
||||
/// here. Slot is the 1-based ECU read order.
|
||||
///
|
||||
/// AxisUnit / ValueUnit are display-only labels (proposed defaults — editable in the
|
||||
/// UI per table). They never affect the wire format.
|
||||
/// </summary>
|
||||
public sealed record OneDimTableDefinition(
|
||||
int Slot,
|
||||
string Label,
|
||||
OneDimGroup Group,
|
||||
int MinFirmware, // 0 = base; otherwise 80 / 83 / 90 / 130
|
||||
string AxisUnit = "",
|
||||
string ValueUnit = "");
|
||||
|
||||
public static class OneDimTableRegistry
|
||||
{
|
||||
public static readonly IReadOnlyList<OneDimTableDefinition> All = new[]
|
||||
{
|
||||
new OneDimTableDefinition( 1, "Spark Dwell Time", OneDimGroup.OutputsAndHardware, 0, "V", "ms"),
|
||||
new OneDimTableDefinition( 2, "O2 Sensor", OneDimGroup.SensorCalibration, 0, "mV", "AFR"),
|
||||
new OneDimTableDefinition( 3, "Intake Air Temperature", OneDimGroup.SensorCalibration, 0, "raw", "\u00B0C"),
|
||||
new OneDimTableDefinition( 4, "Engine Temperature", OneDimGroup.SensorCalibration, 0, "raw", "\u00B0C"),
|
||||
new OneDimTableDefinition( 5, "Manifold Air Pressure", OneDimGroup.SensorCalibration, 0, "raw", "kPa"),
|
||||
new OneDimTableDefinition( 6, "Throttle Position", OneDimGroup.SensorCalibration, 0, "raw", "%"),
|
||||
new OneDimTableDefinition( 7, "Fuel \u00B7 Engine Temp", OneDimGroup.FuelCompensation, 0, "\u00B0C", "%"),
|
||||
new OneDimTableDefinition( 8, "Spark \u00B7 Engine Temp", OneDimGroup.SparkCompensation, 0, "\u00B0C", "\u00B0"),
|
||||
new OneDimTableDefinition( 9, "Fuel \u00B7 Barometer", OneDimGroup.FuelCompensation, 0, "kPa", "%"),
|
||||
new OneDimTableDefinition(10, "AUX Conversion", OneDimGroup.OutputsAndHardware, 0, "raw", "raw"),
|
||||
new OneDimTableDefinition(11, "Fuel \u00B7 Intake Air Temp", OneDimGroup.FuelCompensation, 0, "\u00B0C", "%"),
|
||||
new OneDimTableDefinition(12, "Spark \u00B7 Intake Air Temp", OneDimGroup.SparkCompensation, 0, "\u00B0C", "\u00B0"),
|
||||
new OneDimTableDefinition(13, "Fuel \u00B7 TPS Accel", OneDimGroup.FuelCompensation, 0, "%", "%"),
|
||||
new OneDimTableDefinition(14, "Spark \u00B7 TPS Accel", OneDimGroup.SparkCompensation, 0, "%", "\u00B0"),
|
||||
new OneDimTableDefinition(15, "Battery V / Injector Opening", OneDimGroup.OutputsAndHardware, 0, "V", "\u00B5s"),
|
||||
new OneDimTableDefinition(16, "TPS / MAP Percentage", OneDimGroup.SensorCalibration, 0, "raw", "%"),
|
||||
new OneDimTableDefinition(17, "Idle Solenoid Ctrl Pct", OneDimGroup.IdleControl, 0, "RPM", "%"),
|
||||
new OneDimTableDefinition(18, "Startup Fuel Comp", OneDimGroup.FuelCompensation, 0, "\u00B0C", "%"),
|
||||
new OneDimTableDefinition(19, "Injector 2 Pct", OneDimGroup.OutputsAndHardware, 80, "RPM", "%"),
|
||||
new OneDimTableDefinition(20, "RadFan PWM", OneDimGroup.OutputsAndHardware, 80, "\u00B0C", "%"),
|
||||
new OneDimTableDefinition(21, "Idle Spark Rumble", OneDimGroup.Nitrous, 80, "RPM", "\u00B0"),
|
||||
new OneDimTableDefinition(22, "Antilag Spark Control", OneDimGroup.Nitrous, 80, "RPM", "\u00B0"),
|
||||
new OneDimTableDefinition(23, "Idle Fuel Pulse Width", OneDimGroup.IdleControl, 80, "\u00B0C", "\u00B5s"),
|
||||
new OneDimTableDefinition(24, "Off-Throttle Isol Control", OneDimGroup.OutputsAndHardware, 80, "RPM", "%"),
|
||||
new OneDimTableDefinition(25, "Speed Fuel Comp", OneDimGroup.FuelCompensation, 83, "km/h", "%"),
|
||||
new OneDimTableDefinition(26, "Speed Spark Comp", OneDimGroup.SparkCompensation, 83, "km/h", "\u00B0"),
|
||||
new OneDimTableDefinition(27, "ShiftBoss Fuel Cut", OneDimGroup.Quickshifter, 90, "RPM", "%"),
|
||||
new OneDimTableDefinition(28, "ShiftBoss Spark Cut", OneDimGroup.Quickshifter, 90, "RPM", "%"),
|
||||
new OneDimTableDefinition(29, "ShiftBoss Spark Retard", OneDimGroup.Quickshifter, 90, "RPM", "\u00B0"),
|
||||
new OneDimTableDefinition(30, "TC Sensitivity", OneDimGroup.TractionControl, 90, "RPM", "%"),
|
||||
new OneDimTableDefinition(31, "TC Spark Retard Degrees", OneDimGroup.TractionControl, 90, "%", "\u00B0"),
|
||||
new OneDimTableDefinition(32, "TC Spark Retard Duration", OneDimGroup.TractionControl, 90, "%", "ms"),
|
||||
new OneDimTableDefinition(33, "Gear Ratio Detection", OneDimGroup.TractionControl, 90, "gear", "ratio"),
|
||||
new OneDimTableDefinition(34, "AUX PWM", OneDimGroup.OutputsAndHardware, 90, "raw", "%"),
|
||||
new OneDimTableDefinition(35, "Idle Solenoid Control Steps", OneDimGroup.IdleControl, 130, "\u00B0C", "steps"),
|
||||
new OneDimTableDefinition(36, "BARO Spark Comp", OneDimGroup.SparkCompensation, 130, "kPa", "\u00B0"),
|
||||
new OneDimTableDefinition(37, "Idle Spark Compensation", OneDimGroup.IdleControl, 130, "RPM", "\u00B0"),
|
||||
};
|
||||
|
||||
/// <summary>Nav-tree order for the groups.</summary>
|
||||
public static readonly IReadOnlyList<OneDimGroup> GroupOrder = new[]
|
||||
{
|
||||
OneDimGroup.SensorCalibration,
|
||||
OneDimGroup.FuelCompensation,
|
||||
OneDimGroup.SparkCompensation,
|
||||
OneDimGroup.IdleControl,
|
||||
OneDimGroup.TractionControl,
|
||||
OneDimGroup.Quickshifter,
|
||||
OneDimGroup.Nitrous,
|
||||
OneDimGroup.OutputsAndHardware,
|
||||
};
|
||||
|
||||
public static string DisplayName(OneDimGroup g) => g switch
|
||||
{
|
||||
OneDimGroup.SensorCalibration => "Sensor Calibration",
|
||||
OneDimGroup.FuelCompensation => "Fuel Compensation",
|
||||
OneDimGroup.SparkCompensation => "Spark Compensation",
|
||||
OneDimGroup.IdleControl => "Idle Control",
|
||||
OneDimGroup.TractionControl => "Traction Control",
|
||||
OneDimGroup.Quickshifter => "Quickshifter",
|
||||
OneDimGroup.Nitrous => "Rumble & Antilag",
|
||||
OneDimGroup.OutputsAndHardware => "Outputs & Hardware",
|
||||
_ => g.ToString(),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user