Commit 0a6b9a61 authored by tsuji's avatar tsuji

検版レポート入力の設定を修正(aaaで実行すると落ちる不具合)

parent d820414f
...@@ -63,11 +63,7 @@ namespace CSRender ...@@ -63,11 +63,7 @@ namespace CSRender
workBox.Text = dropFiles[0]; workBox.Text = dropFiles[0];
workBox.Focus(); workBox.Focus();
workBox.Select(this.workBox.Text.Length, 0); 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) private void ReportBox_Drop(object sender, System.Windows.DragEventArgs e)
...@@ -163,7 +159,7 @@ namespace CSRender ...@@ -163,7 +159,7 @@ namespace CSRender
writeText += "**WorkDirRoot: \"" + workFolderPath + "\"\r\n"; writeText += "**WorkDirRoot: \"" + workFolderPath + "\"\r\n";
writeText += "**InspQuality: \"3\"\r\n"; writeText += "**InspQuality: \"3\"\r\n";
writeText += "**MarkDistance: \"50\"\r\n"; writeText += "**MarkDistance: \"50\"\r\n";
writeText += "**ReportEncodeType: \"1\"\r\n"; writeText += "**ReportEncodeType: \"2\"\r\n";
writeText += "**WndPosLeft: \"348\"\r\n"; writeText += "**WndPosLeft: \"348\"\r\n";
writeText += "**WndPosTop: \"125\"\r\n"; writeText += "**WndPosTop: \"125\"\r\n";
writeText += "**WndPosRight: \"933\"\r\n"; writeText += "**WndPosRight: \"933\"\r\n";
...@@ -178,5 +174,40 @@ namespace CSRender ...@@ -178,5 +174,40 @@ namespace CSRender
streamWriter.Close(); 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;
}
} }
} }
...@@ -192,21 +192,7 @@ namespace CSRender ...@@ -192,21 +192,7 @@ namespace CSRender
DoEvents(); DoEvents();
//検版レポートの入力チェック //検版レポートの入力チェック
bool reportFlag = false; bool reportFlag = checkReportPath();
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;
}
//PureVerifyの実行 //PureVerifyの実行
string workDir = CompareTIFF.runPureVerify(targetTIFFPath, referenceTIFFPath, workBox.Text string workDir = CompareTIFF.runPureVerify(targetTIFFPath, referenceTIFFPath, workBox.Text
...@@ -289,8 +275,7 @@ namespace CSRender ...@@ -289,8 +275,7 @@ namespace CSRender
/// </summary> /// </summary>
/// <param name="pageFlag">ページ範囲の指定があるかどうかを示すフラグ</param> /// <param name="pageFlag">ページ範囲の指定があるかどうかを示すフラグ</param>
/// <param name="selectedPage">入力されたページ数</param> /// <param name="selectedPage">入力されたページ数</param>
/// <param name="e"></param> /// <param name="TIFFresult">CSRenderの処理出力文</param>
/// <param name="e"></param>
/// ///
private void TIFFButtonClick(object sender, RoutedEventArgs e) private void TIFFButtonClick(object sender, RoutedEventArgs e)
{ {
......
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