public override void NameKnownMaps(byte[] allBytes, SymbolCollection newSymbols, List<CodeBlock> newCodeBlocks)
{
SymbolAxesTranslator st = new SymbolAxesTranslator();
foreach (SymbolHelper sh in newSymbols)
{
//sh.X_axis_descr = st.TranslateAxisID(sh.X_axis_ID);
// sh.Y_axis_descr = st.TranslateAxisID(sh.Y_axis_ID);
if (sh.Length == 700) // 25*14
{
sh.Category = "Detected maps";
sh.Subcategory = "Misc";
sh.Varname = "Launch control map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Y_axis_correction = 0.156250;
sh.Correction = 0.01;
sh.X_axis_descr = "Engine speed (rpm)";
sh.Y_axis_descr = "Vehicle speed (kph)";
sh.Z_axis_descr = "Output percentage";
sh.YaxisUnits = "km/h";
sh.XaxisUnits = "rpm";
}
if (sh.Length == 570)
{
if (((sh.X_axis_ID / 256) & 0xF0) == 0xC0 && ((sh.Y_axis_ID / 256) & 0xF0) == 0xE0)
{
sh.Category = "Detected maps";
sh.Subcategory = "Fuel";
int injDurCount = GetMapNameCountForCodeBlock("Injector duration", sh.CodeBlock, newSymbols, false);
injDurCount--;
sh.Varname = "Injector duration " + injDurCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.Y_axis_correction = 0.01;
sh.Correction = 0.023437;
sh.X_axis_descr = "Engine speed (rpm)";
//sh.Y_axis_descr = "Airflow mg/stroke";
sh.Y_axis_descr = "Requested Quantity mg/stroke";
sh.Z_axis_descr = "Duration (crankshaft degrees)";
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mg/st";
}
else if (((sh.X_axis_ID / 256) & 0xF0) == 0xC1 && ((sh.Y_axis_ID / 256) & 0xF0) == 0xE0)
{
sh.Category = "Detected maps";
sh.Subcategory = "Fuel";
int injDurCount = GetMapNameCountForCodeBlock("Injector duration", sh.CodeBlock, newSymbols, false);
injDurCount--;
sh.Varname = "Injector duration " + injDurCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.Y_axis_correction = 0.01;
sh.Correction = 0.023437;
sh.X_axis_descr = "Engine speed (rpm)";
//sh.Y_axis_descr = "Airflow mg/stroke";
sh.Y_axis_descr = "Requested Quantity mg/stroke";
sh.Z_axis_descr = "Duration (crankshaft degrees)";
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mg/st";
}
}
else if (sh.Length == 480)
{
if (sh.X_axis_ID / 256 == 0xC5 && sh.Y_axis_ID / 256 == 0xEC)
{
sh.Category = "Detected maps";
sh.Subcategory = "Fuel";
int injDurCount = GetMapNameCountForCodeBlock("Injector duration", sh.CodeBlock, newSymbols, false);
injDurCount--;
//IAT, ECT or Fuel temp?
double tempRange = GetTemperatureDurRange(injDurCount - 1);
sh.Varname = "Injector duration " + injDurCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.Y_axis_correction = 0.01;
sh.Correction = 0.023437;
sh.X_axis_descr = "Engine speed (rpm)";
//sh.Y_axis_descr = "Airflow mg/stroke";
sh.Y_axis_descr = "Requested Quantity mg/stroke";
sh.Z_axis_descr = "Duration (crankshaft degrees)";
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mg/st";
}
}
else if (sh.Length == 448)
{
if (sh.MapSelector.NumRepeats == 10)
{
// SOI maps detected
sh.Category = "Detected maps";
sh.Subcategory = "Fuel";
int injDurCount = GetMapNameCountForCodeBlock("Start of injection (SOI)", sh.CodeBlock, newSymbols, false);
//IAT, ECT or Fuel temp?
double tempRange = GetTemperatureSOIRange(sh.MapSelector, injDurCount - 1);
//Console.WriteLine("Temperature switch for SOI " + injDurCount.ToString() + " " + tempRange.ToString());
//sh.Varname = "Start of injection (SOI) " + injDurCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.Varname = "Start of injection (SOI) " + tempRange.ToString() + " °C [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.Correction = -0.023437;
sh.Offset = 78;
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.X_axis_correction = 0.01; // TODODONE : Check for x or y
sh.XaxisUnits = "mg/st";
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Z_axis_descr = "Start position (degrees BTDC)";
}
}
else if (sh.Length == 416)
{
string strAddrTest = sh.Flash_start_address.ToString("X8");
if (sh.X_axis_ID / 256 == 0xF9 && sh.Y_axis_ID / 256 == 0xDA)
{
// this is IQ by MAF limiter!
sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
sh.Varname = "Smoke limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Z_axis_descr = "Maximum IQ (mg)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.X_axis_descr = "Airflow mg/stroke";
sh.Correction = 0.01;
sh.X_axis_correction = 0.1;
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mg/st";
}
else if (sh.X_axis_ID / 256 == 0xEC && sh.Y_axis_ID / 256 == 0xDA)
{
sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
// if x axis = upto 3000 -> MAP limit, not MAF limit
if (GetMaxAxisValue(allBytes, sh, MapViewerEx.AxisIdent.Y_Axis) < 4000)
{
sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
sh.Varname = "IQ by MAP limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") +" " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.Correction = 0.01;
sh.X_axis_descr = "Boost pressure";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.Z_axis_descr = "Maximum IQ (mg)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mbar";
}
else
{
int iqMAFLimCount = GetMapNameCountForCodeBlock("IQ by MAF limiter", sh.CodeBlock, newSymbols, false);
sh.Varname = "IQ by MAF limiter " + iqMAFLimCount.ToString() + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
//sh.Varname = "IQ by MAF limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Z_axis_descr = "Maximum IQ (mg)";
sh.Correction = 0.01;
sh.X_axis_correction = 0.1;
sh.XaxisUnits = "mg/st";
sh.X_axis_descr = "Airflow mg/stroke";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
}
}
else if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC3)
{
sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
int iqMAFLimCount = GetMapNameCountForCodeBlock("IQ by MAF limiter", sh.CodeBlock, newSymbols, false);
sh.Varname = "IQ by MAF limiter " + iqMAFLimCount.ToString() + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
//sh.Varname = "IQ by MAF limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Z_axis_descr = "Maximum IQ (mg)";
sh.Correction = 0.01;
sh.X_axis_correction = 0.1;
sh.XaxisUnits = "mg/st";
sh.X_axis_descr = "Airflow mg/stroke";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
}
else if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID == 0xDDDC)
{
// SOI
sh.Category = "Detected maps";
sh.Subcategory = "Fuel";
int injDurCount = GetMapNameCountForCodeBlock("Start of injection (SOI)", sh.CodeBlock, newSymbols, false);
//IAT, ECT or Fuel temp?
double tempRange = GetTemperatureSOIRange(sh.MapSelector, injDurCount - 1);
sh.Varname = "Start of injection (SOI) " + tempRange.ToString() + " °C [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.Correction = -0.023437;
sh.Offset = 78;
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.X_axis_correction = 0.01; // TODODONE : Check for x or y
sh.XaxisUnits = "mg/st";
}
else if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xDD)
{
sh.Category = "Detected maps";
sh.Subcategory = "Turbo";
sh.Varname = "N75 duty cycle [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Z_axis_descr = "Duty cycle %";
sh.Correction = -0.01;
sh.Offset = 100;
//sh.Correction = 0.01;
sh.X_axis_correction = 0.01;
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mg/st";
}
else if (strAddrTest.EndsWith("116"))
{
sh.Category = "Detected maps";
sh.Subcategory = "Misc";
int egrCount = GetMapNameCountForCodeBlock("EGR", sh.CodeBlock, newSymbols, false);
sh.Varname = "EGR " + egrCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Correction = 0.1;
sh.X_axis_correction = 0.01;
sh.Z_axis_descr = "Mass Air Flow (mg/stroke)";
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mg/st";
}
else if ((sh.X_axis_ID / 256 == 0xE0) && (sh.Y_axis_ID / 256 == 0xDE))
{
// x axis should start with 0!
if (allBytes[sh.Y_axis_address] == 0 && allBytes[sh.Y_axis_address + 1] == 0)
{
sh.Category = "Detected maps";
sh.Subcategory = "Misc";
int egrCount = GetMapNameCountForCodeBlock("EGR", sh.CodeBlock, newSymbols, false);
sh.Varname = "EGR " + egrCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Correction = 0.1;
sh.X_axis_correction = 0.01;
sh.Z_axis_descr = "Mass Air Flow (mg/stroke)";
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mg/st";
}
}
else if (sh.X_axis_ID / 256 == 0xEA && sh.Y_axis_ID / 256 == 0xE9)
{
sh.Category = "Detected maps";
sh.Subcategory = "Fuel";
int injDurCount = GetMapNameCountForCodeBlock("Start of injection (SOI)", sh.CodeBlock, newSymbols, false);
//IAT, ECT or Fuel temp?
double tempRange = GetTemperatureSOIRange(sh.MapSelector, injDurCount - 1);
sh.Varname = "Start of injection (SOI) " + tempRange.ToString() + " °C [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.Correction = -0.023437;
sh.Offset = 78;
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.X_axis_correction = 0.01; // TODODONE : Check for x or y
sh.XaxisUnits = "mg/st";
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Z_axis_descr = "Start position (degrees BTDC)";
}
else if (sh.X_axis_ID / 256 == 0xEA && sh.Y_axis_ID / 256 == 0xE8)
{
// EGR or N75
if (allBytes[sh.X_axis_address] == 0 && allBytes[sh.X_axis_address + 1] == 0)
{
// EGR
sh.Category = "Detected maps";
sh.Subcategory = "Misc";
int egrCount = GetMapNameCountForCodeBlock("EGR", sh.CodeBlock, newSymbols, false);
sh.Varname = "EGR " + egrCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Correction = 0.1;
sh.X_axis_correction = 0.01;
sh.Z_axis_descr = "Mass Air Flow (mg/stroke)";
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mg/st";
}
else
{
//N75
sh.Category = "Detected maps";
sh.Subcategory = "Turbo";
sh.Varname = "N75 duty cycle [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Z_axis_descr = "Duty cycle %";
sh.Correction = -0.01;
sh.Offset = 100;
//sh.Correction = 0.01;
sh.X_axis_correction = 0.01;
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mg/st";
}
}
/* else if ((sh.X_axis_ID / 256 == 0xEA) && (sh.Y_axis_ID / 256 == 0xE8))
{
// x axis should start with 0!
if (allBytes[sh.Y_axis_address] == 0 && allBytes[sh.Y_axis_address + 1] == 0)
{
sh.Category = "Detected maps";
sh.Subcategory = "Misc";
int egrCount = GetMapNameCountForCodeBlock("EGR", sh.CodeBlock, newSymbols, false);
sh.Varname = "EGR " + egrCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Correction = 0.1;
sh.X_axis_correction = 0.01;
sh.Z_axis_descr = "Mass Air Flow (mg/stroke)";
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mg/st";
}
}*/
}
else if (sh.Length == 390)
{
// 15x12 = inj dur limiter on R3 files
if (sh.X_axis_length == 13 && sh.Y_axis_length == 15)
{
//if (!MapContainsNegativeValues(allBytes, sh))
{
/*sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
sh.Varname = "Injection duration limiter B [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.Correction = 0.023438;
sh.Y_axis_correction = 0.01;
sh.Y_axis_descr = "IQ (mg/stroke)";
sh.Z_axis_descr = "Max. degrees";
sh.X_axis_descr = "Engine speed (rpm)";
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mg/st";*/
sh.Category = "Detected maps";
sh.Subcategory = "Fuel";
int injDurCount = GetMapNameCountForCodeBlock("Injector duration", sh.CodeBlock, newSymbols, false);
injDurCount--;
sh.Varname = "Injector duration " + injDurCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.Y_axis_correction = 0.01;
sh.Correction = 0.023437;
sh.X_axis_descr = "Engine speed (rpm)";
//sh.Y_axis_descr = "Airflow mg/stroke";
sh.Y_axis_descr = "Requested Quantity mg/stroke";
sh.Z_axis_descr = "Duration (crankshaft degrees)";
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mg/st";
}
}
}
else if (sh.Length == 384)
{
if (sh.X_axis_length == 12 && sh.Y_axis_length == 16)
{
sh.Category = "Detected maps";
sh.Subcategory = "Misc";
sh.Varname = "Inverse driver wish [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Correction = 0.01;
sh.X_axis_correction = 0.01;
sh.Z_axis_descr = "Throttle position";
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Y_axis_descr = "Engine speed (rpm)";
//sh.Z_axis_descr = "Requested IQ (mg)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mg/st";
}
else if (sh.X_axis_length == 16 && sh.Y_axis_length == 12)
{
if ((sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xDC))
{
sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
sh.Varname = "Smoke limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Z_axis_descr = "Maximum IQ (mg)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.X_axis_descr = "Airflow mg/stroke";
sh.Correction = 0.01;
sh.X_axis_correction = 0.1;
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mg/st";
}
else if ((sh.X_axis_ID / 256 == 0xEC) && (sh.Y_axis_ID / 256 == 0xC0))
{
sh.Category = "Detected maps";
sh.Subcategory = "Misc";
int egrCount = GetMapNameCountForCodeBlock("EGR", sh.CodeBlock, newSymbols, false);
sh.Varname = "EGR " + egrCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Correction = 0.1;
sh.X_axis_correction = 0.01;
sh.Z_axis_descr = "Mass Air Flow (mg/stroke)";
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mg/st";
}
}
}
else if (sh.Length == 360)
{
// 15x12 = inj dur limiter on R3 files
if (sh.X_axis_length == 12 && sh.Y_axis_length == 15)
{
//if (!MapContainsNegativeValues(allBytes, sh))
{
/*sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
sh.Varname = "Injection duration limiter A [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.Correction = 0.023438;
sh.Y_axis_correction = 0.01;
sh.Y_axis_descr = "IQ (mg/stroke)";
sh.Z_axis_descr = "Max. degrees";
sh.X_axis_descr = "Engine speed (rpm)";
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mg/st";*/
sh.Category = "Detected maps";
sh.Subcategory = "Fuel";
int injDurCount = GetMapNameCountForCodeBlock("Injector duration", sh.CodeBlock, newSymbols, false);
injDurCount--;
sh.Varname = "Injector duration " + injDurCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.Y_axis_correction = 0.01;
sh.Correction = 0.023437;
sh.X_axis_descr = "Engine speed (rpm)";
//sh.Y_axis_descr = "Airflow mg/stroke";
sh.Y_axis_descr = "Requested Quantity mg/stroke";
sh.Z_axis_descr = "Duration (crankshaft degrees)";
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mg/st";
}
}
}
else if (sh.Length == 352)
{
if (sh.X_axis_length == 16 && sh.Y_axis_length == 11)
{
if (sh.X_axis_ID / 256 == 0xEC && sh.Y_axis_ID / 256 == 0xC0)
{
sh.Category = "Detected maps";
sh.Subcategory = "Misc";
int egrCount = GetMapNameCountForCodeBlock("EGR", sh.CodeBlock, newSymbols, false);
sh.Varname = "EGR " + egrCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Correction = 0.1;
sh.X_axis_correction = 0.01;
sh.Z_axis_descr = "Mass Air Flow (mg/stroke)";
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mg/st";
}
else if (sh.X_axis_ID / 256 == 0xEC && sh.Y_axis_ID / 256 == 0xEA)
{
sh.Category = "Detected maps";
sh.Subcategory = "Turbo";
sh.Varname = "N75 duty cycle [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Z_axis_descr = "Duty cycle %";
sh.Correction = -0.01;
sh.Offset = 100;
sh.X_axis_correction = 0.01;
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mg/st";
}
}
}
else if (sh.Length == 320)
{
sh.Category = "Probable maps";
sh.Subcategory = "Turbo";
sh.Varname = "Boost map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "] " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC3)
{
sh.Category = "Detected maps";
sh.Varname = "Boost target map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.X_axis_correction = 0.01;
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.Z_axis_descr = "Boost target (mbar)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mg/st";
}
else if (sh.X_axis_ID / 256 == 0xEA && sh.Y_axis_ID / 256 == 0xC0)
{
sh.Category = "Detected maps";
sh.Varname = "Boost target map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.X_axis_correction = 0.01;
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.Z_axis_descr = "Boost target (mbar)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mg/st";
}
if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xDC)
{
sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
sh.Varname = "IQ by MAP limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") +" " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.Correction = 0.01;
sh.X_axis_descr = "Boost pressure";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.Z_axis_descr = "Maximum IQ (mg)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mbar";
}
if (sh.X_axis_ID / 256 == 0xDA && sh.Y_axis_ID / 256 == 0xDA)
{
//sh.Category = "Detected maps";
//sh.Subcategory = "Limiters";
sh.Varname = "Boost map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "] " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.X_axis_descr = "CT (celcius)";
sh.X_axis_correction = 0.1;
sh.X_axis_offset = -273.1;
sh.XaxisUnits = "degrees";
}
//sh.Correction = 0.01;
//sh.Y_axis_correction = 0.01;
}
else if (sh.Length == 308)
{
sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
//sh.Varname = "Boost limiter (temperature) [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Varname = "SOI limiter (temperature) [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Correction = -0.023437;
sh.Offset = 78;
sh.Y_axis_descr = "Engine speed (rpm)";
sh.X_axis_descr = "IAT (celcius)"; //IAT, ECT or Fuel temp?
sh.X_axis_correction = 0.1;
sh.X_axis_offset = -273.1;
sh.Z_axis_descr = "SOI limit (degrees)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "IAT C";
}
else if (sh.Length == 280) // boost target can be 10x14 as well in Seat maps
{
if (sh.X_axis_ID / 256 == 0xEC && sh.Y_axis_ID / 256 == 0xC0)
{
sh.Category = "Detected maps";
sh.Subcategory = "Turbo";
sh.Varname = "Boost target map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "] " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.X_axis_correction = 0.01;
sh.X_axis_descr = "IQ (mg/stroke)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.Z_axis_descr = "Boost target (mbar)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "mg/st";
}
}
else if (sh.Length == 256)
{
sh.Category = "Detected maps";
sh.Subcategory = "Misc";
sh.Varname = "Driver wish [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Correction = 0.01;
sh.X_axis_correction = 0.01;
sh.X_axis_descr = "Throttle position";
sh.Z_axis_descr = "Requested IQ (mg)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "TPS %";
}
else if (sh.Length == 240)
{
if (sh.X_axis_length == 12 && sh.Y_axis_length == 10)
{
if (sh.X_axis_ID / 256 == 0xEC && sh.Y_axis_ID / 256 == 0xC0)
{
sh.Category = "Detected maps";
sh.Subcategory = "Misc";
sh.Varname = "Driver wish [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Correction = 0.01;
sh.X_axis_correction = 0.01;
sh.X_axis_descr = "Throttle position";
sh.Z_axis_descr = "Requested IQ (mg)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "TPS %";
}
}
}
else if (sh.Length == 216)
{
if (sh.X_axis_length == 12 && sh.Y_axis_length == 9)
{
sh.Category = "Detected maps";
sh.Subcategory = "Misc";
sh.Varname = "Driver wish [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Correction = 0.01;
sh.X_axis_correction = 0.01;
sh.X_axis_descr = "Throttle position";
sh.Z_axis_descr = "Requested IQ (mg)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "TPS %";
}
}
else if (sh.Length == 200)
{
if (sh.X_axis_ID / 256 == 0xC2 && sh.Y_axis_ID / 256 == 0xE0)
{
sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
sh.Varname = "Boost limit map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
// sh.Correction = 0.01;
//sh.X_axis_correction = 0.01;
sh.Y_axis_descr = "Atmospheric pressure (mbar)";
sh.Z_axis_descr = "Maximum boost pressure (mbar)";
sh.X_axis_descr = "Engine speed (rpm)";
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mbar";
}
else if (sh.X_axis_ID / 256 == 0xC0 && sh.Y_axis_ID / 256 == 0xEA)
{
sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
sh.Varname = "Boost limit map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
// sh.Correction = 0.01;
//sh.X_axis_correction = 0.01;
sh.Y_axis_descr = "Atmospheric pressure (mbar)";
sh.Z_axis_descr = "Maximum boost pressure (mbar)";
sh.X_axis_descr = "Engine speed (rpm)";
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mbar";
}
else if (sh.X_axis_ID / 256 == 0xC1 && sh.Y_axis_ID / 256 == 0xE0)
{
//if (!MapContainsNegativeValues(allBytes, sh))
if(GetMaxAxisValue(allBytes, sh, MapViewerEx.AxisIdent.X_Axis) > 5000)
{
/* sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
sh.Varname = "Injection duration limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.Correction = 0.023438;
sh.Y_axis_correction = 0.01;
sh.Y_axis_descr = "IQ (mg/stroke)";
sh.Z_axis_descr = "Max. degrees";
sh.X_axis_descr = "Engine speed (rpm)";
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mg/st";*/
sh.Category = "Detected maps";
sh.Subcategory = "Fuel";
int injDurCount = GetMapNameCountForCodeBlock("Injector duration", sh.CodeBlock, newSymbols, false);
injDurCount--;
sh.Varname = "Injector duration " + injDurCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
sh.Y_axis_correction = 0.01;
sh.Correction = 0.023437;
sh.X_axis_descr = "Engine speed (rpm)";
//sh.Y_axis_descr = "Airflow mg/stroke";
sh.Y_axis_descr = "Requested Quantity mg/stroke";
sh.Z_axis_descr = "Duration (crankshaft degrees)";
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mg/st";
}
}
}
else if (sh.Length == 192)
{
if (sh.X_axis_ID / 256 == 0xEC && sh.Y_axis_ID / 256 == 0xC0)
{
sh.Category = "Detected maps";
sh.Subcategory = "Misc";
sh.Varname = "Driver wish [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Correction = 0.01;
sh.X_axis_correction = 0.01;
sh.X_axis_descr = "Throttle position";
sh.Z_axis_descr = "Requested IQ (mg)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "TPS %";
}
}
else if (sh.Length == 180)
{
if (sh.X_axis_length == 9 && sh.Y_axis_length == 10)
{
if (sh.X_axis_ID / 256 == 0xEC && sh.Y_axis_ID / 256 == 0xC1)
{
sh.Category = "Detected maps";
sh.Subcategory = "Fuel";
int sIQCount = GetMapNameCountForCodeBlock("Start IQ ", sh.CodeBlock, newSymbols, false);
sh.Varname = "Start IQ (" + sIQCount.ToString() + ") [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Correction = 0.01;
sh.X_axis_descr = "CT (celcius)";
sh.X_axis_correction = 0.1;
sh.X_axis_offset = -273.1;
sh.Z_axis_descr = "Requested IQ (mg)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "degC";
}
else if (sh.X_axis_ID / 256 == 0xC0 && sh.Y_axis_ID / 256 == 0xEC)
{
// atm boost limit R3 file versions
sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
sh.Varname = "Boost limit map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4");
// sh.Correction = 0.01;
//sh.X_axis_correction = 0.01;
sh.Y_axis_descr = "Atmospheric pressure (mbar)";
sh.Z_axis_descr = "Maximum boost pressure (mbar)";
sh.X_axis_descr = "Engine speed (rpm)";
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mbar";
}
else if (sh.X_axis_ID / 256 == 0xC1 && sh.Y_axis_ID / 256 == 0xE0)
{
sh.Category = "Detected maps";
sh.Subcategory = "Fuel";
int injDurCount = GetMapNameCountForCodeBlock("Injector duration", sh.CodeBlock, newSymbols, false);
injDurCount--;
//if (injDurCount < 1) injDurCount = 1;
sh.Varname = "Injector duration " + injDurCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Y_axis_correction = 0.01;
sh.Correction = 0.023437;
sh.X_axis_descr = "Engine speed (rpm)";
//sh.Y_axis_descr = "Airflow mg/stroke";
sh.Y_axis_descr = "Requested Quantity mg/stroke";
sh.Z_axis_descr = "Duration (crankshaft degrees)";
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mg/st";
}
}
}
else if (sh.Length == 162)
{
if (sh.X_axis_length == 9 && sh.Y_axis_length == 9)
{
if (sh.X_axis_ID / 256 == 0xEC && sh.Y_axis_ID / 256 == 0xC1)
{
sh.Category = "Detected maps";
sh.Subcategory = "Fuel";
int sIQCount = GetMapNameCountForCodeBlock("Start IQ ", sh.CodeBlock, newSymbols, false);
sh.Varname = "Start IQ (" + sIQCount.ToString() + ") [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Correction = 0.01;
sh.X_axis_descr = "CT (celcius)";
sh.X_axis_correction = 0.1;
sh.X_axis_offset = -273.1;
sh.Z_axis_descr = "Requested IQ (mg)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "degC";
}
}
}
else if (sh.Length == 144)
{
if (sh.X_axis_length == 9 && sh.Y_axis_length == 8)
{
if (sh.X_axis_ID / 256 == 0xEC && sh.Y_axis_ID / 256 == 0xC0)
{
sh.Category = "Detected maps";
sh.Subcategory = "Fuel";
sh.Varname = "Fuel correction [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
/*sh.Correction = 0.01;
sh.X_axis_correction = 0.01;
sh.X_axis_descr = "Throttle position";
sh.Z_axis_descr = "Requested IQ (mg)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "TPS %";*/
}
}
if (sh.X_axis_length == 8 && sh.Y_axis_length == 9)
{
if (sh.X_axis_ID / 256 == 0xEC && sh.Y_axis_ID / 256 == 0xC1)
{
sh.Category = "Detected maps";
sh.Subcategory = "Fuel";
int sIQCount = GetMapNameCountForCodeBlock("Start IQ ", sh.CodeBlock, newSymbols, false);
sh.Varname = "Start IQ (" + sIQCount.ToString() + ") [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.X_axis_descr = "CT (celcius)";
sh.X_axis_correction = 0.1;
sh.X_axis_offset = -273.1;
sh.Z_axis_descr = "Requested IQ (mg)";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.Correction = 0.01;
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "degC";
}
}
}
else if (sh.Length == 128)
{
if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID == 0xC14a)
{
sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
sh.Varname = "MAF correction by temperature [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Z_axis_descr = "Limit";
sh.Y_axis_descr = "Engine speed (rpm)";
sh.X_axis_descr = "IAT (celcius)"; //IAT, ECT or Fuel temp?
sh.X_axis_correction = 0.1;
sh.X_axis_offset = -273.1;
sh.Correction = 0.01;
sh.YaxisUnits = "rpm";
sh.XaxisUnits = "IAT C";
}
}
else if (sh.Length == 138) // R3 (1.4 TDi, three cylinder) has this
{
if (sh.X_axis_length == 3 && sh.Y_axis_length == 23)
{
sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
sh.Varname = "Torque limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Z_axis_descr = "Maximum IQ (mg)";
sh.Y_axis_descr = "Atm. pressure (mbar)";
sh.X_axis_descr = "Engine speed (rpm)";
sh.Correction = 0.01;
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mbar";
}
}
else if (sh.Length == 132) // R3 (1.4 TDi, three cylinder) has this
{
if (sh.X_axis_length == 3 && sh.Y_axis_length == 22)
{
sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
sh.Varname = "Torque limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Z_axis_descr = "Maximum IQ (mg)";
sh.Y_axis_descr = "Atm. pressure (mbar)";
sh.X_axis_descr = "Engine speed (rpm)";
sh.Correction = 0.01;
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mbar";
}
}
else if (sh.Length == 126)
{
if (sh.X_axis_length == 3 && sh.Y_axis_length == 21)
{
sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
sh.Varname = "Torque limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Z_axis_descr = "Maximum IQ (mg)";
sh.Y_axis_descr = "Atm. pressure (mbar)";
sh.X_axis_descr = "Engine speed (rpm)";
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mbar";
sh.Correction = 0.01;
}
}
else if (sh.Length == 120)
{
if (sh.X_axis_length == 3 && sh.Y_axis_length == 20)
{
sh.Category = "Detected maps";
sh.Subcategory = "Limiters";
sh.Varname = "Torque limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Z_axis_descr = "Maximum IQ (mg)";
sh.Y_axis_descr = "Atm. pressure (mbar)";
sh.X_axis_descr = "Engine speed (rpm)";
sh.Correction = 0.01;
sh.XaxisUnits = "rpm";
sh.YaxisUnits = "mbar";
}
}
else if (sh.Length == 64)
{
if (sh.X_axis_length == 32 && sh.Y_axis_length == 1)
{
sh.Category = "Detected maps";
sh.Subcategory = "Misc";
sh.Varname = "MAF linearization [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
}
}
else if (sh.Length == 4)
{
if (sh.X_axis_length == 2 && sh.Y_axis_length == 1)
{
//if (sh.X_axis_ID >= 0xEBA0 && sh.X_axis_ID <= 0xEBAF)
if (sh.X_axis_ID == 0xEBA2 || sh.X_axis_ID == 0xEBA4 || sh.X_axis_ID == 0xE9BC || sh.X_axis_ID == 0xE04A)
{
sh.Category = "Detected maps";
sh.Subcategory = "Misc";
sh.Varname = "MAP linearization [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
}
else if (sh.X_axis_ID / 256 == 0xC1) // idle RPM
{
if (IsValidTemperatureAxis(allBytes, sh, MapViewerEx.AxisIdent.X_Axis))
{
sh.Category = "Detected maps";
sh.Subcategory = "Misc";
int lmCount = GetMapNameCountForCodeBlock("Idle RPM", sh.CodeBlock, newSymbols, false);
sh.Varname = "Idle RPM (" + lmCount.ToString() + ") [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";
sh.Y_axis_descr = "Coolant temperature";
sh.Y_axis_correction = 0.1;
sh.Y_axis_offset = -273.1;
sh.Z_axis_descr = "Target engine speed";
sh.YaxisUnits = "°C";
}
}
}
}
}
}