diff --git a/Code/CSRender/CSRender/CompareTIFF.cs b/Code/CSRender/CSRender/CompareTIFF.cs index 6443997e081d29dd5aeda32378ad6d14897dfcc6..dfd231bfa290c34f89a6dabe4721f61e35785ec0 100644 --- a/Code/CSRender/CSRender/CompareTIFF.cs +++ b/Code/CSRender/CSRender/CompareTIFF.cs @@ -26,9 +26,10 @@ namespace CSRender { //実行用コンソールの呼び出し ProcessStartInfo processStartInfo = new ProcessStartInfo(); - string stCurrentDir = System.IO.Directory.GetCurrentDirectory(); + string appPath = System.Reflection.Assembly.GetExecutingAssembly().Location; //モジュールのパスを取得 + string appDirectory = appPath.Substring(0, appPath.LastIndexOf(@"\") + 1); //モジュールの存在するディレクトリを取得 string exePath = System.IO.Path.Combine("PureVerify.Data", "RipVerify", "bin", "x64"); - processStartInfo.FileName = System.IO.Path.Combine(stCurrentDir, exePath, "PureVerify.exe"); + processStartInfo.FileName = System.IO.Path.Combine(appDirectory, exePath, "PureVerify.exe"); processStartInfo.CreateNoWindow = true; // コマンドプロンプトを非表示 processStartInfo.UseShellExecute = false; // シェル機能オフ processStartInfo.RedirectStandardOutput = true;//標準出力をリダイレクト @@ -43,7 +44,7 @@ namespace CSRender processStartInfo.Arguments += referenceDir; //EquiosCenterの場所 - string EquiosCenter = System.IO.Path.Combine(stCurrentDir, "PureVerify.Data", "EquiosCenter"); + string EquiosCenter = System.IO.Path.Combine(appDirectory, "PureVerify.Data", "EquiosCenter"); processStartInfo.Arguments += " /equios "; processStartInfo.Arguments += EquiosCenter; @@ -51,7 +52,7 @@ namespace CSRender processStartInfo.Arguments += " /work "; //processStartInfo.Arguments += workPath; - string workDir = System.IO.Path.Combine(stCurrentDir, "PureVerify.Data", "RipVerify"); + string workDir = System.IO.Path.Combine(appDirectory, "PureVerify.Data", "RipVerify"); processStartInfo.Arguments += workDir; //検版の指定(2だとNGログ検版(LOG-Diff)になる) diff --git a/Code/CSRender/CSRender/MainWindow.xaml.cs b/Code/CSRender/CSRender/MainWindow.xaml.cs index 321397e13ea070caef73e096d42cfcfcd760deaf..ecbe3f4a0be27560bcd8df19e08b5c09ee84e96a 100644 --- a/Code/CSRender/CSRender/MainWindow.xaml.cs +++ b/Code/CSRender/CSRender/MainWindow.xaml.cs @@ -111,7 +111,27 @@ namespace CSRender private void CloseButton_Click(object sender, RoutedEventArgs e) => Close(); - //比較ボタン実行 + /// + /// 比較ボタンを実行する。 + /// + /// 選択された対象フォルダ(ファイル)のパス + /// アプリケーションのメインウインドウ + /// 出力メニューのテキストボックス + /// 選択されたリファレンスフォルダ(ファイル)のパス + /// 選択された作業フォルダのパス + /// 位置ズレ許容量のパラメータ + /// 諧調差許容量のパラメータ + /// 微小差異許容量のパラメータ + /// 視覚的あいまい量のパラメータ + /// ページ範囲を指定するかどうかを示すフラグ + /// TIFF変換するページ範囲 + /// 検査範囲を選択するプルダウンメニューで選択された内容の文字列 + /// 入力されたページを表す文字列 + /// 対象フォルダのTIFF画像を配置するフォルダのパス + /// リファレンスフォルダのTIFF画像を配置するフォルダのパス + /// PureVerify内部の作業フォルダのパス + /// 検版レポートのファイル名 + private void CompareButtonClick(object sender, RoutedEventArgs e) { //対象フォルダのpathチェック @@ -202,6 +222,7 @@ namespace CSRender //レポートを出力 outputLog(System.IO.Path.Combine(workDir, "report")); + //レポート名を取得 string PDFName = CompareTIFF.getReportName(workDir); //指定先にレポートを移動 @@ -211,7 +232,7 @@ namespace CSRender ResultConsole.Text += " 検版レポートのパス:"; ResultConsole.Text += System.IO.Path.Combine(workBox.Text, "report", PDFName); ResultConsole.Text += "\r\n"; - + //パラメータを次回初期値用に保存 Properties.Settings.Default.resolutionSetting = ResolutionBox.Text; Properties.Settings.Default.formatSetting = FileSelect.Text; @@ -222,10 +243,17 @@ namespace CSRender Properties.Settings.Default.Save(); } - //UIに検版結果を出力 + /// + /// UIに検版結果を出力する。 + /// + /// 作業フォルダ内のlogファイルを全て格納する配列 + /// 作成されたlogファイルの名称logString + /// logファイルを読み取るリーダー + /// リーダーで読み取った行の文字列 + /// リーダーがその時点で読み込んでいる行数 private void outputLog(string workDir) { - //logファイルを読み取り + //logファイルを読み取り(1行ずつ) string[] reportFiles = System.IO.Directory.GetFiles(workDir, "*.log", System.IO.SearchOption.TopDirectoryOnly); string logfileName = reportFiles[0]; StreamReader logString = new StreamReader(logfileName, Encoding.GetEncoding("Shift-JIS"));//Shift-JISでエンコーディング @@ -250,7 +278,7 @@ namespace CSRender //TIFFボタンを実行 private void TIFFButtonClick(object sender, RoutedEventArgs e) { - + //出力メニューにメッセージを出力 ResultConsole.Text += "<変換開始>\r\n"; ResultConsole.Text += " PDFを" + FileSelect.Text + "に変換します\r\n"; ResultConsole.Text += "\r\n"; diff --git a/Code/CSRender/CSRender/OurputTIFF.cs b/Code/CSRender/CSRender/OurputTIFF.cs index 91957967009319d3fd52aa42736edb8366406dae..048f2c116b530ef74a456e27fe32b1b1de35783d 100644 --- a/Code/CSRender/CSRender/OurputTIFF.cs +++ b/Code/CSRender/CSRender/OurputTIFF.cs @@ -26,8 +26,9 @@ namespace CSRender { //実行用コンソール呼び出し ProcessStartInfo processStartInfo = new ProcessStartInfo(); - string stCurrentDir = System.IO.Directory.GetCurrentDirectory(); - processStartInfo.FileName = System.IO.Path.Combine(stCurrentDir, "CSRender.Data", "CSRender.exe"); + string appPath = System.Reflection.Assembly.GetExecutingAssembly().Location; //モジュールのパスを取得 + string appDirectory = appPath.Substring(0, appPath.LastIndexOf(@"\") + 1); //モジュールの存在するディレクトリを取得 + processStartInfo.FileName = System.IO.Path.Combine(appDirectory, "CSRender.Data", "CSRender.exe"); processStartInfo.CreateNoWindow = true; // コマンドプロンプトを非表示 processStartInfo.UseShellExecute = false; // シェル機能オフ processStartInfo.RedirectStandardOutput = true;//標準出力をリダイレクト