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 == 544) { if (sh.X_axis_length == 16 && sh.Y_axis_length == 17) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC2) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; sh.Varname = "N146 Pump voltage map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; //sh.Correction = 0.001221001; // ?1.221001 //Todo: N146 correction factor EDC15C sh.X_axis_correction = 0.01; sh.Z_axis_descr = "Pump voltage (V)"; 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 == 468) { if (sh.X_axis_length == 13 && sh.Y_axis_length == 18) { if (sh.X_axis_ID / 256 == 0xDC && sh.Y_axis_ID / 256 == 0xC0) { 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.Length == 416) { if (sh.X_axis_length == 0x10 && sh.Y_axis_length == 0x0d) { if (sh.X_axis_ID / 256 == 0xF9 && sh.Y_axis_ID / 256 == 0xDB) { // 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 == 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 == 0xDC && sh.Y_axis_ID / 256 == 0xDA) { // this is IQ by MAF limiter! sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; sh.Varname = "Smoke limiter II [" + 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 == 0xDD && sh.Y_axis_ID / 256 == 0xDA) { 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 == 0xE08A && sh.Y_axis_ID == 0xDDD8) { 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 == 0xDC && 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.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 == 0xE0 && sh.Y_axis_ID / 256 == 0xDE) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int injDurCount = GetMapNameCountForCodeBlock("Start of injection (N108 SOI)", sh.CodeBlock, newSymbols, false); sh.Varname = "Start of injection (N108 SOI) " + injDurCount.ToString() + " [" + 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_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.Correction = 0.023437; //sh.Offset = 78; sh.Z_axis_descr = "Start position (degrees BTDC)"; } } } if (sh.Length == 384) { if (sh.X_axis_ID / 256 == 0xDD && sh.Y_axis_ID / 256 == 0xC0) { // inv driver wish 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"; } } if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC1) { // inv driver wish 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"; } } if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xDC) { // smoke limiter if (sh.X_axis_length == 16 && sh.Y_axis_length == 12) { int smCount = GetMapNameCountForCodeBlock("Smoke limiter", sh.CodeBlock, newSymbols, false); 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"; } } } if (sh.Length == 320) // 16*10 { if (sh.X_axis_ID / 256 == 0xDD && sh.Y_axis_ID / 256 == 0xC0) { sh.Category = "Detected maps"; sh.Subcategory = "Turbo"; int tbCount = GetMapNameCountForCodeBlock("Boost target map", sh.CodeBlock, newSymbols, false); sh.Varname = "Boost target map (" + tbCount.ToString() + ") [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4"); //Console.WriteLine("***** " + sh.Varname + " " + sh.Flash_start_address.ToString("X8")); 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 == 0xDC && sh.Y_axis_ID == 0xC0BA) { 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.X_axis_ID / 256 == 0xDC && sh.Y_axis_ID == 0xC036) { sh.Category = "Detected maps"; sh.Subcategory = "Turbo"; int tbCount = GetMapNameCountForCodeBlock("Boost target map", sh.CodeBlock, newSymbols, false); sh.Varname = "Boost target map (" + tbCount.ToString() + ") [" + 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 == 0xE0 && sh.Y_axis_ID / 256 == 0xC3) { sh.Category = "Detected maps"; sh.Subcategory = "Turbo"; int tbCount = GetMapNameCountForCodeBlock("Boost target map", sh.CodeBlock, newSymbols, false); sh.Varname = "Boost target map (" + tbCount.ToString() + ") [" + 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.Length == 312) { if (sh.X_axis_length == 13 && sh.Y_axis_length == 12) { if (sh.X_axis_ID / 256 == 0xDC && sh.Y_axis_ID / 256 == 0xD7) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int injDurCount = GetMapNameCountForCodeBlock("Start of injection (N108 SOI)", sh.CodeBlock, newSymbols, false); sh.Varname = "Start of injection (N108 SOI) " + injDurCount.ToString() + " [" + 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.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 == 256) // 8*16 { /*if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC1) { 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 %"; }*/ if (sh.X_axis_ID / 256 == 0xDD && 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 == 200) { if (sh.X_axis_ID / 256 == 0xC0 && sh.Y_axis_ID / 256 == 0xDD) { 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 == 0xDC) { 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 == 0xC2BE && sh.Y_axis_ID == 0xE08A) { 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.Length == 192) // 8*12 { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC1) { 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 == 182) // 7*13 { if (sh.X_axis_ID / 256 == 0xDC && 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 == 150) { if (sh.X_axis_length == 3 && sh.Y_axis_length == 25) { 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 == 114) { if (sh.X_axis_length == 3 && sh.Y_axis_length == 19) { 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"; } } } }
public override void NameKnownMaps(byte[] allBytes, SymbolCollection newSymbols, List<CodeBlock> newCodeBlocks) { //N146 Pump Voltage map: 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 == 544) { if (sh.X_axis_length == 16 && sh.Y_axis_length == 17) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC2) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; sh.Varname = "N146 Pump voltage map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; //sh.Correction = 0.001221001; // ?1.221001 //Todo: N146 correction factor for MSA6 sh.X_axis_correction = 0.01; sh.Z_axis_descr = "Pump voltage (V)"; sh.X_axis_descr = "IQ (mg/stroke)"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.YaxisUnits = "rpm"; sh.XaxisUnits = "mg/st"; } } } if (sh.Length == 448) { if (sh.X_axis_length == 16 && sh.Y_axis_length == 14) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC2) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; sh.Varname = "N146 Pump voltage map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; //sh.Correction = 0.001221001; // ?1.221001 //Todo: N146 correction factor for MSA6 sh.X_axis_correction = 0.01; sh.Z_axis_descr = "Pump voltage (V)"; sh.X_axis_descr = "IQ (mg/stroke)"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.YaxisUnits = "rpm"; sh.XaxisUnits = "mg/st"; } } } //12x13 E0 DD = EGR if (sh.Length == 416) { if (sh.X_axis_length == 16 && sh.Y_axis_length == 13) { if (sh.X_axis_ID == 0xE08A && sh.Y_axis_ID == 0xDDD8) { 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.X_axis_ID == 0xE08A && sh.Y_axis_ID == 0xDD30) { 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 == 0xE08A && sh.Y_axis_ID == 0xDEDC) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int injDurCount = GetMapNameCountForCodeBlock("Start of injection (N108 SOI)", sh.CodeBlock, newSymbols, false); sh.Varname = "Start of injection (N108 SOI) " + injDurCount.ToString() + " [" + 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.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 == 0xDE) { 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 == 0xDD) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int injDurCount = GetMapNameCountForCodeBlock("Start of injection (N108 SOI)", sh.CodeBlock, newSymbols, false); sh.Varname = "Start of injection (N108 SOI) " + injDurCount.ToString() + " [" + 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.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.Z_axis_descr = "Start position (degrees BTDC)"; } else if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xDC) { // IQ by MAP 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 if (sh.Length == 384) { if (sh.X_axis_length == 12 && sh.Y_axis_length == 16) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC2) { 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) { int smCount = GetMapNameCountForCodeBlock("Smoke limiter", sh.CodeBlock, newSymbols, false); 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.Length == 320) { if (sh.X_axis_length == 16 && sh.Y_axis_length == 10) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xDC) { int smCount = GetMapNameCountForCodeBlock("Smoke limiter", sh.CodeBlock, newSymbols, false); 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 == 0xE0 && sh.Y_axis_ID / 256 == 0xC3) { sh.Category = "Detected maps"; sh.Subcategory = "Turbo"; int boostTargetCount = GetMapNameCountForCodeBlock("Boost target map", sh.CodeBlock, newSymbols, false); sh.Varname = "Boost target map (" + boostTargetCount.ToString() + ") [" + 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 == 0xE0 && sh.Y_axis_ID / 256 == 0xC2) { sh.Category = "Detected maps"; sh.Subcategory = "Turbo"; int boostTargetCount = GetMapNameCountForCodeBlock("Boost target map", sh.CodeBlock, newSymbols, false); sh.Varname = "Boost target map (" + boostTargetCount.ToString() + ") [" + 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 == 0xE0 && sh.Y_axis_ID / 256 == 0xDD) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; sh.Varname = "IQ to airmass [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Z_axis_descr = "Required airmass"; sh.Correction = 0.1; 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 == 0xE08A && sh.Y_axis_ID == 0xDEDC) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; sh.Varname = "IQ to airmass [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Z_axis_descr = "Required airmass"; sh.Correction = 0.1; 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 == 0xE08A && sh.Y_axis_ID == 0xC2D0) { sh.Category = "Detected maps"; sh.Subcategory = "Turbo"; int boostTargetCount = GetMapNameCountForCodeBlock("Boost target map", sh.CodeBlock, newSymbols, false); sh.Varname = "Boost target map (" + boostTargetCount.ToString() + ") [" + 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) { if (sh.X_axis_length == 16 && sh.Y_axis_length == 8) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC2) { 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 %"; } if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC1) { 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 %"; } if (sh.X_axis_ID / 256 == 0xE0 && 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 == 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.Length == 192) { if (sh.X_axis_length == 12 && sh.Y_axis_length == 8) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC2) { 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 %"; } if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC1) { 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 == 182) // 7*13 { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC1) { 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 %"; } if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC2) { if (IsValidTemperatureAxis(allBytes, sh, MapViewerEx.AxisIdent.Y_Axis)) { 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.Y_axis_descr = "Engine speed (rpm)"; sh.X_axis_descr = "Temperature"; //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 = "°C"; } } } else if (sh.Length == 144) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC0) { 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 == 128) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID == 0xC002) { // check for valid axis data on temp data if (IsValidTemperatureAxis(allBytes, sh, MapViewerEx.AxisIdent.Y_Axis)) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int maflimTempCount = GetMapNameCountForCodeBlock("MAF correction by temperature", sh.CodeBlock, newSymbols, false); maflimTempCount--; sh.Varname = "MAF correction by temperature " + maflimTempCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Z_axis_descr = "Limit"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.X_axis_descr = "Intake air temperature"; //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 = "°C"; } } } 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 == 114) { if (sh.X_axis_length == 3 && sh.Y_axis_length == 19) { 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 == 38) { if (sh.X_axis_length == 19 && sh.Y_axis_length == 1) { if (sh.X_axis_ID / 256 == 0xE0) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int lmCount = GetMapNameCountForCodeBlock("Torque limiter", sh.CodeBlock, newSymbols, false); sh.Varname = "Torque limiter (" + lmCount.ToString() + ") [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Z_axis_descr = "Maximum IQ (mg)"; //sh.Y_axis_descr = "Atm. pressure (mbar)"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.Correction = 0.01; sh.YaxisUnits = "rpm"; } } } 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 == 0xDF4A) { sh.Category = "Detected maps"; sh.Subcategory = "Misc"; sh.Varname = "MAP linearization [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; } } if (sh.X_axis_length == 2 && sh.Y_axis_length == 1) { if (sh.X_axis_ID == 0xC002) // idle RPM { 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"; } } } } }
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"; } } } } } }
public override void NameKnownMaps(byte[] allBytes, SymbolCollection newSymbols, List<CodeBlock> newCodeBlocks) { SymbolAxesTranslator st = new SymbolAxesTranslator(); foreach(SymbolHelper sh in newSymbols) { if (Tools.Instance.m_carMake == CarMakes.BMW) { //Console.WriteLine("Flash startadress: " + sh.Flash_start_address); // Look in X-axis for RPM int maxX = 0; int minX = 0; int maxY = 0; int minY = 0; if (sh.Is1D) { maxX = (sh.Currentdata[2 + sh.X_axis_length * 2 - 2]) * 256 + (sh.Currentdata[2 + sh.X_axis_length * 2 - 1]); minX = maxX;/* (sh.Currentdata[2]) * 256 + (sh.Currentdata[3]); */ } else { maxX = (sh.Currentdata[4 + sh.X_axis_length * 2 - 2]) * 256 + (sh.Currentdata[4 + sh.X_axis_length * 2 - 1]); minX = (sh.Currentdata[4]) * 256 + (sh.Currentdata[5]); } //Console.WriteLine("" + sh.Flash_start_address + sh.Y_axis_offset); // Check max value in Y for 9200 -> RPM if (sh.Is1D) { maxY = (sh.Currentdata[2 + sh.X_axis_length * 2 + sh.Y_axis_length * 2 - 2]) * 256 + (sh.Currentdata[2 + sh.X_axis_length * 2 + sh.Y_axis_length * 2 - 1]); minY = (sh.Currentdata[2 + sh.X_axis_length * 2]) * 256 + (sh.Currentdata[2 + sh.X_axis_length * 2 + 1]); } else { maxY = (sh.Currentdata[4 + sh.X_axis_length * 2 + sh.Y_axis_length * 2 - 2]) * 256 + (sh.Currentdata[4 + sh.X_axis_length * 2 + sh.Y_axis_length * 2 - 1]); minY = (sh.Currentdata[4 + sh.X_axis_length * 2]) * 256 + (sh.Currentdata[4 + sh.X_axis_length * 2 + 1]); } //Console.WriteLine("MinX=" + minX + ", maxX=" + maxX); //Console.WriteLine("MinY=" + minY + ", maxY=" + maxY); /* if((maxX == 10000 && minX == 1400) || // 750->5000rpm (maxX == 10000 && minX == 1000) || // 500->5000rpm (maxX == 9200)) { // ->4600rpm //sh.Category = "Partly detected maps"; //sh.Subcategory = "RPM"; sh.Y_axis_correction = 0.5; sh.YaxisUnits = "rpm"; sh.Y_axis_descr = "rpm"; } */ // Temp-related X-axis if ((minX >= 1731 && maxX <= 3931) && ((minX - 31) % 50 == 0 || (maxX - 31) % 50 == 0 )) { sh.X_axis_correction = 0.1; sh.X_axis_offset = -273.1; //sh.Correction = 0.1; sh.Category = "Partly detected maps - temp"; sh.X_axis_descr = "Temperature"; sh.XaxisUnits = "C"; } if ((sh.X_axis_length == 16 || sh.X_axis_length == 17) && sh.Y_axis_length == 40) { //Injection time sh.Category = "Detected maps"; sh.Subcategory = "Injection timing"; sh.Varname = "Injection time [" + sh.Flash_start_address.ToString("X8") + "]"; sh.X_axis_correction = 0.01; sh.XaxisUnits = "mm3/inj"; sh.X_axis_descr = "mm3/inj"; sh.Z_axis_descr = "time"; sh.Correction = 0.4; sh.Y_axis_correction = 0.1; sh.YaxisUnits = "bar"; sh.Y_axis_descr = "bar"; } if (sh.X_axis_length == 16 && sh.Y_axis_length == 16 && (maxY == 7000 || maxY == 7500) && minY == 0) { // Todo! Check steps in X and/or Y to further isolate maps! // Injection timing sh.Category = "Detected maps"; sh.Subcategory = "Injection timing"; sh.Varname = "Injection timing map [" + sh.Flash_start_address.ToString("X8") + "]"; sh.X_axis_correction = 0.01; sh.XaxisUnits = "mm3/cyc"; sh.X_axis_descr = "mm3/cyc"; sh.Z_axis_descr = "Injection timing"; sh.Correction = 0.021969; } if ((sh.X_axis_length == 14 && sh.Y_axis_length == 8)) { //|| // 14x8 //(sh.X_axis_length == 8 && sh.Y_axis_length == 1 ) ) { // 8x1(0) torquelimiter sh.Category = "Detected maps"; sh.Subcategory = "Torque"; sh.Varname = "Pedal request map [" + sh.Flash_start_address.ToString("X8") + "]"; sh.X_axis_correction = 0.01220703125; sh.X_axis_descr = "Percent"; sh.Y_axis_correction = 0.5; sh.Y_axis_descr = "RPM"; sh.Z_axis_descr = "Torque (Nm)"; sh.XaxisUnits = "%"; sh.Correction = 0.1; } if (sh.X_axis_length == 8 && sh.Y_axis_length == 10 && (maxY % 2 == 1 || minY % 2 == 1)) { // 8x10 and odd data sh.Category = "Detected maps"; sh.Subcategory = "Torque"; sh.Varname = "Torque limit given temp [" + sh.Flash_start_address.ToString("X8") + "]"; sh.Y_axis_correction = 0.5; sh.Y_axis_descr = "RPM"; sh.X_axis_correction = 0.1; sh.X_axis_offset = -273.1; sh.Correction = 0.1; sh.X_axis_descr = "Temperature"; sh.Z_axis_descr = "Torque (Nm)"; sh.XaxisUnits = "C"; } if (sh.X_axis_length == 21 && sh.Y_axis_length == 3) { // 21x3, only one exist in BMW-files sh.Category = "Detected maps"; sh.Subcategory = "Torque"; sh.Varname = "Torque limit for speed [" + sh.Flash_start_address.ToString("X8") + "]"; sh.Y_axis_correction = 0.5; sh.Y_axis_descr = "RPM"; sh.X_axis_correction = 1; sh.Correction = 0.1; sh.X_axis_descr = "#"; sh.Z_axis_descr = "Torque (Nm)"; sh.XaxisUnits = "#"; } /* // These addresses are only valid for one specific boschnumber.... Needs to be more general if(sh.Flash_start_address == 0x75200 || sh.Flash_start_address == 0x75444 || sh.Flash_start_address == 0x75688) { sh.Varname = "Fuel quantity injected [" + sh.Flash_start_address.ToString("X8") + "]"; sh.Category = "Detected maps"; sh.Subcategory = "Injected Fuel"; sh.Y_axis_correction = 0.5; sh.YaxisUnits = "RPM"; sh.Y_axis_descr = "rpm"; sh.X_axis_correction = 0.1; sh.XaxisUnits = "Nm"; sh.X_axis_descr = "Nm"; sh.Z_axis_descr = "Fuel injected quantity f(RPM,Trq)"; sh.Correction = 0.01; } if(sh.Flash_start_address == 0x52036) { sh.Varname = "Gas quantity recirculation [" + sh.Flash_start_address.ToString("X8") + "]"; sh.Category = "Detected maps"; sh.Subcategory = "Air control"; sh.Y_axis_correction = 0.5; sh.YaxisUnits = "RPM"; sh.Y_axis_descr = "rpm"; sh.X_axis_correction = 0.01; sh.XaxisUnits = "mm3/hub"; sh.X_axis_descr = "mm3"; sh.Z_axis_descr = "Gas quantity"; sh.Correction = 0.1; } if(sh.Flash_start_address == 0x6EFE4) { sh.Varname = "Limiter of turbo f(APS)[" + sh.Flash_start_address.ToString("X8") + "]"; sh.Category = "Detected maps"; sh.Subcategory = "Turbo"; sh.Y_axis_correction = 0.5; sh.YaxisUnits = "RPM"; sh.Y_axis_descr = "rpm"; sh.X_axis_correction = 1; sh.XaxisUnits = "hPa"; sh.X_axis_descr = "hPa"; sh.Z_axis_descr = "Pressure"; sh.Correction = 1; } */ } } }
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 == 450) { if (sh.X_axis_length == 15 && sh.Y_axis_length == 15) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xFC) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int injDurCount = GetMapNameCountForCodeBlock("Start of injection (SOI)", sh.CodeBlock, newSymbols, false); double tempRange = 0;// 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.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.Correction = 0.023437; sh.Z_axis_descr = "Start position (degrees BTDC)"; } } } //12x13 E0 DD = EGR if (sh.Length == 312) { if (sh.X_axis_length == 13 && sh.Y_axis_length == 12) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xDD) { 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 == 208) { if (sh.X_axis_length == 13 && sh.Y_axis_length == 8) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC1) { 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 == 182) // 7*13 { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC1) { 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 == 176) { if (sh.X_axis_length == 11 && sh.Y_axis_length == 8) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC2) { int smCount = GetMapNameCountForCodeBlock("Smoke limiter", sh.CodeBlock, newSymbols, false); 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.Length == 40) { if (sh.X_axis_length == 20 && sh.Y_axis_length == 1) { if (sh.X_axis_ID / 256 == 0xE0) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int lmCount = GetMapNameCountForCodeBlock("Torque limiter", sh.CodeBlock, newSymbols, false); sh.Varname = "Torque limiter (" + lmCount.ToString() + ") [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Z_axis_descr = "Maximum IQ (mg)"; //sh.Y_axis_descr = "Atm. pressure (mbar)"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.Correction = 0.01; sh.YaxisUnits = "rpm"; } } } } }
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.X_axis_length == 4 && sh.Y_axis_length == 20) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; //int lmCount = GetMapNameCountForCodeBlock("Torque limiter", sh.CodeBlock, newSymbols, false); 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.Y_axis_descr = "Engine speed (rpm)"; sh.Correction = 0.01; sh.YaxisUnits = "rpm"; } if (sh.X_axis_length == 4 && sh.Y_axis_length == 21) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; //int lmCount = GetMapNameCountForCodeBlock("Torque limiter", sh.CodeBlock, newSymbols, false); 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.Y_axis_descr = "Engine speed (rpm)"; sh.Correction = 0.01; sh.YaxisUnits = "rpm"; } else if (sh.X_axis_length == 3 && sh.Y_axis_length == 21) { if (!CollectionContainsMapInSize(newSymbols, 21, 4)) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; //int lmCount = GetMapNameCountForCodeBlock("Torque limiter", sh.CodeBlock, newSymbols, false); 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.Y_axis_descr = "Engine speed (rpm)"; sh.Correction = 0.01; sh.YaxisUnits = "rpm"; } } else if (sh.X_axis_length == 16 && sh.Y_axis_length == 8) { sh.Category = "Detected maps"; sh.Subcategory = "Misc"; int dwCount = GetMapNameCountForCodeBlock("Driver wish ", sh.CodeBlock, newSymbols, false); sh.Varname = "Driver wish (" + dwCount.ToString() + ") [" + 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.X_axis_length == 15 && sh.Y_axis_length == 16) { sh.Category = "Detected maps"; sh.Subcategory = "Misc"; sh.Varname = "IQ to Torque conversion [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Correction = 0.01; sh.X_axis_correction = 0.1; sh.X_axis_descr = "Torque"; sh.Z_axis_descr = "IQ (mg)"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.YaxisUnits = "rpm"; sh.XaxisUnits = "Nm"; } else if (sh.X_axis_length == 11 && sh.Y_axis_length == 10) { 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.X_axis_descr = "Atmospheric pressure (mbar)"; sh.Z_axis_descr = "Maximum boost pressure (mbar)"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.YaxisUnits = "rpm"; sh.XaxisUnits = "mbar"; } else if (sh.X_axis_length == 19 && sh.Y_axis_length == 15) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int injDurCount = GetMapNameCountForCodeBlock("Injector duration", sh.CodeBlock, newSymbols, false); 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; // TODO: Check for x or y 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_length == 16 && sh.Y_axis_length == 12) { //int xmax = GetMaxAxisValue(allBytes, sh, MapViewerEx.AxisIdent.X_Axis); //int ymax = GetMaxAxisValue(allBytes, sh, MapViewerEx.AxisIdent.Y_Axis); //Console.WriteLine(xmax.ToString() + " " + ymax.ToString() + " " + sh.Flash_start_address.ToString("X8")); if (GetMaxAxisValue(allBytes, sh, MapViewerEx.AxisIdent.Y_Axis) < 4000) { 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 = "Manifold pressure (mbar)"; sh.Correction = 0.01; //sh.X_axis_correction = 0.1; // TODO: Check for x or y sh.YaxisUnits = "rpm"; sh.XaxisUnits = "mbar"; } } else if (sh.X_axis_length == 16 && sh.Y_axis_length == 14) { // SOI sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int injDurCount = GetMapNameCountForCodeBlock("Start of injection (SOI)", sh.CodeBlock, newSymbols, false); //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) " + injDurCount.ToString() + " [" + 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)"; } } }
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.X_axis_length == 4 && sh.Y_axis_length == 20) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; //int lmCount = GetMapNameCountForCodeBlock("Torque limiter", sh.CodeBlock, newSymbols, false); 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.Y_axis_descr = "Engine speed (rpm)"; sh.Correction = 0.01; sh.YaxisUnits = "rpm"; } if (sh.X_axis_length == 4 && sh.Y_axis_length == 21) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; //int lmCount = GetMapNameCountForCodeBlock("Torque limiter", sh.CodeBlock, newSymbols, false); 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.Y_axis_descr = "Engine speed (rpm)"; sh.Correction = 0.01; sh.YaxisUnits = "rpm"; } else if (sh.X_axis_length == 3 && sh.Y_axis_length == 21) { if (!CollectionContainsMapInSize(newSymbols, 21, 4)) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; //int lmCount = GetMapNameCountForCodeBlock("Torque limiter", sh.CodeBlock, newSymbols, false); 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.Y_axis_descr = "Engine speed (rpm)"; sh.Correction = 0.01; sh.YaxisUnits = "rpm"; } } else if (sh.X_axis_length == 16 && sh.Y_axis_length == 8) { sh.Category = "Detected maps"; sh.Subcategory = "Misc"; int dwCount = GetMapNameCountForCodeBlock("Driver wish ", sh.CodeBlock, newSymbols, false); sh.Varname = "Driver wish (" + dwCount.ToString() + ") [" + 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.X_axis_length == 15 && sh.Y_axis_length == 16) { sh.Category = "Detected maps"; sh.Subcategory = "Misc"; sh.Varname = "IQ to Torque conversion [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Correction = 0.01; sh.X_axis_correction = 0.1; sh.X_axis_descr = "Torque"; sh.Z_axis_descr = "IQ (mg)"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.YaxisUnits = "rpm"; sh.XaxisUnits = "Nm"; } else if (sh.X_axis_length == 11 && sh.Y_axis_length == 10) { 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.X_axis_descr = "Atmospheric pressure (mbar)"; sh.Z_axis_descr = "Maximum boost pressure (mbar)"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.YaxisUnits = "rpm"; sh.XaxisUnits = "mbar"; } else if (sh.X_axis_length == 19 && sh.Y_axis_length == 15) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int injDurCount = GetMapNameCountForCodeBlock("Injector duration", sh.CodeBlock, newSymbols, false); 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; // TODO: Check for x or y 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_length == 16 && sh.Y_axis_length == 12) { //int xmax = GetMaxAxisValue(allBytes, sh, MapViewerEx.AxisIdent.X_Axis); //int ymax = GetMaxAxisValue(allBytes, sh, MapViewerEx.AxisIdent.Y_Axis); //Console.WriteLine(xmax.ToString() + " " + ymax.ToString() + " " + sh.Flash_start_address.ToString("X8")); if (GetMaxAxisValue(allBytes, sh, MapViewerEx.AxisIdent.Y_Axis) < 4000) { 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 = "Manifold pressure (mbar)"; sh.Correction = 0.01; //sh.X_axis_correction = 0.1; // TODO: Check for x or y sh.YaxisUnits = "rpm"; sh.XaxisUnits = "mbar"; } } else if (sh.X_axis_length == 16 && sh.Y_axis_length == 14) { // SOI sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int injDurCount = GetMapNameCountForCodeBlock("Start of injection (SOI)", sh.CodeBlock, newSymbols, false); //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) " + injDurCount.ToString() + " [" + 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)"; } } }
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) { SymbolAxesTranslator sat = new SymbolAxesTranslator(); string x = string.Empty; if (x_axisvalues.Length > 0 && x_axisAddress > 0) { x = X_axis_name + " (" + x_axisAddress.ToString("X8") + ")"; } string y = string.Empty; if (y_axisvalues.Length > 0 && y_axisAddress > 0) { y = Y_axis_name + " (" + y_axisAddress.ToString("X8") + ")"; } if (x != string.Empty) { editXaxisSymbolToolStripMenuItem.Enabled = true; editXaxisSymbolToolStripMenuItem.Text = "Edit x-axis (" + x + ")"; } else { editXaxisSymbolToolStripMenuItem.Enabled = false; editXaxisSymbolToolStripMenuItem.Text = "Edit x-axis"; } if (y != string.Empty) { editYaxisSymbolToolStripMenuItem.Enabled = true; editYaxisSymbolToolStripMenuItem.Text = "Edit y-axis (" + y + ")"; } else { editYaxisSymbolToolStripMenuItem.Enabled = false; editYaxisSymbolToolStripMenuItem.Text = "Edit y-axis"; } }
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.Y_axis_correction = 0.000039; sh.Correction = 0.01; sh.X_axis_descr = "Engine speed (rpm)"; //sh.Y_axis_descr = "Ratio vehicle/engine speed"; sh.Y_axis_descr = "Approx. vehicle speed (km/h)"; //sh.Z_axis_descr = "Output percentage"; sh.Z_axis_descr = "IQ limit"; sh.YaxisUnits = "km/h"; sh.XaxisUnits = "rpm"; } if (sh.Length == 544) { if (sh.X_axis_length == 16 && sh.Y_axis_length == 17) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC2) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; sh.Varname = "N146 Pump voltage map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Correction = 1.221001; sh.X_axis_correction = 0.01; sh.Z_axis_descr = "Pump voltage (mV)"; 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 == 0xDD && sh.Y_axis_ID / 256 == 0xC0) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; sh.Varname = "N146 Pump voltage map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Correction = 1.221001; sh.X_axis_correction = 0.01; sh.Z_axis_descr = "Pump voltage (mV)"; sh.X_axis_descr = "IQ (mg/stroke)"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.YaxisUnits = "rpm"; sh.XaxisUnits = "mg/st"; } } } if (sh.Length == 512) { if (sh.X_axis_length == 16 && sh.Y_axis_length == 16) { if (sh.X_axis_ID / 256 == 0xDD && sh.Y_axis_ID / 256 == 0xC0) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; sh.Varname = "N146 Pump voltage map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Correction = 1.221001; sh.X_axis_correction = 0.01; sh.Z_axis_descr = "Pump voltage (mV)"; sh.X_axis_descr = "IQ (mg/stroke)"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.YaxisUnits = "rpm"; sh.XaxisUnits = "mg/st"; } } } if (sh.Length == 480) { if (sh.X_axis_length == 16 && sh.Y_axis_length == 15) { if (sh.X_axis_ID == 0xDD7C && sh.Y_axis_ID == 0xC064) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; sh.Varname = "N146 Pump voltage map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Correction = 1.221001; sh.X_axis_correction = 0.01; sh.Z_axis_descr = "Pump voltage (mV)"; 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 == 0xDDDC && sh.Y_axis_ID == 0xC07C) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; sh.Varname = "N146 Pump voltage map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Correction = 1.221001; sh.X_axis_correction = 0.01; sh.Z_axis_descr = "Pump voltage (mV)"; 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 == 0xDD52 && sh.Y_axis_ID == 0xC080) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; sh.Varname = "N146 Pump voltage map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Correction = 1.221001; sh.X_axis_correction = 0.01; sh.Z_axis_descr = "Pump voltage (mV)"; 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 == 0xC2) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; sh.Varname = "N146 Pump voltage map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Correction = 1.221001; sh.X_axis_correction = 0.01; sh.Z_axis_descr = "Pump voltage (mV)"; 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 == 0xEB && sh.Y_axis_ID / 256 == 0xC0) //<GS-20120913> { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; sh.Varname = "N146 Pump voltage map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Correction = 1.221001; sh.X_axis_correction = 0.01; sh.Z_axis_descr = "Pump voltage (mV)"; 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 == 0xDD && sh.Y_axis_ID == 0xC044) // <GS-20120913> { 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.Length == 468) { if (sh.X_axis_length == 13 && sh.Y_axis_length == 18) { if (sh.X_axis_ID / 256 == 0xDC && sh.Y_axis_ID / 256 == 0xC0) { 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.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.X_axis_ID / 256 == 0xDD && sh.Y_axis_ID / 256 == 0xC0) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int pumpVCount = GetMapNameCountForCodeBlock("N146 Pump voltage map", sh.CodeBlock, newSymbols, false); sh.Varname = "N146 Pump voltage map (" +pumpVCount.ToString() + ") [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Correction = 1.221001; sh.X_axis_correction = 0.01; sh.Z_axis_descr = "Pump voltage (mV)"; 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 == 0xC2) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int pumpVCount = GetMapNameCountForCodeBlock("N146 Pump voltage map", sh.CodeBlock, newSymbols, false); sh.Varname = "N146 Pump voltage map (" + pumpVCount.ToString() + ") [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Correction = 1.221001; sh.X_axis_correction = 0.01; sh.Z_axis_descr = "Pump voltage (mV)"; 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 == 416) { if (sh.X_axis_length == 0x10 && sh.Y_axis_length == 0x0d) { if (sh.X_axis_ID / 256 == 0xF9 && sh.Y_axis_ID / 256 == 0xDB) { // this is IQ by MAF limiter! sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int smokeCount = GetMapNameCountForCodeBlock("Smoke limiter", sh.CodeBlock, newSymbols, false); sh.Varname = "Smoke limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; if (sh.MapSelector != null) { if (sh.MapSelector.MapIndexes != null) { if (sh.MapSelector.MapIndexes.Length > 1) { if (!MapSelectorIndexEmpty(sh)) { double tempRange = GetTemperatureSOIRange(sh.MapSelector, smokeCount - 1); sh.Varname = "Smoke limiter " + 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.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 == 0xF9 && sh.Y_axis_ID / 256 == 0xDA) { // this is IQ by MAF limiter! sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int smokeCount = GetMapNameCountForCodeBlock("Smoke limiter", sh.CodeBlock, newSymbols, false); sh.Varname = "Smoke limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; if (sh.MapSelector != null) { if (sh.MapSelector.MapIndexes != null) { if (sh.MapSelector.MapIndexes.Length > 1) { if (!MapSelectorIndexEmpty(sh)) { double tempRange = GetTemperatureSOIRange(sh.MapSelector, smokeCount - 1); sh.Varname = "Smoke limiter " + 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.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 == 0xDC64 && sh.Y_axis_ID == 0xDA2A) { 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 == 0xDC && sh.Y_axis_ID / 256 == 0xDA) { // this is IQ by MAF limiter! sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int smokeCount = GetMapNameCountForCodeBlock("Smoke limiter II", sh.CodeBlock, newSymbols, false); sh.Varname = "Smoke limiter II [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; if (sh.MapSelector != null) { if (sh.MapSelector.MapIndexes != null) { if (sh.MapSelector.MapIndexes.Length > 1) { if (!MapSelectorIndexEmpty(sh)) { double tempRange = GetTemperatureSOIRange(sh.MapSelector, smokeCount - 1); sh.Varname = "Smoke limiter " + 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.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 == 0xDDDC && sh.Y_axis_ID == 0xDA52) { 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 == 0xDD50 && sh.Y_axis_ID == 0xEA44) //<GS-20120913> { 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 == 0xEBDA && sh.Y_axis_ID == 0xEA5A) //<GS-20120913> { 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 == 0xE08A && sh.Y_axis_ID == 0xDDD8) { 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 == 0xDD7A && sh.Y_axis_ID == 0xD9B6) { 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 == 0xDC && 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.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 == 0xDD7C && sh.Y_axis_ID == 0xD9B6) { 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 & 0xFFF0) == 0xDD50 && sh.Y_axis_ID == 0xC01E) //<GS-20120913> { //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 if (sh.X_axis_ID == 0xDD50 && sh.Y_axis_ID == 0xC024) //<GS-20120913> { //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 if (sh.X_axis_ID == 0xEBDA && sh.Y_axis_ID == 0xC048) //<GS-20120913> { //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 if (sh.X_axis_ID == 0xDD7C && sh.Y_axis_ID == 0xD904) { //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 if (sh.X_axis_ID == 0xDC64 && sh.Y_axis_ID == 0xD908) { //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 if (sh.X_axis_ID == 0xDD7A && sh.Y_axis_ID == 0xD904) { //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 if (sh.X_axis_ID == 0xDDDC && sh.Y_axis_ID == 0xD908) { //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 if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID == 0xDE00) { // 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 if (sh.X_axis_ID == 0xE08A && sh.Y_axis_ID == 0xDD30) { // 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 if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xDE) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int injDurCount = GetMapNameCountForCodeBlock("Start of injection (N108 SOI)", sh.CodeBlock, newSymbols, false); sh.Varname = "Start of injection (N108 SOI) " + injDurCount.ToString() + " [" + 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_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.Correction = 0.023437; //sh.Offset = 78; sh.Z_axis_descr = "Start position (degrees BTDC)"; } else if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xDD) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int injDurCount = GetMapNameCountForCodeBlock("Start of injection (N108 SOI)", sh.CodeBlock, newSymbols, false); sh.Varname = "Start of injection (N108 SOI) " + injDurCount.ToString() + " [" + 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_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.Correction = 0.023437; //sh.Offset = 78; sh.Z_axis_descr = "Start position (degrees BTDC)"; } else if (sh.X_axis_ID / 256 == 0xDD && sh.Y_axis_ID / 256 == 0xDC) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int injDurCount = GetMapNameCountForCodeBlock("Start of injection (N108 SOI)", sh.CodeBlock, newSymbols, false); sh.Varname = "Start of injection (N108 SOI) " + injDurCount.ToString() + " [" + 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_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.Correction = 0.023437; //sh.Offset = 78; sh.Z_axis_descr = "Start position (degrees BTDC)"; } } } if (sh.Length == 392) { if (sh.X_axis_length == 14 && sh.Y_axis_length == 14) { if (sh.X_axis_ID / 256 == 0xDC && sh.Y_axis_ID / 256 == 0xC0) { //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"; } } } if (sh.Length == 384) { if (sh.X_axis_ID / 256 == 0xDD && sh.Y_axis_ID / 256 == 0xC0) { // inv driver wish 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_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC1) { // inv driver wish 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_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC2) { // inv driver wish 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_ID == 0xEBDA && sh.Y_axis_ID == 0xC04A) //<GS-20120913> { // inv driver wish 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_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xDC) { // smoke limiter if (sh.X_axis_length == 16 && sh.Y_axis_length == 12) { int smokeCount = GetMapNameCountForCodeBlock("Smoke limiter", sh.CodeBlock, newSymbols, false); sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; sh.Varname = "Smoke limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; if (sh.MapSelector != null) { if (sh.MapSelector.MapIndexes != null) { if (sh.MapSelector.MapIndexes.Length > 1) { if (!MapSelectorIndexEmpty(sh)) { double tempRange = GetTemperatureSOIRange(sh.MapSelector, smokeCount - 1); sh.Varname = "Smoke limiter " + 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.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 == 0xDD && sh.Y_axis_ID / 256 == 0xDA) { // smoke limiter if (sh.X_axis_length == 16 && sh.Y_axis_length == 12) { int smokeCount = GetMapNameCountForCodeBlock("Smoke limiter", sh.CodeBlock, newSymbols, false); sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; sh.Varname = "Smoke limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; if (sh.MapSelector != null) { if (sh.MapSelector.MapIndexes != null) { if (sh.MapSelector.MapIndexes.Length > 1) { if (!MapSelectorIndexEmpty(sh)) { double tempRange = GetTemperatureSOIRange(sh.MapSelector, smokeCount - 1); sh.Varname = "Smoke limiter " + 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.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 == 0xDC && sh.Y_axis_ID / 256 == 0xD9) { //EGR if (sh.X_axis_length == 16 && sh.Y_axis_length == 12) { 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 == 0xDD && sh.Y_axis_ID / 256 == 0xD9) { //EGR if (sh.X_axis_length == 16 && sh.Y_axis_length == 12) { 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"; } } } if (sh.Length == 364) { if (sh.X_axis_length == 14 && sh.Y_axis_length == 13) { if (sh.X_axis_ID / 256 == 0xDC && sh.Y_axis_ID / 256 == 0xC0) { //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"; } if (sh.X_axis_ID / 256 == 0xDC && sh.Y_axis_ID / 256 == 0xD9) { //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"; } } } if (sh.Length == 338) { if (sh.X_axis_length == 13 && sh.Y_axis_length == 13) { if (sh.X_axis_ID / 256 == 0xDC && sh.Y_axis_ID / 256 == 0xD9) { //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"; } } } if (sh.Length == 320) // 16*10 { if (sh.X_axis_ID / 256 == 0xDD && sh.Y_axis_ID / 256 == 0xC0) { sh.Category = "Detected maps"; sh.Subcategory = "Turbo"; int tbCount = GetMapNameCountForCodeBlock("Boost target map", sh.CodeBlock, newSymbols, false); sh.Varname = "Boost target map (" + tbCount.ToString() + ") [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]";// " + sh.Flash_start_address.ToString("X8") + " " + sh.X_axis_ID.ToString("X4") + " " + sh.Y_axis_ID.ToString("X4"); //Console.WriteLine("***** " + sh.Varname + " " + sh.Flash_start_address.ToString("X8")); 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 == 0xDC && sh.Y_axis_ID == 0xC0BA) { 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.X_axis_ID / 256 == 0xDC && (sh.Y_axis_ID & 0xFFF0) == 0xC030) { sh.Category = "Detected maps"; sh.Subcategory = "Turbo"; int tbCount = GetMapNameCountForCodeBlock("Boost target map", sh.CodeBlock, newSymbols, false); sh.Varname = "Boost target map (" + tbCount.ToString() + ") [" + 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 == 0xE0 && sh.Y_axis_ID / 256 == 0xC3) { sh.Category = "Detected maps"; sh.Subcategory = "Turbo"; int tbCount = GetMapNameCountForCodeBlock("Boost target map", sh.CodeBlock, newSymbols, false); sh.Varname = "Boost target map (" + tbCount.ToString() + ") [" + 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 == 0xEBDA && sh.Y_axis_ID == 0xC03A) //<GS-20120913> { sh.Category = "Detected maps"; sh.Subcategory = "Turbo"; int tbCount = GetMapNameCountForCodeBlock("Boost target map", sh.CodeBlock, newSymbols, false); sh.Varname = "Boost target map (" + tbCount.ToString() + ") [" + 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 == 0xDD && sh.Y_axis_ID / 256 == 0xDA) { // SMOKE sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int smokeCount = GetMapNameCountForCodeBlock("Smoke limiter", sh.CodeBlock, newSymbols, false); sh.Varname = "Smoke limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; if (sh.MapSelector != null) { if (sh.MapSelector.MapIndexes != null) { if (sh.MapSelector.MapIndexes.Length > 1) { if (!MapSelectorIndexEmpty(sh)) { double tempRange = GetTemperatureSOIRange(sh.MapSelector, smokeCount - 1); sh.Varname = "Smoke limiter " + 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.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 == 0xE0 && sh.Y_axis_ID / 256 == 0xDC) //<GS-20120913> { // SMOKE sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int smokeCount = GetMapNameCountForCodeBlock("Smoke limiter", sh.CodeBlock, newSymbols, false); sh.Varname = "Smoke limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; if (sh.MapSelector != null) { if (sh.MapSelector.MapIndexes != null) { if (sh.MapSelector.MapIndexes.Length > 1) { if (!MapSelectorIndexEmpty(sh)) { double tempRange = GetTemperatureSOIRange(sh.MapSelector, smokeCount - 1); sh.Varname = "Smoke limiter " + 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.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 == 0xEBDA && sh.Y_axis_ID == 0xDA70) //<GS-20120913> { // SMOKE sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int smokeCount = GetMapNameCountForCodeBlock("Smoke limiter", sh.CodeBlock, newSymbols, false); sh.Varname = "Smoke limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; if (sh.MapSelector != null) { if (sh.MapSelector.MapIndexes != null) { if (sh.MapSelector.MapIndexes.Length > 1) { if (!MapSelectorIndexEmpty(sh)) { double tempRange = GetTemperatureSOIRange(sh.MapSelector, smokeCount - 1); sh.Varname = "Smoke limiter " + 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.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 == 0xDA && sh.Y_axis_ID / 256 == 0xDA) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; sh.Varname = "Boost correction by temperature [" + 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 = "IAT (celcius)"; sh.X_axis_correction = 0.1; sh.X_axis_offset = -273.1; sh.Y_axis_descr = "Requested boost"; sh.Z_axis_descr = "Boost limit (mbar)"; sh.YaxisUnits = "mbar"; sh.XaxisUnits = "degC"; } } if (sh.Length == 312) { if (sh.X_axis_length == 13 && sh.Y_axis_length == 12) { if (sh.X_axis_ID / 256 == 0xDC && sh.Y_axis_ID / 256 == 0xD7) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int injDurCount = GetMapNameCountForCodeBlock("Start of injection (N108 SOI)", sh.CodeBlock, newSymbols, false); sh.Varname = "Start of injection (N108 SOI) " + injDurCount.ToString() + " [" + 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.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 == 256) // 8*16 { /*if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC1) { 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 %"; }*/ if (sh.X_axis_ID / 256 == 0xDD && 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 %"; } if (sh.X_axis_ID / 256 == 0xEB && 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 == 288) { if (sh.X_axis_length == 16 && 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 == 208) { if (sh.X_axis_length == 13 && sh.Y_axis_length == 8) { if (sh.X_axis_ID / 256 == 0xDC && 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 == 200) { if (sh.X_axis_ID / 256 == 0xC0 && sh.Y_axis_ID / 256 == 0xDD) { 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 == 0xDC) { 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 & 0xFFF0) == 0xC2B0 && sh.Y_axis_ID == 0xE08A) //<GS-20120913> { 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 == 0xC034 && sh.Y_axis_ID == 0xEBDA) //<GS-20120913> { 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.Length == 192) // 8*12 { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC1) { 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 %"; } if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC2) //<GS-20120913> { 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 %"; } if (sh.X_axis_ID / 256 == 0xDD && 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 %"; } if (sh.X_axis_ID == 0xEBDA && sh.Y_axis_ID / 256 == 0xC0) //<GS-20120913> { 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 == 182) // 7*13 { if (sh.X_axis_ID / 256 == 0xDC && 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.X_axis_ID / 256 == 0xDD && sh.Y_axis_ID / 256 == 0xC3) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; sh.Varname = "SOI limiter (temperature) [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; //sh.Correction = -0.023437; //sh.Offset = 78; sh.Correction = 0.023437; sh.Y_axis_descr = "Engine speed (rpm)"; sh.X_axis_descr = "Temperature"; //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 = "°C"; } else if (sh.X_axis_ID / 256 == 0xDC && sh.Y_axis_ID / 256 == 0xC5) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; sh.Varname = "SOI limiter (temperature) [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; //sh.Correction = -0.023437; //sh.Offset = 78; sh.Correction = 0.023437; sh.Y_axis_descr = "Engine speed (rpm)"; sh.X_axis_descr = "Temperature"; //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 = "°C"; } } else if (sh.Length == 162) { if (sh.X_axis_length == 9 && sh.Y_axis_length == 9) { if (sh.X_axis_ID / 256 == 0xDD && sh.Y_axis_ID / 256 == 0xC1) { // Start IQ 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"; } if (sh.X_axis_ID == 0xEBDA && sh.Y_axis_ID / 256 == 0xC1) //<GS-20120913> { // Start IQ 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 == 150) { if (sh.X_axis_length == 3 && sh.Y_axis_length == 25) { 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 == 144) { if (sh.X_axis_ID / 256 == 0xDC && sh.Y_axis_ID / 256 == 0xC1) { // Start IQ 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 == 138) { 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 == 128) { if (sh.X_axis_ID / 256 == 0xDD && sh.Y_axis_ID == 0xC1A0) { // check for valid axis data on temp data if (IsValidTemperatureAxis(allBytes, sh, MapViewerEx.AxisIdent.Y_Axis)) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int maflimTempCount = GetMapNameCountForCodeBlock("MAF correction by temperature", sh.CodeBlock, newSymbols, false); maflimTempCount--; sh.Varname = "MAF correction by temperature " + maflimTempCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Z_axis_descr = "Limit"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.X_axis_descr = "Intake air temperature"; //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 = "°C"; } } if (sh.X_axis_ID / 256 == 0xDC && sh.Y_axis_ID / 256 == 0xC1) { // check for valid axis data on temp data if (IsValidTemperatureAxis(allBytes, sh, MapViewerEx.AxisIdent.Y_Axis)) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int maflimTempCount = GetMapNameCountForCodeBlock("MAF correction by temperature", sh.CodeBlock, newSymbols, false); maflimTempCount--; sh.Varname = "MAF correction by temperature " + maflimTempCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Z_axis_descr = "Limit"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.X_axis_descr = "Intake air temperature"; //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 = "°C"; } } if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID == 0xC002) { // check for valid axis data on temp data if (IsValidTemperatureAxis(allBytes, sh, MapViewerEx.AxisIdent.Y_Axis)) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int maflimTempCount = GetMapNameCountForCodeBlock("MAF correction by temperature", sh.CodeBlock, newSymbols, false); maflimTempCount--; sh.Varname = "MAF correction by temperature " + maflimTempCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Z_axis_descr = "Limit"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.X_axis_descr = "Intake air temperature"; //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 = "°C"; } } if ((sh.X_axis_ID & 0xFFF0) == 0xDD70 && sh.Y_axis_ID == 0xC134) { // check for valid axis data on temp data if (IsValidTemperatureAxis(allBytes, sh, MapViewerEx.AxisIdent.Y_Axis)) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int maflimTempCount = GetMapNameCountForCodeBlock("MAF correction by temperature", sh.CodeBlock, newSymbols, false); maflimTempCount--; sh.Varname = "MAF correction by temperature " + maflimTempCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Z_axis_descr = "Limit"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.X_axis_descr = "Intake air temperature"; //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 = "°C"; } } if (sh.X_axis_ID == 0xEBDA && sh.Y_axis_ID == 0xC1AA) { // check for valid axis data on temp data if (IsValidTemperatureAxis(allBytes, sh, MapViewerEx.AxisIdent.Y_Axis)) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int maflimTempCount = GetMapNameCountForCodeBlock("MAF correction by temperature", sh.CodeBlock, newSymbols, false); maflimTempCount--; sh.Varname = "MAF correction by temperature " + maflimTempCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Z_axis_descr = "Limit"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.X_axis_descr = "Intake air temperature"; //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 = "°C"; } } if (sh.X_axis_ID / 256 == 0xDD && sh.Y_axis_ID == 0xC1A4) { // check for valid axis data on temp data if (IsValidTemperatureAxis(allBytes, sh, MapViewerEx.AxisIdent.Y_Axis)) { // Start IQ 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 == 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 == 114) { if (sh.X_axis_length == 3 && sh.Y_axis_length == 19) { 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 == 38) { if (sh.X_axis_length == 19 && sh.Y_axis_length == 1) { if (sh.X_axis_ID == 0xe08a) { 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 == 26) { if (sh.X_axis_ID == 0xD904) { if (sh.X_axis_length == 13 && 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 == 0xDCD4) { sh.Category = "Detected maps"; sh.Subcategory = "Misc"; sh.Varname = "MAP linearization [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; } if (sh.X_axis_ID == 0xDD28) { 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"; } } } } } }
private void StartTableViewer() { if (gridViewSymbols.SelectedRowsCount > 0) { int[] selrows = gridViewSymbols.GetSelectedRows(); if (selrows.Length > 0) { int row = (int)selrows.GetValue(0); if (row >= 0) { SymbolHelper sh = (SymbolHelper)gridViewSymbols.GetRow((int)selrows.GetValue(0)); if (sh.Flash_start_address == 0 && sh.Start_address == 0) return; if (sh == null) return; DevExpress.XtraBars.Docking.DockPanel dockPanel; bool pnlfound = false; pnlfound = CheckMapViewerActive(sh); if (!pnlfound) { dockManager1.BeginUpdate(); try { MapViewerEx tabdet = new MapViewerEx(); tabdet.AutoUpdateIfSRAM = false; tabdet.AutoUpdateInterval = 99999; tabdet.SetViewSize(ViewSize.NormalView); tabdet.Visible = false; tabdet.Filename = Tools.Instance.m_currentfile; tabdet.GraphVisible = true; tabdet.Viewtype = m_appSettings.DefaultViewType; tabdet.DisableColors = m_appSettings.DisableMapviewerColors; tabdet.AutoSizeColumns = m_appSettings.AutoSizeColumnsInWindows; tabdet.GraphVisible = m_appSettings.ShowGraphs; tabdet.IsRedWhite = m_appSettings.ShowRedWhite; tabdet.SetViewSize(m_appSettings.DefaultViewSize); tabdet.Map_name = sh.Varname; tabdet.Map_descr = tabdet.Map_name; tabdet.Map_cat = XDFCategories.Undocumented; SymbolAxesTranslator axestrans = new SymbolAxesTranslator(); string x_axis = string.Empty; string y_axis = string.Empty; string x_axis_descr = string.Empty; string y_axis_descr = string.Empty; string z_axis_descr = string.Empty; tabdet.X_axis_name = sh.X_axis_descr; tabdet.Y_axis_name = sh.Y_axis_descr; tabdet.Z_axis_name = sh.Z_axis_descr; tabdet.XaxisUnits = sh.XaxisUnits; tabdet.YaxisUnits = sh.YaxisUnits; tabdet.X_axisAddress = sh.Y_axis_address; tabdet.Y_axisAddress = sh.X_axis_address; tabdet.Xaxiscorrectionfactor = sh.X_axis_correction; tabdet.Yaxiscorrectionfactor = sh.Y_axis_correction; tabdet.Xaxiscorrectionoffset = sh.X_axis_offset; tabdet.Yaxiscorrectionoffset = sh.Y_axis_offset; tabdet.X_axisvalues = GetXaxisValues(Tools.Instance.m_currentfile, Tools.Instance.m_symbols, tabdet.Map_name); tabdet.Y_axisvalues = GetYaxisValues(Tools.Instance.m_currentfile, Tools.Instance.m_symbols, tabdet.Map_name); dockPanel = dockManager1.AddPanel(DevExpress.XtraBars.Docking.DockingStyle.Right); int dw = 650; if (tabdet.X_axisvalues.Length > 0) { dw = 30 + ((tabdet.X_axisvalues.Length + 1) * 45); } if (dw < 400) dw = 400; if (dw > 800) dw = 800; dockPanel.FloatSize = new Size(dw, 900); dockPanel.Tag = Tools.Instance.m_currentfile; dockPanel.ClosedPanel += new DevExpress.XtraBars.Docking.DockPanelEventHandler(dockPanel_ClosedPanel); int columns = 8; int rows = 8; int tablewidth = GetTableMatrixWitdhByName(Tools.Instance.m_currentfile, Tools.Instance.m_symbols, tabdet.Map_name, out columns, out rows); int address = Convert.ToInt32(sh.Flash_start_address); int sramaddress = 0; if (address != 0) { tabdet.Map_address = address; tabdet.Map_sramaddress = sramaddress; int length = Convert.ToInt32(sh.Length); tabdet.Map_length = length; byte[] mapdata = new byte[sh.Length]; mapdata.Initialize(); mapdata = Tools.Instance.readdatafromfile(Tools.Instance.m_currentfile, address, length, Tools.Instance.m_currentFileType); tabdet.Map_content = mapdata; tabdet.Correction_factor = sh.Correction;// GetMapCorrectionFactor(tabdet.Map_name); tabdet.Correction_offset = sh.Offset;// GetMapCorrectionOffset(tabdet.Map_name); tabdet.IsUpsideDown = m_appSettings.ShowTablesUpsideDown; tabdet.ShowTable(columns, true); tabdet.Dock = DockStyle.Fill; tabdet.onSymbolSave += new VAGSuite.MapViewerEx.NotifySaveSymbol(tabdet_onSymbolSave); tabdet.onSymbolRead += new VAGSuite.MapViewerEx.NotifyReadSymbol(tabdet_onSymbolRead); tabdet.onClose += new VAGSuite.MapViewerEx.ViewerClose(tabdet_onClose); tabdet.onAxisEditorRequested += new MapViewerEx.AxisEditorRequested(tabdet_onAxisEditorRequested); tabdet.onSliderMove +=new MapViewerEx.NotifySliderMove(tabdet_onSliderMove); tabdet.onSplitterMoved +=new MapViewerEx.SplitterMoved(tabdet_onSplitterMoved); tabdet.onSelectionChanged +=new MapViewerEx.SelectionChanged(tabdet_onSelectionChanged); tabdet.onSurfaceGraphViewChangedEx += new MapViewerEx.SurfaceGraphViewChangedEx(tabdet_onSurfaceGraphViewChangedEx); tabdet.onAxisLock +=new MapViewerEx.NotifyAxisLock(tabdet_onAxisLock); tabdet.onViewTypeChanged +=new MapViewerEx.ViewTypeChanged(tabdet_onViewTypeChanged); dockPanel.Text = "Symbol: " + tabdet.Map_name + " [" + Path.GetFileName(Tools.Instance.m_currentfile) + "]"; bool isDocked = false; if (!isDocked) { int width = 500; if (tabdet.X_axisvalues.Length > 0) { width = 30 + ((tabdet.X_axisvalues.Length + 1) * 45); } if (width < 500) width = 500; if (width > 800) width = 800; dockPanel.Width = width; } dockPanel.Controls.Add(tabdet); } else { byte[] mapdata = new byte[sh.Length]; mapdata.Initialize(); } tabdet.Visible = true; } catch (Exception newdockE) { Console.WriteLine(newdockE.Message); } Console.WriteLine("End update"); dockManager1.EndUpdate(); } } System.Windows.Forms.Application.DoEvents(); } } }
private void UpdateViewer(MapViewerEx tabdet) { string mapname = tabdet.Map_name; if (tabdet.Filename == Tools.Instance.m_currentfile) { foreach (SymbolHelper sh in Tools.Instance.m_symbols) { if (sh.Varname == mapname) { // refresh data and axis in the viewer SymbolAxesTranslator axestrans = new SymbolAxesTranslator(); string x_axis = string.Empty; string y_axis = string.Empty; string x_axis_descr = string.Empty; string y_axis_descr = string.Empty; string z_axis_descr = string.Empty; tabdet.X_axis_name = sh.X_axis_descr; tabdet.Y_axis_name = sh.Y_axis_descr; tabdet.Z_axis_name = sh.Z_axis_descr; tabdet.X_axisAddress = sh.Y_axis_address; tabdet.Y_axisAddress = sh.X_axis_address; tabdet.Xaxiscorrectionfactor = sh.X_axis_correction; tabdet.Yaxiscorrectionfactor = sh.Y_axis_correction; tabdet.Xaxiscorrectionoffset = sh.X_axis_offset; tabdet.Yaxiscorrectionoffset = sh.Y_axis_offset; tabdet.X_axisvalues = GetXaxisValues(Tools.Instance.m_currentfile, Tools.Instance.m_symbols, tabdet.Map_name); tabdet.Y_axisvalues = GetYaxisValues(Tools.Instance.m_currentfile, Tools.Instance.m_symbols, tabdet.Map_name); int columns = 8; int rows = 8; int tablewidth = GetTableMatrixWitdhByName(Tools.Instance.m_currentfile, Tools.Instance.m_symbols, tabdet.Map_name, out columns, out rows); int address = Convert.ToInt32(sh.Flash_start_address); tabdet.ShowTable(columns, true); break; } } } }
private void StartCompareMapViewer(string SymbolName, string Filename, int SymbolAddress, int SymbolLength, SymbolCollection curSymbols, int symbolnumber) { try { SymbolHelper sh = FindSymbol(curSymbols, SymbolName); DevExpress.XtraBars.Docking.DockPanel dockPanel; bool pnlfound = false; foreach (DevExpress.XtraBars.Docking.DockPanel pnl in dockManager1.Panels) { if (pnl.Text == "Symbol: " + SymbolName + " [" + Path.GetFileName(Filename) + "]") { if (pnl.Tag.ToString() == Filename) // <GS-10052011> { dockPanel = pnl; pnlfound = true; dockPanel.Show(); } } } if (!pnlfound) { dockManager1.BeginUpdate(); try { dockPanel = dockManager1.AddPanel(new System.Drawing.Point(-500, -500)); dockPanel.Tag = Filename;// Tools.Instance.m_currentfile; changed 24/01/2008 MapViewerEx tabdet = new MapViewerEx(); tabdet.AutoUpdateIfSRAM = false;// m_appSettings.AutoUpdateSRAMViewers; tabdet.AutoUpdateInterval = 99999; tabdet.SetViewSize(ViewSize.NormalView); //tabdet.IsHexMode = barViewInHex.Checked; tabdet.Viewtype = m_appSettings.DefaultViewType; tabdet.DisableColors = m_appSettings.DisableMapviewerColors; tabdet.AutoSizeColumns = m_appSettings.AutoSizeColumnsInWindows; tabdet.GraphVisible = m_appSettings.ShowGraphs; tabdet.IsRedWhite = m_appSettings.ShowRedWhite; tabdet.SetViewSize(m_appSettings.DefaultViewSize); tabdet.Filename = Filename; tabdet.Map_name = SymbolName; tabdet.Map_descr = tabdet.Map_name; tabdet.Map_cat = XDFCategories.Undocumented; tabdet.X_axisvalues = GetXaxisValues(Filename, curSymbols, tabdet.Map_name); tabdet.Y_axisvalues = GetYaxisValues(Filename, curSymbols, tabdet.Map_name); SymbolAxesTranslator axestrans = new SymbolAxesTranslator(); string x_axis = string.Empty; string y_axis = string.Empty; string x_axis_descr = string.Empty; string y_axis_descr = string.Empty; string z_axis_descr = string.Empty; tabdet.X_axis_name = sh.X_axis_descr; tabdet.Y_axis_name = sh.Y_axis_descr; tabdet.Z_axis_name = sh.Z_axis_descr; tabdet.XaxisUnits = sh.XaxisUnits; tabdet.YaxisUnits = sh.YaxisUnits; tabdet.X_axisAddress = sh.Y_axis_address; tabdet.Y_axisAddress = sh.X_axis_address; tabdet.Xaxiscorrectionfactor = sh.X_axis_correction; tabdet.Yaxiscorrectionfactor = sh.Y_axis_correction; //tabdet.X_axisvalues = GetXaxisValues(Tools.Instance.m_currentfile, curSymbols, tabdet.Map_name); //tabdet.Y_axisvalues = GetYaxisValues(Tools.Instance.m_currentfile, curSymbols, tabdet.Map_name); int columns = 8; int rows = 8; int tablewidth = GetTableMatrixWitdhByName(Filename, curSymbols, tabdet.Map_name, out columns, out rows); int address = Convert.ToInt32(SymbolAddress); if (address != 0) { tabdet.Map_address = address; int length = SymbolLength; tabdet.Map_length = length; byte[] mapdata = Tools.Instance.readdatafromfile(Filename, address, length, Tools.Instance.m_currentFileType); tabdet.Map_content = mapdata; tabdet.Correction_factor = sh.Correction; tabdet.Correction_offset = sh.Offset;// GetMapCorrectionOffset(tabdet.Map_name); tabdet.IsUpsideDown = m_appSettings.ShowTablesUpsideDown; tabdet.ShowTable(columns, true); tabdet.Dock = DockStyle.Fill; tabdet.onSymbolSave += new VAGSuite.MapViewerEx.NotifySaveSymbol(tabdet_onSymbolSave); tabdet.onSymbolRead += new VAGSuite.MapViewerEx.NotifyReadSymbol(tabdet_onSymbolRead); tabdet.onClose += new VAGSuite.MapViewerEx.ViewerClose(tabdet_onClose); tabdet.onSliderMove += new MapViewerEx.NotifySliderMove(tabdet_onSliderMove); tabdet.onSplitterMoved += new MapViewerEx.SplitterMoved(tabdet_onSplitterMoved); tabdet.onSelectionChanged += new MapViewerEx.SelectionChanged(tabdet_onSelectionChanged); tabdet.onSurfaceGraphViewChangedEx += new MapViewerEx.SurfaceGraphViewChangedEx(tabdet_onSurfaceGraphViewChangedEx); tabdet.onAxisLock += new MapViewerEx.NotifyAxisLock(tabdet_onAxisLock); tabdet.onViewTypeChanged += new MapViewerEx.ViewTypeChanged(tabdet_onViewTypeChanged); //dockPanel.DockAsTab(dockPanel1); dockPanel.Text = "Symbol: " + SymbolName + " [" + Path.GetFileName(Filename) + "]"; dockPanel.DockTo(dockManager1, DevExpress.XtraBars.Docking.DockingStyle.Right, 1); bool isDocked = false; // Try to dock to same symbol foreach (DevExpress.XtraBars.Docking.DockPanel pnl in dockManager1.Panels) { if (pnl.Text.StartsWith("Symbol: " + SymbolName) && pnl != dockPanel && (pnl.Visibility == DevExpress.XtraBars.Docking.DockVisibility.Visible)) { dockPanel.DockAsTab(pnl, 0); isDocked = true; break; } } if (!isDocked) { int width = 500; if (tabdet.X_axisvalues.Length > 0) { width = 30 + ((tabdet.X_axisvalues.Length + 1) * 45); } if (width < 500) width = 500; if (width > 800) width = 800; dockPanel.Width = width; } dockPanel.Controls.Add(tabdet); } } catch (Exception E) { Console.WriteLine(E.Message); } dockManager1.EndUpdate(); System.Windows.Forms.Application.DoEvents(); } } catch (Exception startnewcompareE) { Console.WriteLine(startnewcompareE.Message); } }
private void StartCompareDifferenceViewer(SymbolHelper sh, string Filename, int SymbolAddress) { DevExpress.XtraBars.Docking.DockPanel dockPanel; bool pnlfound = false; foreach (DevExpress.XtraBars.Docking.DockPanel pnl in dockManager1.Panels) { if (pnl.Text == "Symbol difference: " + sh.Varname + " [" + Path.GetFileName(Tools.Instance.m_currentfile) + "]") { dockPanel = pnl; pnlfound = true; dockPanel.Show(); } } if (!pnlfound) { dockManager1.BeginUpdate(); try { dockPanel = dockManager1.AddPanel(new System.Drawing.Point(-500, -500)); dockPanel.Tag = Tools.Instance.m_currentfile; MapViewerEx tabdet = new MapViewerEx(); tabdet.Map_name = sh.Varname; tabdet.IsDifferenceViewer = true; tabdet.AutoUpdateIfSRAM = false; tabdet.AutoUpdateInterval = 999999; tabdet.Viewtype = m_appSettings.DefaultViewType; tabdet.DisableColors = m_appSettings.DisableMapviewerColors; tabdet.AutoSizeColumns = m_appSettings.AutoSizeColumnsInWindows; tabdet.GraphVisible = m_appSettings.ShowGraphs; tabdet.IsRedWhite = m_appSettings.ShowRedWhite; tabdet.SetViewSize(m_appSettings.DefaultViewSize); tabdet.Filename = Filename; tabdet.Map_descr = tabdet.Map_name; tabdet.Map_cat = XDFCategories.Undocumented; tabdet.X_axisvalues = GetXaxisValues(Tools.Instance.m_currentfile, Tools.Instance.m_symbols, tabdet.Map_name); tabdet.Y_axisvalues = GetYaxisValues(Tools.Instance.m_currentfile, Tools.Instance.m_symbols, tabdet.Map_name); SymbolAxesTranslator axestrans = new SymbolAxesTranslator(); string x_axis = string.Empty; string y_axis = string.Empty; string x_axis_descr = string.Empty; string y_axis_descr = string.Empty; string z_axis_descr = string.Empty; tabdet.X_axis_name = sh.X_axis_descr; tabdet.Y_axis_name = sh.Y_axis_descr; tabdet.Z_axis_name = sh.Z_axis_descr; tabdet.XaxisUnits = sh.XaxisUnits; tabdet.YaxisUnits = sh.YaxisUnits; tabdet.X_axisAddress = sh.Y_axis_address; tabdet.Y_axisAddress = sh.X_axis_address; tabdet.Xaxiscorrectionfactor = sh.X_axis_correction; tabdet.Yaxiscorrectionfactor = sh.Y_axis_correction; tabdet.X_axisvalues = GetXaxisValues(Tools.Instance.m_currentfile, Tools.Instance.m_symbols, tabdet.Map_name); tabdet.Y_axisvalues = GetYaxisValues(Tools.Instance.m_currentfile, Tools.Instance.m_symbols, tabdet.Map_name); //tabdet.Map_sramaddress = GetSymbolAddressSRAM(SymbolName); int columns = 8; int rows = 8; int tablewidth = GetTableMatrixWitdhByName(Tools.Instance.m_currentfile, Tools.Instance.m_symbols, tabdet.Map_name, out columns, out rows); int address = Convert.ToInt32(SymbolAddress); if (address != 0) { tabdet.Map_address = address; int length = sh.Length; tabdet.Map_length = length; byte[] mapdata = Tools.Instance.readdatafromfile(Filename, address, length, Tools.Instance.m_currentFileType); byte[] mapdataorig = Tools.Instance.readdatafromfile(Filename, address, length, Tools.Instance.m_currentFileType); byte[] mapdata2 = Tools.Instance.readdatafromfile(Tools.Instance.m_currentfile, (int)GetSymbolAddress(Tools.Instance.m_symbols, sh.Varname), GetSymbolLength(Tools.Instance.m_symbols, sh.Varname), Tools.Instance.m_currentFileType); tabdet.Map_original_content = mapdataorig; tabdet.Map_compare_content = mapdata2; if (mapdata.Length == mapdata2.Length) { for (int bt = 0; bt < mapdata2.Length; bt += 2) { int value1 = Convert.ToInt16(mapdata.GetValue(bt)) * 256 + Convert.ToInt16(mapdata.GetValue(bt + 1)); int value2 = Convert.ToInt16(mapdata2.GetValue(bt)) * 256 + Convert.ToInt16(mapdata2.GetValue(bt + 1)); value1 = Math.Abs((int)value1 - (int)value2); byte v1 = (byte)(value1 / 256); byte v2 = (byte)(value1 - (int)v1 * 256); mapdata.SetValue(v1, bt); mapdata.SetValue(v2, bt + 1); } tabdet.Map_content = mapdata; tabdet.UseNewCompare = true; tabdet.Correction_factor = sh.Correction; tabdet.Correction_offset = sh.Offset; tabdet.IsUpsideDown = m_appSettings.ShowTablesUpsideDown; tabdet.ShowTable(columns, true); tabdet.Dock = DockStyle.Fill; tabdet.onClose += new MapViewerEx.ViewerClose(tabdet_onClose); dockPanel.Text = "Symbol difference: " + sh.Varname + " [" + Path.GetFileName(Filename) + "]"; bool isDocked = false; if (!isDocked) { dockPanel.DockTo(dockManager1, DevExpress.XtraBars.Docking.DockingStyle.Right, 0); if (m_appSettings.AutoSizeNewWindows) { if (tabdet.X_axisvalues.Length > 0) { dockPanel.Width = 30 + ((tabdet.X_axisvalues.Length + 1) * 45); } else { //dockPanel.Width = this.Width - dockSymbols.Width - 10; } } if (dockPanel.Width < 400) dockPanel.Width = 400; // dockPanel.Width = 400; } dockPanel.Controls.Add(tabdet); } else { frmInfoBox info = new frmInfoBox("Map lengths don't match..."); } } } catch (Exception E) { Console.WriteLine(E.Message); } dockManager1.EndUpdate(); } }
public override void NameKnownMaps(byte[] allBytes, SymbolCollection newSymbols, List <CodeBlock> newCodeBlocks) { SymbolAxesTranslator st = new SymbolAxesTranslator(); foreach (SymbolHelper sh in newSymbols) { if (Tools.Instance.m_carMake == CarMakes.BMW) { //Console.WriteLine("Flash startadress: " + sh.Flash_start_address); // Look in X-axis for RPM int maxX = 0; int minX = 0; int maxY = 0; int minY = 0; if (sh.Is1D) { maxX = (sh.Currentdata[2 + sh.X_axis_length * 2 - 2]) * 256 + (sh.Currentdata[2 + sh.X_axis_length * 2 - 1]); minX = maxX;/* (sh.Currentdata[2]) * 256 + (sh.Currentdata[3]); */ } else { maxX = (sh.Currentdata[4 + sh.X_axis_length * 2 - 2]) * 256 + (sh.Currentdata[4 + sh.X_axis_length * 2 - 1]); minX = (sh.Currentdata[4]) * 256 + (sh.Currentdata[5]); } //Console.WriteLine("" + sh.Flash_start_address + sh.Y_axis_offset); // Check max value in Y for 9200 -> RPM if (sh.Is1D) { maxY = (sh.Currentdata[2 + sh.X_axis_length * 2 + sh.Y_axis_length * 2 - 2]) * 256 + (sh.Currentdata[2 + sh.X_axis_length * 2 + sh.Y_axis_length * 2 - 1]); minY = (sh.Currentdata[2 + sh.X_axis_length * 2]) * 256 + (sh.Currentdata[2 + sh.X_axis_length * 2 + 1]); } else { maxY = (sh.Currentdata[4 + sh.X_axis_length * 2 + sh.Y_axis_length * 2 - 2]) * 256 + (sh.Currentdata[4 + sh.X_axis_length * 2 + sh.Y_axis_length * 2 - 1]); minY = (sh.Currentdata[4 + sh.X_axis_length * 2]) * 256 + (sh.Currentdata[4 + sh.X_axis_length * 2 + 1]); } //Console.WriteLine("MinX=" + minX + ", maxX=" + maxX); //Console.WriteLine("MinY=" + minY + ", maxY=" + maxY); /* * if((maxX == 10000 && minX == 1400) || // 750->5000rpm * (maxX == 10000 && minX == 1000) || // 500->5000rpm * (maxX == 9200)) { // ->4600rpm * //sh.Category = "Partly detected maps"; * //sh.Subcategory = "RPM"; * sh.Y_axis_correction = 0.5; * sh.YaxisUnits = "rpm"; * sh.Y_axis_descr = "rpm"; * } */ // Temp-related X-axis if ((minX >= 1731 && maxX <= 3931) && ((minX - 31) % 50 == 0 || (maxX - 31) % 50 == 0 )) { sh.X_axis_correction = 0.1; sh.X_axis_offset = -273.1; //sh.Correction = 0.1; sh.Category = "Partly detected maps - temp"; sh.X_axis_descr = "Temperature"; sh.XaxisUnits = "C"; } if ((sh.X_axis_length == 16 || sh.X_axis_length == 17) && sh.Y_axis_length == 40) { //Injection time sh.Category = "Detected maps"; sh.Subcategory = "Injection timing"; sh.Varname = "Injection time [" + sh.Flash_start_address.ToString("X8") + "]"; sh.X_axis_correction = 0.01; sh.XaxisUnits = "mm3/inj"; sh.X_axis_descr = "mm3/inj"; sh.Z_axis_descr = "time"; sh.Correction = 0.4; sh.Y_axis_correction = 0.1; sh.YaxisUnits = "bar"; sh.Y_axis_descr = "bar"; } if (sh.X_axis_length == 16 && sh.Y_axis_length == 16 && (maxY == 7000 || maxY == 7500) && minY == 0) { // Todo! Check steps in X and/or Y to further isolate maps! // Injection timing sh.Category = "Detected maps"; sh.Subcategory = "Injection timing"; sh.Varname = "Injection timing map [" + sh.Flash_start_address.ToString("X8") + "]"; sh.X_axis_correction = 0.01; sh.XaxisUnits = "mm3/cyc"; sh.X_axis_descr = "mm3/cyc"; sh.Z_axis_descr = "Injection timing"; sh.Correction = 0.021969; } if ((sh.X_axis_length == 14 && sh.Y_axis_length == 8)) { //|| // 14x8 //(sh.X_axis_length == 8 && sh.Y_axis_length == 1 ) ) { // 8x1(0) torquelimiter sh.Category = "Detected maps"; sh.Subcategory = "Torque"; sh.Varname = "Pedal request map [" + sh.Flash_start_address.ToString("X8") + "]"; sh.X_axis_correction = 0.01220703125; sh.X_axis_descr = "Percent"; sh.Y_axis_correction = 0.5; sh.Y_axis_descr = "RPM"; sh.Z_axis_descr = "Torque (Nm)"; sh.XaxisUnits = "%"; sh.Correction = 0.1; } if (sh.X_axis_length == 8 && sh.Y_axis_length == 10 && (maxY % 2 == 1 || minY % 2 == 1)) { // 8x10 and odd data sh.Category = "Detected maps"; sh.Subcategory = "Torque"; sh.Varname = "Torque limit given temp [" + sh.Flash_start_address.ToString("X8") + "]"; sh.Y_axis_correction = 0.5; sh.Y_axis_descr = "RPM"; sh.X_axis_correction = 0.1; sh.X_axis_offset = -273.1; sh.Correction = 0.1; sh.X_axis_descr = "Temperature"; sh.Z_axis_descr = "Torque (Nm)"; sh.XaxisUnits = "C"; } if (sh.X_axis_length == 21 && sh.Y_axis_length == 3) { // 21x3, only one exist in BMW-files sh.Category = "Detected maps"; sh.Subcategory = "Torque"; sh.Varname = "Torque limit for speed [" + sh.Flash_start_address.ToString("X8") + "]"; sh.Y_axis_correction = 0.5; sh.Y_axis_descr = "RPM"; sh.X_axis_correction = 1; sh.Correction = 0.1; sh.X_axis_descr = "#"; sh.Z_axis_descr = "Torque (Nm)"; sh.XaxisUnits = "#"; } /* // These addresses are only valid for one specific boschnumber.... Needs to be more general * if(sh.Flash_start_address == 0x75200 || * sh.Flash_start_address == 0x75444 || * sh.Flash_start_address == 0x75688) { * sh.Varname = "Fuel quantity injected [" + sh.Flash_start_address.ToString("X8") + "]"; * sh.Category = "Detected maps"; * sh.Subcategory = "Injected Fuel"; * sh.Y_axis_correction = 0.5; * sh.YaxisUnits = "RPM"; * sh.Y_axis_descr = "rpm"; * sh.X_axis_correction = 0.1; * sh.XaxisUnits = "Nm"; * sh.X_axis_descr = "Nm"; * sh.Z_axis_descr = "Fuel injected quantity f(RPM,Trq)"; * sh.Correction = 0.01; * } * * if(sh.Flash_start_address == 0x52036) { * sh.Varname = "Gas quantity recirculation [" + sh.Flash_start_address.ToString("X8") + "]"; * sh.Category = "Detected maps"; * sh.Subcategory = "Air control"; * * sh.Y_axis_correction = 0.5; * sh.YaxisUnits = "RPM"; * sh.Y_axis_descr = "rpm"; * * sh.X_axis_correction = 0.01; * sh.XaxisUnits = "mm3/hub"; * sh.X_axis_descr = "mm3"; * sh.Z_axis_descr = "Gas quantity"; * * sh.Correction = 0.1; * } * if(sh.Flash_start_address == 0x6EFE4) { * sh.Varname = "Limiter of turbo f(APS)[" + sh.Flash_start_address.ToString("X8") + "]"; * sh.Category = "Detected maps"; * sh.Subcategory = "Turbo"; * * sh.Y_axis_correction = 0.5; * sh.YaxisUnits = "RPM"; * sh.Y_axis_descr = "rpm"; * * sh.X_axis_correction = 1; * sh.XaxisUnits = "hPa"; * sh.X_axis_descr = "hPa"; * sh.Z_axis_descr = "Pressure"; * * sh.Correction = 1; * } */ } } }
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.Y_axis_correction = 0.000039; sh.Correction = 0.01; sh.X_axis_descr = "Engine speed (rpm)"; //sh.Y_axis_descr = "Ratio vehicle/engine speed"; sh.Y_axis_descr = "Approx. vehicle speed (km/h)"; //sh.Z_axis_descr = "Output percentage"; sh.Z_axis_descr = "IQ limit"; sh.YaxisUnits = "km/h"; sh.XaxisUnits = "rpm"; } if (sh.Length == 570) { 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--; //if (injDurCount < 1) 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.X_axis_ID / 256 == 0xC4 && sh.Y_axis_ID / 256 == 0xEA) { 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.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 == 0xC4 && sh.Y_axis_ID / 256 == 0xEC) { 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.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--; //if (injDurCount < 1) injDurCount = 1; //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 = "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 == 0xC4 && sh.Y_axis_ID / 256 == 0xEA) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int injDurCount = GetMapNameCountForCodeBlock("Injector duration", sh.CodeBlock, newSymbols, false); injDurCount--; //if (injDurCount < 1) injDurCount = 1; //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 = "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); //based on coolant temperature 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 == 0xC5 && sh.Y_axis_ID / 256 == 0xEC) { 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 == 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"; int smokeCount = GetMapNameCountForCodeBlock("Smoke limiter", sh.CodeBlock, newSymbols, false); //sh.Varname = "Smoke limiter " + smokeCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Varname = "Smoke limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; if (sh.MapSelector != null) { if (sh.MapSelector.MapIndexes != null) { if (sh.MapSelector.MapIndexes.Length > 1) { if (!MapSelectorIndexEmpty(sh)) { double tempRange = GetTemperatureSOIRange(sh.MapSelector, smokeCount - 1); sh.Varname = "Smoke limiter " + 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.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 == 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.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 == 0xEC && sh.Y_axis_ID == 0xE9D4) { // x axis should start with 0! 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 == 0xEC) && (sh.Y_axis_ID / 256 == 0xC0 || sh.Y_axis_ID / 256 == 0xE9)) { // 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.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) { /* 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--; //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.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 == 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 == 0xEA) && (sh.Y_axis_ID / 256 == 0xDA)) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int smokeCount = GetMapNameCountForCodeBlock("Smoke limiter", sh.CodeBlock, newSymbols, false); //sh.Varname = "Smoke limiter " + smokeCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Varname = "Smoke limiter [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; if (sh.MapSelector != null) { if (sh.MapSelector.MapIndexes != null) { if (sh.MapSelector.MapIndexes.Length > 1) { if (!MapSelectorIndexEmpty(sh)) { double tempRange = GetTemperatureSOIRange(sh.MapSelector, smokeCount - 1); sh.Varname = "Smoke limiter " + 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.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) { 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 == 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 == 0xEC && 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"; } 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 == 0xEC && sh.Y_axis_ID / 256 == 0xDA) { 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 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 = "Temperature"; //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 = "°C"; } else if (sh.Length == 286) { if (sh.X_axis_length == 0x0d && sh.Y_axis_length == 0x0b) { 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 == 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 == 260) // EXPERIMENTAL { 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--; //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 == 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 == 220) // EXPERIMENTAL { 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--; //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 == 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 == 0xC0 && sh.Y_axis_ID / 256 == 0xEC) { 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 == 0xC5 && sh.Y_axis_ID / 256 == 0xEC) { //if (!MapContainsNegativeValues(allBytes, sh)) if (GetMaxAxisValue(allBytes, sh, MapViewerEx.AxisIdent.X_Axis) > 3500) // was 5000 { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; // was Limiters // was limiter 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.Correction = 0.023438; sh.Y_axis_correction = 0.01; sh.Y_axis_descr = "IQ (mg/stroke)"; //sh.Z_axis_descr = "Max. degrees"; sh.Z_axis_descr = "Duration (crankshaft degrees)"; sh.X_axis_descr = "Engine speed (rpm)"; sh.XaxisUnits = "rpm"; sh.YaxisUnits = "mg/st"; } else { 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.X_axis_ID / 256 == 0xC4 && sh.Y_axis_ID / 256 == 0xEA) { 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.X_axis_ID / 256 == 0xC4 && sh.Y_axis_ID / 256 == 0xEC) { 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 == 198) // EXPERIMENTAL { 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--; //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 == 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 == 0xC5 && sh.Y_axis_ID / 256 == 0xEC) { 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.X_axis_ID / 256 == 0xC4 && sh.Y_axis_ID / 256 == 0xEA) { 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.X_axis_length == 10 && sh.Y_axis_length == 9) { 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--; //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 == 160) { if (sh.X_axis_length == 8 && sh.Y_axis_length == 10) { 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--; 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 == 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 volume correction map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Userdescription = "zmwMKOR_KF"; sh.Z_axis_descr = "IQ correction per 100K"; sh.Correction = 0.002441; sh.Y_axis_descr = "Engine speed (rpm)"; sh.X_axis_correction = 0.01; sh.X_axis_descr = "IQ (mg/stroke)"; } } 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"; } } if (sh.X_axis_length == 3 && sh.Y_axis_length == 24) { // Tq Lim 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 == 128) { if (sh.X_axis_ID / 256 == 0xEC && sh.Y_axis_ID / 256 == 0xC1) { // check for valid axis data on temp data if (IsValidTemperatureAxis(allBytes, sh, MapViewerEx.AxisIdent.Y_Axis)) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int maflimTempCount = GetMapNameCountForCodeBlock("MAF correction by temperature", sh.CodeBlock, newSymbols, false); maflimTempCount--; sh.Varname = "MAF correction by temperature " + maflimTempCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Z_axis_descr = "Limit"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.X_axis_descr = "Intake air temperature"; //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 = "°C"; } } else if (sh.X_axis_ID / 256 == 0xEA && sh.Y_axis_ID / 256 == 0xC1) { // check for valid axis data on temp data if (IsValidTemperatureAxis(allBytes, sh, MapViewerEx.AxisIdent.Y_Axis)) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int maflimTempCount = GetMapNameCountForCodeBlock("MAF correction by temperature", sh.CodeBlock, newSymbols, false); maflimTempCount--; sh.Varname = "MAF correction by temperature " + maflimTempCount.ToString("D2") + " [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Z_axis_descr = "Limit"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.X_axis_descr = "Intake air temperature"; //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 = "°C"; } } else if (sh.X_axis_ID / 256 == 0xEC && sh.Y_axis_ID / 256 == 0xC0) // EXPERIMENTAL { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; sh.Varname = "Expected fuel temperature [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Userdescription = "zmwMKBT_KF"; sh.Correction = 0.1; sh.Offset = -273.1; sh.Y_axis_descr = "Engine speed (rpm)"; sh.YaxisUnits = "rpm"; sh.X_axis_correction = 0.01; sh.XaxisUnits = "mg/st"; sh.X_axis_descr = "IQ (mg/stroke)"; sh.Z_axis_descr = "Fuel temperature °C"; } } else if (sh.Length == 150) // 3L (1.2 TDi, three cylinder VW Lupo) has this { if (sh.X_axis_length == 3 && sh.Y_axis_length == 25) { 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 == 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 == 60) { if (sh.Y_axis_length == 6 && sh.X_axis_length == 5) { if (sh.Y_axis_ID == 0xC1A2) { sh.Category = "Detected maps"; sh.Subcategory = "Misc"; sh.Varname = "EGR temperature map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.X_axis_descr = "Temperature"; //IAT, ECT or Fuel temp? sh.X_axis_correction = 0.1; sh.X_axis_offset = -273.1; sh.Z_axis_descr = "Mass airflow correction"; } } } else if (sh.Length >= 18 && sh.Length <= 70) { if (sh.X_axis_ID / 16 == 0xC1A && sh.Y_axis_ID / 16 == 0xEC3) { { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; //Temp after intercooler sh.Y_axis_descr = "Temperature"; sh.X_axis_descr = "Engine speed (rpm)"; //IAT, ECT or Fuel temp? sh.Y_axis_correction = 0.1; sh.Y_axis_offset = -273.1; sh.Z_axis_descr = "%"; sh.Correction = 0.01; sh.Varname = "IQ by air intake temp[" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; } } } else if (sh.Length == 20) { if (sh.Y_axis_length == 5 && sh.X_axis_length == 2) { //if (sh.Y_axis_ID == 0xC1A2) { sh.Category = "Detected maps"; sh.Subcategory = "Misc"; //sh.Y_axis_descr = "Engine speed (rpm)"; sh.Y_axis_descr = "Air pressure"; sh.X_axis_descr = "Temperature"; //IAT, ECT or Fuel temp? sh.X_axis_correction = 0.1; sh.X_axis_offset = -273.1; sh.Z_axis_descr = "Time (sec)"; sh.Correction = 0.01; sh.Varname = "Pre-glow map [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; } } } else if (sh.Length == 12) { if (sh.X_axis_length == 6 && sh.Y_axis_length == 1) { if ((sh.X_axis_ID & 0xFFF0) == 0xECB0) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; sh.Varname = "Selector for injector duration [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; // soi values as axis!! sh.Y_axis_correction = -0.023437; sh.Y_axis_offset = 78; sh.Correction = 0.00390625; sh.Z_axis_descr = "Map index"; sh.YaxisUnits = "SOI"; } } } else if (sh.Length == 8) { /*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"; } }*/ } else if (sh.Length == 4) { if (sh.X_axis_length == 2 && sh.Y_axis_length == 1) { if (sh.X_axis_ID == 0xEBA2 || sh.X_axis_ID == 0xEBA4 || sh.X_axis_ID == 0xE9BC) { 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"; } } } } if (sh.X_axis_ID == 0xDA6C && sh.Y_axis_ID == 0xDA6A) { sh.Category = "Detected maps"; sh.X_axis_correction = 0.1; sh.X_axis_offset = -273.1; sh.XaxisUnits = "°C"; sh.Subcategory = "Limiters"; sh.Varname = "Boost correction by temperature [" + 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 = "IAT (celcius)"; sh.Y_axis_descr = "Requested boost"; sh.Z_axis_descr = "Boost limit (mbar)"; sh.YaxisUnits = "mbar"; } } }
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 == 450) { if (sh.X_axis_length == 15 && sh.Y_axis_length == 15) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xFC) { sh.Category = "Detected maps"; sh.Subcategory = "Fuel"; int injDurCount = GetMapNameCountForCodeBlock("Start of injection (SOI)", sh.CodeBlock, newSymbols, false); double tempRange = 0; // 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.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.Correction = 0.023437; sh.Z_axis_descr = "Start position (degrees BTDC)"; } } } //12x13 E0 DD = EGR if (sh.Length == 312) { if (sh.X_axis_length == 13 && sh.Y_axis_length == 12) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xDD) { 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 == 208) { if (sh.X_axis_length == 13 && sh.Y_axis_length == 8) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC1) { 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 == 182) // 7*13 { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC1) { 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 == 176) { if (sh.X_axis_length == 11 && sh.Y_axis_length == 8) { if (sh.X_axis_ID / 256 == 0xE0 && sh.Y_axis_ID / 256 == 0xC2) { int smCount = GetMapNameCountForCodeBlock("Smoke limiter", sh.CodeBlock, newSymbols, false); 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.Length == 40) { if (sh.X_axis_length == 20 && sh.Y_axis_length == 1) { if (sh.X_axis_ID / 256 == 0xE0) { sh.Category = "Detected maps"; sh.Subcategory = "Limiters"; int lmCount = GetMapNameCountForCodeBlock("Torque limiter", sh.CodeBlock, newSymbols, false); sh.Varname = "Torque limiter (" + lmCount.ToString() + ") [" + DetermineNumberByFlashBank(sh.Flash_start_address, newCodeBlocks) + "]"; sh.Z_axis_descr = "Maximum IQ (mg)"; //sh.Y_axis_descr = "Atm. pressure (mbar)"; sh.Y_axis_descr = "Engine speed (rpm)"; sh.Correction = 0.01; sh.YaxisUnits = "rpm"; } } } } }