diff --git a/Code/CSRender/CSRender/CompareTIFF.cs b/Code/CSRender/CSRender/CompareTIFF.cs index 97bb072ac28a037b27ef6b0a7e82fc66874acae1..af25128d43dce99b9b88b59f4bc042edd8c18d27 100644 --- a/Code/CSRender/CSRender/CompareTIFF.cs +++ b/Code/CSRender/CSRender/CompareTIFF.cs @@ -21,7 +21,7 @@ namespace CSRender { class CompareTIFF { - public static void runPureVerify(string targetDir, string referenceDir, string workPath, + public static int[] runPureVerify(string targetDir, string referenceDir, string workPath, string shiftPixel, string colorMargin, string removePoint, string shadingOff, bool reportFlag, string reportName, string inDiffPath, string inTargetFileName, DateTime inDateTime, string inReportInfo) { @@ -91,7 +91,7 @@ namespace CSRender processStartInfo.Arguments += "\" "; //レポートファイル名を設定 - string timeForReport = "【" + inDateTime.ToString("yyMMdd_HHmm") + "】" + ".pdf"; + string timeForReport = "[" + inDateTime.ToString("yyMMdd_HHmm") + "]" + ".pdf"; string TargetName = System.IO.Path.Combine(reportName, inTargetFileName + ".pdf" + timeForReport); processStartInfo.Arguments += "/inspReport \""; processStartInfo.Arguments += TargetName; @@ -120,15 +120,23 @@ namespace CSRender //processStartInfo.Arguments += System.IO.Path.Combine(appDirectory, textPath); processStartInfo.Arguments += reportInfoPath; + //コンソールへの出力を制御 + processStartInfo.Arguments += " /consoleOut "; + processStartInfo.Arguments += "2";//0:新規のコンソールに出力、1:親コンソールに出力(無い場合は新規に)、2:NULLコンソールに出力 + //CSRender.exeを実行 Process process = Process.Start(processStartInfo); process.BeginOutputReadLine(); process.WaitForExit(); process.Close(); - //NGの含まれる場合レポート名の頭に【NG】を付与 + //NGの数を取得 + int[] NGOfThisFile = getNgOfPDF(logFileName); + + //NGの含まれる場合レポート名の頭に【NG_】を付与 NGReportName(TargetName, reportName); - + + return NGOfThisFile.ToArray(); } //指定先にレポートを移動 @@ -171,8 +179,10 @@ namespace CSRender { foreach (var oldPathName in NGreportFileName) { + string oldNGName = System.IO.Path.GetFileNameWithoutExtension(oldPathName); + oldNGName = oldNGName.Substring(0, oldNGName.Length - 4) + ".pdf"; string oldFile = System.IO.Path.GetFileName(oldPathName); - File.Copy(oldPathName, System.IO.Path.Combine(inReportPath, "【NG】" + oldFile), true); + File.Copy(oldPathName, System.IO.Path.Combine(inReportPath, "NG_" + oldNGName), true); File.Delete(oldPathName); } } @@ -181,11 +191,41 @@ namespace CSRender foreach (var beforePathName in OKreportFileName) { string oldFile = System.IO.Path.GetFileName(beforePathName); - File.Copy(beforePathName, System.IO.Path.Combine(inReportPath, "【OK】" + oldFile), true); + File.Copy(beforePathName, System.IO.Path.Combine(inReportPath, "OK_" + oldFile), true); File.Delete(beforePathName); } } } + //NG画像の数を取得 + public static int[] getNgOfPDF(string inLogPath) + { + string tranceNGString = File.ReadLines(inLogPath, Encoding.GetEncoding("Shift-JIS")).Skip(16).First();//17行目を抽出 + tranceNGString = tranceNGString.Replace("NG", "");//不要な部分をカット + tranceNGString = tranceNGString.Replace(":", ""); + tranceNGString = tranceNGString.Replace(" ", ""); + + string tranceAllString = File.ReadLines(inLogPath, Encoding.GetEncoding("Shift-JIS")).Skip(14).First();//15行目を抽出 + tranceAllString = tranceAllString.Replace("ALL", "");//不要な部分をカット + tranceAllString = tranceAllString.Replace(":", ""); + tranceAllString = tranceAllString.Replace(" ", ""); + + int NGDataNum = 0; + int AllDataNum = 0; + try + { + NGDataNum = Int32.Parse(tranceNGString); + AllDataNum = Int32.Parse(tranceAllString); + } + catch (FormatException e) + { + NGDataNum = 0; + AllDataNum = 0; + } + int[] DataNumSet = { NGDataNum, AllDataNum }; + + return DataNumSet.ToArray(); + } + } } diff --git a/Code/CSRender/CSRender/MainWindow.xaml b/Code/CSRender/CSRender/MainWindow.xaml index dc93b0f5c2c311a1ca90b66b2c7e30b564cbf50c..bd9ae722cff5ac64d5fd4d97ff57b693209424ba 100644 --- a/Code/CSRender/CSRender/MainWindow.xaml +++ b/Code/CSRender/CSRender/MainWindow.xaml @@ -77,7 +77,7 @@ - +