static void Main(string[] args) { bool findFirst = true; if (args.Length < 2) { Console.WriteLine(String.Format("Usage: {0} [Object State File 1] [Object State File 2] [Time to compare -- optional]",Environment.CommandLine)); return; } string dddObjectLogPath1 = args[0]; string dddObjectLogPath2 = args[1]; if (!File.Exists(dddObjectLogPath1)) { Console.WriteLine(String.Format("{0} doesn't exist!",dddObjectLogPath1)); return; } if (!File.Exists(dddObjectLogPath2)) { Console.WriteLine(String.Format("{0} doesn't exist!",dddObjectLogPath2)); return; } int timeToCompare = -1; if (args.Length == 3) { timeToCompare = Convert.ToInt32(args[2]); findFirst = false; } DDDObjectLog log1 = new DDDObjectLog(dddObjectLogPath1); DDDObjectLog log2 = new DDDObjectLog(dddObjectLogPath2); if (findFirst) { int tMax1 = log1.GetMaxTime(); int tMax2 = log2.GetMaxTime(); timeToCompare = tMax1 >= tMax2 ? tMax1 : tMax2; timeToCompare = timeToCompare / 1000; bool foundDiffs = false; for (int i = 0; i < timeToCompare + 1; i++) { foundDiffs = FindDifferences(log1, log2, i); if (foundDiffs) { Console.WriteLine(String.Format("******First difference at time: {0}", i)); return; } } } else { FindDifferences(log1, log2, timeToCompare); } }
static void Main(string[] args) { bool findFirst = true; if (args.Length < 2) { Console.WriteLine(String.Format("Usage: {0} [Object State File 1] [Object State File 2] [Time to compare -- optional]", Environment.CommandLine)); return; } string dddObjectLogPath1 = args[0]; string dddObjectLogPath2 = args[1]; if (!File.Exists(dddObjectLogPath1)) { Console.WriteLine(String.Format("{0} doesn't exist!", dddObjectLogPath1)); return; } if (!File.Exists(dddObjectLogPath2)) { Console.WriteLine(String.Format("{0} doesn't exist!", dddObjectLogPath2)); return; } int timeToCompare = -1; if (args.Length == 3) { timeToCompare = Convert.ToInt32(args[2]); findFirst = false; } DDDObjectLog log1 = new DDDObjectLog(dddObjectLogPath1); DDDObjectLog log2 = new DDDObjectLog(dddObjectLogPath2); if (findFirst) { int tMax1 = log1.GetMaxTime(); int tMax2 = log2.GetMaxTime(); timeToCompare = tMax1 >= tMax2 ? tMax1 : tMax2; timeToCompare = timeToCompare / 1000; bool foundDiffs = false; for (int i = 0; i < timeToCompare + 1; i++) { foundDiffs = FindDifferences(log1, log2, i); if (foundDiffs) { Console.WriteLine(String.Format("******First difference at time: {0}", i)); return; } } } else { FindDifferences(log1, log2, timeToCompare); } }