/*********************************************************************/ /// <summary> /// /// </summary> /// <param name="rowNum"></param> public void InsertRow(int rowNum) { S19Line line = new S19Line(); SRecordLines.Insert(rowNum, line); UpdateLineNumbering(); }
/*********************************************************************/ /// <summary> /// /// </summary> public void ParseFile() { try { SRecordLines = new List <S19Line>(); bool flag24BitAddrUsed = false, flag32BitAddrUsed = false; /* the default is 16-bit */ string line; StreamReader reader = new StreamReader(_FileName); while ((line = reader.ReadLine()) != null) { /* create the new line */ S19Line newLine = new S19Line(line); /* count the occurance of each instruction for analysis */ switch (newLine.Instruction) { case S19Line.S19Instruction.S2: case S19Line.S19Instruction.S8: flag24BitAddrUsed = true; break; case S19Line.S19Instruction.S3: case S19Line.S19Instruction.S7: flag32BitAddrUsed = true; break; } /* add the new line to the S-Record object */ SRecordLines.Add(newLine); } reader.Close(); UpdateLineNumbering(); /* Set the address length to use */ if (flag32BitAddrUsed) { _MaxAddressLength = LEN_32_BIT_ADDR; } else if (flag24BitAddrUsed) { _MaxAddressLength = LEN_24_BIT_ADDR; } else { _MaxAddressLength = LEN_16_BIT_ADDR; } } catch { ExceptionTrap.Trap("Error Parsing S19 File!!"); } }