private ReturnCode ParseHeader(BinaryReader readBinary) { fileTypeCheck = new string(readBinary.ReadChars(4)); char modeChar = readBinary.ReadChar(); switch (modeChar) { case 'B': NCCMode = NCCWriter.NCCType.BACKGROUND; break; case 'N': NCCMode = NCCWriter.NCCType.NORMALIZATION; break; case 'V': NCCMode = NCCWriter.NCCType.VERIFICATION; break; default: return(ReturnCode.CORRUPTED_FILE); } detectorID = new string(readBinary.ReadChars(11)); itemID = new string(readBinary.ReadChars(12)); string dateTimeString = new string(readBinary.ReadChars(16)); startDateTime = new DateTime(2000 + int.Parse(dateTimeString.Substring(0, 2)), int.Parse(dateTimeString.Substring(3, 2)), int.Parse(dateTimeString.Substring(6, 2)), int.Parse(dateTimeString.Substring(8, 2)), int.Parse(dateTimeString.Substring(11, 2)), int.Parse(dateTimeString.Substring(14, 2))); // Stop short of cycles return(ReturnCode.SUCCESS); }
public NCCParser() { NCCMode = NCCWriter.NCCType.VERIFICATION; detectorID = "XXXXXXXXXXX"; itemID = "ItemID "; Cycles = new List <NCCWriter.Cycle>(); }