Commit 95ab77bc authored by tsuji's avatar tsuji

内部アプリケーションの参照方法をカレントディレクトリを用いない形に変更

parent ab65d5ac
...@@ -26,9 +26,10 @@ namespace CSRender ...@@ -26,9 +26,10 @@ namespace CSRender
{ {
//実行用コンソールの呼び出し //実行用コンソールの呼び出し
ProcessStartInfo processStartInfo = new ProcessStartInfo(); 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"); 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.CreateNoWindow = true; // コマンドプロンプトを非表示
processStartInfo.UseShellExecute = false; // シェル機能オフ processStartInfo.UseShellExecute = false; // シェル機能オフ
processStartInfo.RedirectStandardOutput = true;//標準出力をリダイレクト processStartInfo.RedirectStandardOutput = true;//標準出力をリダイレクト
...@@ -43,7 +44,7 @@ namespace CSRender ...@@ -43,7 +44,7 @@ namespace CSRender
processStartInfo.Arguments += referenceDir; processStartInfo.Arguments += referenceDir;
//EquiosCenterの場所 //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 += " /equios ";
processStartInfo.Arguments += EquiosCenter; processStartInfo.Arguments += EquiosCenter;
...@@ -51,7 +52,7 @@ namespace CSRender ...@@ -51,7 +52,7 @@ namespace CSRender
processStartInfo.Arguments += " /work "; processStartInfo.Arguments += " /work ";
//processStartInfo.Arguments += workPath; //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; processStartInfo.Arguments += workDir;
//検版の指定(2だとNGログ検版(LOG-Diff)になる) //検版の指定(2だとNGログ検版(LOG-Diff)になる)
......
...@@ -111,7 +111,27 @@ namespace CSRender ...@@ -111,7 +111,27 @@ namespace CSRender
private void CloseButton_Click(object sender, RoutedEventArgs e) => private void CloseButton_Click(object sender, RoutedEventArgs e) =>
Close(); Close();
//比較ボタン実行 /// <summary>
/// 比較ボタンを実行する。
/// </summary>
/// <param name="targetBox.Text">選択された対象フォルダ(ファイル)のパス</param>
/// <param name="mainWindow">アプリケーションのメインウインドウ</param>
/// <param name="ResultConsole.Text">出力メニューのテキストボックス</param>
/// <param name="referenceBox.Text">選択されたリファレンスフォルダ(ファイル)のパス</param>
/// <param name="workBox.Text">選択された作業フォルダのパス</param>
/// <param name="shiftPixel">位置ズレ許容量のパラメータ</param>
/// <param name="colorMargin">諧調差許容量のパラメータ</param>
/// <param name="removePoint">微小差異許容量のパラメータ</param>
/// <param name="shadingOff">視覚的あいまい量のパラメータ</param>
/// <param name="pageFlag">ページ範囲を指定するかどうかを示すフラグ</param>
/// <param name="selectedPage">TIFF変換するページ範囲</param>
/// <param name="PageRange.Text">検査範囲を選択するプルダウンメニューで選択された内容の文字列</param>
/// <param name="pageBox.Text">入力されたページを表す文字列</param>
/// <param name="targetTIFFPath">対象フォルダのTIFF画像を配置するフォルダのパス</param>
/// <param name="referenseTIFFPath">リファレンスフォルダのTIFF画像を配置するフォルダのパス</param>
/// <param name="workDir">PureVerify内部の作業フォルダのパス</param>
/// <param name="PDFName">検版レポートのファイル名</param>
private void CompareButtonClick(object sender, RoutedEventArgs e) private void CompareButtonClick(object sender, RoutedEventArgs e)
{ {
//対象フォルダのpathチェック //対象フォルダのpathチェック
...@@ -202,6 +222,7 @@ namespace CSRender ...@@ -202,6 +222,7 @@ namespace CSRender
//レポートを出力 //レポートを出力
outputLog(System.IO.Path.Combine(workDir, "report")); outputLog(System.IO.Path.Combine(workDir, "report"));
//レポート名を取得
string PDFName = CompareTIFF.getReportName(workDir); string PDFName = CompareTIFF.getReportName(workDir);
//指定先にレポートを移動 //指定先にレポートを移動
...@@ -211,7 +232,7 @@ namespace CSRender ...@@ -211,7 +232,7 @@ namespace CSRender
ResultConsole.Text += " 検版レポートのパス:"; ResultConsole.Text += " 検版レポートのパス:";
ResultConsole.Text += System.IO.Path.Combine(workBox.Text, "report", PDFName); ResultConsole.Text += System.IO.Path.Combine(workBox.Text, "report", PDFName);
ResultConsole.Text += "\r\n"; ResultConsole.Text += "\r\n";
//パラメータを次回初期値用に保存 //パラメータを次回初期値用に保存
Properties.Settings.Default.resolutionSetting = ResolutionBox.Text; Properties.Settings.Default.resolutionSetting = ResolutionBox.Text;
Properties.Settings.Default.formatSetting = FileSelect.Text; Properties.Settings.Default.formatSetting = FileSelect.Text;
...@@ -222,10 +243,17 @@ namespace CSRender ...@@ -222,10 +243,17 @@ namespace CSRender
Properties.Settings.Default.Save(); Properties.Settings.Default.Save();
} }
//UIに検版結果を出力 /// <summary>
/// UIに検版結果を出力する。
/// </summary>
/// <param name="reportFiles">作業フォルダ内のlogファイルを全て格納する配列</param>
/// <param name="logfileName">作成されたlogファイルの名称</param>logString
/// <param name="logString">logファイルを読み取るリーダー</param>
/// <param name="tranceString">リーダーで読み取った行の文字列</param>
/// <param name="lineCount">リーダーがその時点で読み込んでいる行数</param>
private void outputLog(string workDir) private void outputLog(string workDir)
{ {
//logファイルを読み取り //logファイルを読み取り(1行ずつ)
string[] reportFiles = System.IO.Directory.GetFiles(workDir, "*.log", System.IO.SearchOption.TopDirectoryOnly); string[] reportFiles = System.IO.Directory.GetFiles(workDir, "*.log", System.IO.SearchOption.TopDirectoryOnly);
string logfileName = reportFiles[0]; string logfileName = reportFiles[0];
StreamReader logString = new StreamReader(logfileName, Encoding.GetEncoding("Shift-JIS"));//Shift-JISでエンコーディング StreamReader logString = new StreamReader(logfileName, Encoding.GetEncoding("Shift-JIS"));//Shift-JISでエンコーディング
...@@ -250,7 +278,7 @@ namespace CSRender ...@@ -250,7 +278,7 @@ namespace CSRender
//TIFFボタンを実行 //TIFFボタンを実行
private void TIFFButtonClick(object sender, RoutedEventArgs e) private void TIFFButtonClick(object sender, RoutedEventArgs e)
{ {
//出力メニューにメッセージを出力
ResultConsole.Text += "<変換開始>\r\n"; ResultConsole.Text += "<変換開始>\r\n";
ResultConsole.Text += " PDFを" + FileSelect.Text + "に変換します\r\n"; ResultConsole.Text += " PDFを" + FileSelect.Text + "に変換します\r\n";
ResultConsole.Text += "\r\n"; ResultConsole.Text += "\r\n";
......
...@@ -26,8 +26,9 @@ namespace CSRender ...@@ -26,8 +26,9 @@ namespace CSRender
{ {
//実行用コンソール呼び出し //実行用コンソール呼び出し
ProcessStartInfo processStartInfo = new ProcessStartInfo(); ProcessStartInfo processStartInfo = new ProcessStartInfo();
string stCurrentDir = System.IO.Directory.GetCurrentDirectory(); string appPath = System.Reflection.Assembly.GetExecutingAssembly().Location; //モジュールのパスを取得
processStartInfo.FileName = System.IO.Path.Combine(stCurrentDir, "CSRender.Data", "CSRender.exe"); string appDirectory = appPath.Substring(0, appPath.LastIndexOf(@"\") + 1); //モジュールの存在するディレクトリを取得
processStartInfo.FileName = System.IO.Path.Combine(appDirectory, "CSRender.Data", "CSRender.exe");
processStartInfo.CreateNoWindow = true; // コマンドプロンプトを非表示 processStartInfo.CreateNoWindow = true; // コマンドプロンプトを非表示
processStartInfo.UseShellExecute = false; // シェル機能オフ processStartInfo.UseShellExecute = false; // シェル機能オフ
processStartInfo.RedirectStandardOutput = true;//標準出力をリダイレクト processStartInfo.RedirectStandardOutput = true;//標準出力をリダイレクト
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment