diff --git a/Code/CSRender/CSRender/FilePathSelect.cs b/Code/CSRender/CSRender/FilePathSelect.cs index 92503676b597b86e1570bd9e03bf7d17542a7c64..bc9ba75828e1b2c274fd78ef3ec1439c6335a186 100644 --- a/Code/CSRender/CSRender/FilePathSelect.cs +++ b/Code/CSRender/CSRender/FilePathSelect.cs @@ -63,11 +63,7 @@ namespace CSRender workBox.Text = dropFiles[0]; workBox.Focus(); workBox.Select(this.workBox.Text.Length, 0); - if (reportBox.Text == "")//検版レポートが未入力ならば作業フォルダ先に指定 - { - reportBox.Text = System.IO.Path.Combine(workBox.Text, "report"); - reportBox.Text += @"\"; - } + } private void ReportBox_Drop(object sender, System.Windows.DragEventArgs e) @@ -163,7 +159,7 @@ namespace CSRender writeText += "**WorkDirRoot: \"" + workFolderPath + "\"\r\n"; writeText += "**InspQuality: \"3\"\r\n"; writeText += "**MarkDistance: \"50\"\r\n"; - writeText += "**ReportEncodeType: \"1\"\r\n"; + writeText += "**ReportEncodeType: \"2\"\r\n"; writeText += "**WndPosLeft: \"348\"\r\n"; writeText += "**WndPosTop: \"125\"\r\n"; writeText += "**WndPosRight: \"933\"\r\n"; @@ -178,5 +174,40 @@ namespace CSRender streamWriter.Close(); } + + //レポート出力パスの確認 + private bool checkReportPath() + { + bool reportFlag = false; + string pdfReportPath = ""; + string pdfReportName = ""; + int directoryCount = 0; + if (reportBox.Text != "")//入力があるか + { + directoryCount = reportBox.Text.Split(char.Parse(@"\")).Length - 1;//入力文字列がファイル名のみかディレクトリも含むか + if (directoryCount == 0)//ファイル名のみならば作業ディレクトリのreportフォルダに出力 + { + reportBox.Text = System.IO.Path.Combine(workBox.Text, "report", reportBox.Text); + } + pdfReportPath = reportBox.Text.Substring(0, reportBox.Text.LastIndexOf(@"\"));//メニュー入力から出力パスを取得 + pdfReportName = reportBox.Text.Substring(reportBox.Text.LastIndexOf(@"\"));//メニュー入力から出力パスを取得 + if (!System.IO.Path.IsPathRooted(pdfReportPath))//指定したパス文字列にルートが含まれているかどうか + { + pdfReportPath = System.IO.Path.Combine(workBox.Text, "report", pdfReportPath);//含まれていなければ作業フォルダのreportフォルダに出力 + } + if (!Directory.Exists(pdfReportPath))//指定先のフォルダが存在するか + { + Directory.CreateDirectory(pdfReportPath);//なければ作成 + } + pdfReportPath = System.IO.Path.GetFullPath(pdfReportPath);//フルパスを取得 + if (pdfReportName.Length < 4 || pdfReportName.Substring(pdfReportName.Length - 4) != ".pdf")//入力に拡張子がついているか + { + pdfReportName += ".pdf"; + } + reportBox.Text = pdfReportPath + pdfReportName; + reportFlag = true; + } + return reportFlag; + } } } diff --git a/Code/CSRender/CSRender/MainWindow.xaml.cs b/Code/CSRender/CSRender/MainWindow.xaml.cs index 3b71b5cb4a86e848f8ebf0101be6fd662513a689..dd490d6172f84b29fa1c9386d75aa002e51c2d9e 100644 --- a/Code/CSRender/CSRender/MainWindow.xaml.cs +++ b/Code/CSRender/CSRender/MainWindow.xaml.cs @@ -192,21 +192,7 @@ namespace CSRender DoEvents(); //検版レポートの入力チェック - bool reportFlag = false; - string pdfReportPath = ""; - if (reportBox.Text != "")//入力があるか - { - pdfReportPath = reportBox.Text.Substring(0, reportBox.Text.LastIndexOf(@"\")); - if (!Directory.Exists(pdfReportPath))//指定先のフォルダが存在するか - { - Directory.CreateDirectory(pdfReportPath); - } - if (reportBox.Text.Substring(reportBox.Text.Length - 4) != ".pdf")//入力に拡張子がついているか - { - reportBox.Text += ".pdf"; - } - reportFlag = true; - } + bool reportFlag = checkReportPath(); //PureVerifyの実行 string workDir = CompareTIFF.runPureVerify(targetTIFFPath, referenceTIFFPath, workBox.Text @@ -289,8 +275,7 @@ namespace CSRender /// /// ページ範囲の指定があるかどうかを示すフラグ /// 入力されたページ数 - /// - /// + /// CSRenderの処理出力文 /// private void TIFFButtonClick(object sender, RoutedEventArgs e) {