VAGSuite.EDC17FileParser.parseFile C# (CSharp) Method

parseFile() public method

public parseFile ( string filename, List &newCodeBlocks, List &newAxisHelpers ) : SymbolCollection
filename string
newCodeBlocks List
newAxisHelpers List
return SymbolCollection
        public override SymbolCollection parseFile(string filename, out List<CodeBlock> newCodeBlocks, out List<AxisHelper> newAxisHelpers)
        {
            newCodeBlocks = new List<CodeBlock>();
            SymbolCollection newSymbols = new SymbolCollection();
            newAxisHelpers = new List<AxisHelper>();
            // Bosch EDC17 style mapdetection LL LL AXIS AXIS MAPDATA
            byte[] allBytes = File.ReadAllBytes(filename);
            // EDC17 = ReverseEndian
            allBytes = Tools.Instance.reverseEndian(allBytes);
            for (int i = 0; i < allBytes.Length - 32; i += 2)
            {
                int len2Skip = CheckMap(i, allBytes, newSymbols, newCodeBlocks);
                if ((len2Skip % 2) > 0)
                {
                    if (len2Skip > 2) len2Skip--;
                    else len2Skip++;
                }
                //i += len2Skip;
                //i += len2Skip - 2;
                // For now we don't skip since we can have false alarm and thereby jumping over the start of the "real" map.
            }
            newSymbols.SortColumn = "Flash_start_address";
            newSymbols.SortingOrder = GenericComparer.SortOrder.Ascending;
            newSymbols.Sort();
            NameKnownMaps(allBytes, newSymbols, newCodeBlocks);
            FindSVBL(allBytes, filename, newSymbols, newCodeBlocks);
            SymbolTranslator strans = new SymbolTranslator();
            foreach (SymbolHelper sh in newSymbols)
            {
                sh.Description = strans.TranslateSymbolToHelpText(sh.Varname);
            }
            return newSymbols;
        }