Commit 7d7ee434 authored by tsuji's avatar tsuji

検版処理の変数定義の記述を整理

parent d1e38770
......@@ -231,5 +231,18 @@ namespace CSRender
return DataNumSet.ToArray();
}
//前回のログが内部に残っていれば削除(エラー防止)
public static void deleteOldLog(string inLogPath)
{
if (System.IO.Directory.EnumerateFileSystemEntries(inLogPath).Any())
{
DirectoryInfo logDirctory = new DirectoryInfo(inLogPath);
FileInfo[] logFiles = logDirctory.GetFiles();
foreach (FileInfo delFile in logFiles)
{
delFile.Delete();
}
}
}
}
}
......@@ -117,6 +117,19 @@ namespace CSRender
string colorMargin = GradationBox.Text;
string removePoint = SmallDiffBox.Text;
string shadingOff = VisualBox.Text;
//検版処理関係の変数
string appPath = System.Reflection.Assembly.GetExecutingAssembly().Location; //モジュールのパスを取得
string appDirectory = appPath.Substring(0, appPath.LastIndexOf(@"\") + 1); //モジュールの存在するディレクトリを取得
string workDir = System.IO.Path.Combine(appDirectory, "PureVerify.Data", "RipVerify");//PureVerifyのworkパス
string exePath = System.IO.Path.Combine(workDir, "bin", "x64");//exeのpathを取得
int allPDFNum = 0; //検版するPDFの総数
int NGPDFNum = 0; //検版でNGだったPDFの総数
bool reportFlag = false; //レポート名を変えるかどうか判別するフラグ
string reportContentsInfo = "";//レポートに記述する内容
bool pageFlag = false; //ページ数の指定かあるかどうかのフラグ
string selectedPage = ""; //指定されたページ数
bool dummyFlag = false; //ダミーのファイルを作るかどうかのフラグ
string dummyFileName = "";//ダミーのファイル名
//対象フォルダのpathチェック
if (!Directory.Exists(targetBoxText) && !File.Exists(targetBoxText))
......@@ -149,13 +162,10 @@ namespace CSRender
}
//検版対象がファイル名の場合、ファイル名が対象とリファレンスとで一致しなくても検版するように仕込み
bool dummyFlag = false;
string dummyFileName = "";
if (File.Exists(referenceBoxText) && File.Exists(targetBoxText))
{
dummyFileName = SelectFileTarget(dummyFlag, targetBoxText, referenceBoxText, workBoxText);
}
//出力ファイルpathのチェック
if (!Directory.Exists(workBoxText) && !File.Exists(workBoxText))
......@@ -172,13 +182,15 @@ namespace CSRender
reviveButton();//終了前にメニューを復帰
return;
}
//前回のログが内部に残っていれば削除(エラー防止)
CompareTIFF.deleteOldLog(System.IO.Path.Combine(workDir, "report"));
string workLogPath = System.IO.Path.Combine(workBoxText, "report");//reportフォルダのパス
checkDirPath(workLogPath);//なければ作成
string outDiffPath = System.IO.Path.Combine(workBoxText, "OUT_DIFF");//DIFF画像の出力先パス
checkDirPath(outDiffPath);//なければ作成
bool reportFlag = false;
try
{
//検版レポートの入力チェック
......@@ -195,8 +207,6 @@ namespace CSRender
ripTime.Start();//計測開始
//必要に応じてページ引数を指定
bool pageFlag = false;
string selectedPage = "";
if (PageRange.Text == "指定")
{
pageFlag = true;
......@@ -259,8 +269,7 @@ namespace CSRender
ResultConsole.Text += "< TIFF変換完了 >\r\n";
ResultConsole.ScrollToEnd();
DoEvents();
string reportContentsInfo = "";
try
{
//レポートへの出力内容を編集
......@@ -272,10 +281,7 @@ namespace CSRender
string WorkCategory = "検版レポートの編集";
ExceptionMessage(ex, workLogPath, WorkCategory);
}
string workDir = "";
int allPDFNum = 0;
int NGPDFNum = 0;
//この時点での出力文字列を取得
string tiffString = ResultConsole.Text;
try
......@@ -285,22 +291,7 @@ namespace CSRender
//検版対象ファイル名の取得
string[] inspectionTargets = GetTargetList(targetBoxText, referenceBoxText);
allPDFNum = getNumOfTiff(inspectionTargets, targetTIFFPath);//検版する画像ファイルの総数
string appPath = System.Reflection.Assembly.GetExecutingAssembly().Location; //モジュールのパスを取得
string appDirectory = appPath.Substring(0, appPath.LastIndexOf(@"\") + 1); //モジュールの存在するディレクトリを取得
workDir = System.IO.Path.Combine(appDirectory, "PureVerify.Data", "RipVerify");
//前回のログが内部に残っていれば削除(エラー防止)
if(System.IO.Directory.EnumerateFileSystemEntries(System.IO.Path.Combine(workDir, "report")).Any())
{
DirectoryInfo logDirctory = new DirectoryInfo(System.IO.Path.Combine(workDir, "report"));
FileInfo[] logFiles = logDirctory.GetFiles();
foreach (FileInfo delFile in logFiles)
{
delFile.Delete();
}
}
//exeのpathを取得
string exePath = System.IO.Path.Combine(workDir, "bin", "x64");
//隠しメニューの数値を初期化
allNumBox.Text = allPDFNum.ToString();
NGNumBox.Text = "0";
......
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