Commit 938a4ded authored by tsuji's avatar tsuji

Update CSRender

・検版パラメータをUIで調整できるように修正
parent 9b4210c1
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<Compile Include="CompareTIFF.cs" /> <Compile Include="CompareTIFF.cs" />
<Compile Include="CustomMsgBox.cs" /> <Compile Include="CustomMsgBox.cs" />
<Compile Include="OurputTIFF.cs" /> <Compile Include="OurputTIFF.cs" />
<Compile Include="ComboBox.cs" /> <Compile Include="PageComboBox.cs" />
<Compile Include="FilePathSelect.cs" /> <Compile Include="FilePathSelect.cs" />
<Compile Include="MainWindow.xaml.cs"> <Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon> <DependentUpon>MainWindow.xaml</DependentUpon>
......
...@@ -21,7 +21,8 @@ namespace CSRender ...@@ -21,7 +21,8 @@ namespace CSRender
{ {
class CompareTIFF class CompareTIFF
{ {
public static string runPureVerify(string targetDir, string referenceDir, string workPath) public static string runPureVerify(string targetDir, string referenceDir, string workPath,
string shiftPixel, string colorMargin, string removePoint, string shadingOff)
{ {
//実行用コンソールの呼び出し //実行用コンソールの呼び出し
ProcessStartInfo processStartInfo = new ProcessStartInfo(); ProcessStartInfo processStartInfo = new ProcessStartInfo();
...@@ -62,7 +63,18 @@ namespace CSRender ...@@ -62,7 +63,18 @@ namespace CSRender
//検版結果OKとなったファイルリストをPDFレポートの最後に記載(0:記載しない、1:記載する) //検版結果OKとなったファイルリストをPDFレポートの最後に記載(0:記載しない、1:記載する)
processStartInfo.Arguments += " /show \"1\""; processStartInfo.Arguments += " /show \"1\"";
//検版品質ファイルの選択(0:弱、1:中、2:強、3:カスタム) //検版品質ファイルの選択(0:弱、1:中、2:強、3:カスタム)
processStartInfo.Arguments += " /quality \"2\""; processStartInfo.Arguments += " /quality \"3\"";
//検版パラメータの設定
processStartInfo.Arguments += " /shiftpixel \"";
processStartInfo.Arguments += shiftPixel;
processStartInfo.Arguments += "\" /colormargin \"";
processStartInfo.Arguments += colorMargin;
processStartInfo.Arguments += "\" /removepoint \"";
processStartInfo.Arguments += removePoint;
processStartInfo.Arguments += "\" /shadingoff \"";
processStartInfo.Arguments += shadingOff;
processStartInfo.Arguments += "\"";
//CSRender.exeを実行 //CSRender.exeを実行
Process process = Process.Start(processStartInfo); Process process = Process.Start(processStartInfo);
......
This diff is collapsed.
...@@ -40,6 +40,37 @@ namespace CSRender ...@@ -40,6 +40,37 @@ namespace CSRender
ResolutionBox.TextChanged += NumericTextBox_NumChanged; ResolutionBox.TextChanged += NumericTextBox_NumChanged;
NumericScroll1.MouseWheel += NumericScroll1_MouseWheel; NumericScroll1.MouseWheel += NumericScroll1_MouseWheel;
//位置ズレ許容量選択UpDownバーの設定
this.Title = this.ToString();
PositionBox.MouseWheel += NumericTextBox_MouseWheel;
PositionBox.GotFocus += NumericTextBox_GotFocusSelectAll;
PositionBox.TextChanged += NumericTextBox_TextChanged;
PositionBox.TextChanged += PosiTextBox_NumChanged;
PosiScroll1.MouseWheel += PosiScroll1_MouseWheel;
//諧調差許容量選択UpDownバーの設定
this.Title = this.ToString();
GradationBox.MouseWheel += NumericTextBox_MouseWheel;
GradationBox.GotFocus += NumericTextBox_GotFocusSelectAll;
GradationBox.TextChanged += NumericTextBox_TextChanged;
GradationBox.TextChanged += GradTextBox_NumChanged;
GradScroll.MouseWheel += GradScroll_MouseWheel;
//微小誤差許容量選択UpDownバーの設定
this.Title = this.ToString();
SmallDiffBox.MouseWheel += NumericTextBox_MouseWheel;
SmallDiffBox.GotFocus += NumericTextBox_GotFocusSelectAll;
SmallDiffBox.TextChanged += NumericTextBox_TextChanged;
SmallDiffBox.TextChanged += SmallDiffTextBox_NumChanged;
SmallDiffScroll.MouseWheel += SmallDiffScroll_MouseWheel;
//視覚的あいまい量選択UpDownバーの設定
this.Title = this.ToString();
VisualBox.MouseWheel += NumericTextBox_MouseWheel;
VisualBox.GotFocus += NumericTextBox_GotFocusSelectAll;
VisualBox.TextChanged += NumericTextBox_TextChanged;
VisualBox.TextChanged += VisualTextBox_NumChanged;
VisualScroll.MouseWheel += VisualScroll_MouseWheel;
//ページ入力メニューの設定 //ページ入力メニューの設定
PagePattern.Add((new ComboBoxSet { Id = 1, Item = "全ページ"})); PagePattern.Add((new ComboBoxSet { Id = 1, Item = "全ページ"}));
...@@ -98,6 +129,12 @@ namespace CSRender ...@@ -98,6 +129,12 @@ namespace CSRender
return; return;
} }
//検版パラメータの取得
string shiftPixel = PositionBox.Text;
string colorMargin = GradationBox.Text;
string removePoint = SmallDiffBox.Text;
string shadingOff = VisualBox.Text;
//TIFF画像の生成 //TIFF画像の生成
ResultConsole.Text += "<TIFF変換開始>\r\n"; ResultConsole.Text += "<TIFF変換開始>\r\n";
ResultConsole.Text += " 対象ファイルをTIFF画像に変換中\r\n"; ResultConsole.Text += " 対象ファイルをTIFF画像に変換中\r\n";
...@@ -139,7 +176,8 @@ namespace CSRender ...@@ -139,7 +176,8 @@ namespace CSRender
//PureVerifyの実行 //PureVerifyの実行
//string workDir = CompareTIFF.runPureVerify(targetBox.Text, referenceBox.Text, workBox.Text); //string workDir = CompareTIFF.runPureVerify(targetBox.Text, referenceBox.Text, workBox.Text);
string workDir = CompareTIFF.runPureVerify(targetTIFFPath, referenceTIFFPath, workBox.Text); string workDir = CompareTIFF.runPureVerify(targetTIFFPath, referenceTIFFPath, workBox.Text
, shiftPixel, colorMargin, removePoint, shadingOff);
//レポートを出力 //レポートを出力
outputLog(System.IO.Path.Combine(workDir, "report")); outputLog(System.IO.Path.Combine(workDir, "report"));
......
...@@ -21,67 +21,179 @@ namespace CSRender ...@@ -21,67 +21,179 @@ namespace CSRender
{ {
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// 解像度のUpDownメニュー昨日の記述 // 解像度のUpDownメニュー機能の記述
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
//TextBoxフォーカス時にテキスト全選択 //TextBoxフォーカス時にテキスト全選択
private void NumericTextBox_GotFocusSelectAll(object sender, RoutedEventArgs e) private void NumericTextBox_GotFocusSelectAll(object sender, RoutedEventArgs e)
{ {
TextBox box = (TextBox)sender; TextBox ResolutionBox = (TextBox)sender;
//box.SelectAll(); //box.SelectAll();
this.Dispatcher.InvokeAsync(() => { Task.Delay(10); box.SelectAll(); }); this.Dispatcher.InvokeAsync(() => { Task.Delay(10); ResolutionBox.SelectAll(); });
} }
//正規表現で数値以外は削除using System.Text.RegularExpressions; //正規表現で数値以外は削除using System.Text.RegularExpressions;
private void NumericTextBox_TextChanged(object sender, TextChangedEventArgs e) private void NumericTextBox_TextChanged(object sender, TextChangedEventArgs e)
{ {
TextBox box = (TextBox)sender; TextBox ResolutionBox = (TextBox)sender;
double d; double d;
if (!double.TryParse(box.Text, out d)) if (!double.TryParse(ResolutionBox.Text, out d))
{ {
box.Text = Regex.Replace(box.Text, "[^0-9-]", ""); ResolutionBox.Text = Regex.Replace(ResolutionBox.Text, "[^0-9-]", "");
} }
} }
//数字の下限; //数字の下限;
private void NumericTextBox_NumChanged(object sender, TextChangedEventArgs e) private void NumericTextBox_NumChanged(object sender, TextChangedEventArgs e)
{ {
TextBox box = (TextBox)sender; TextBox ResolutionBox = (TextBox)sender;
if (box.Text == "") if (ResolutionBox.Text == "")
{ {
box.Text = "72"; ResolutionBox.Text = "72";
} }
NumericScroll1.Value = Int32.Parse(box.Text); NumericScroll1.Value = Int32.Parse(ResolutionBox.Text);
} }
//TextBox上でマウスホイールを回転させた時にスクロールバーの値を上下させる //TextBox上でマウスホイールを回転させた時にスクロールバーの値を上下させる
private void NumericTextBox_MouseWheel(object sender, MouseWheelEventArgs e) private void NumericTextBox_MouseWheel(object sender, MouseWheelEventArgs e)
{ {
TextBox textBox = (TextBox)sender; TextBox ResolutionBox = (TextBox)sender;
Binding binding = BindingOperations.GetBinding(textBox, TextBox.TextProperty); Binding binding = BindingOperations.GetBinding(ResolutionBox, TextBox.TextProperty);
ScrollBar scrollBar = (ScrollBar)this.FindName(binding.ElementName);//名前から取得 ScrollBar NumericScroll1 = (ScrollBar)this.FindName(binding.ElementName);//名前から取得
scrollBar.Value = Int32.Parse(textBox.Text); NumericScroll1.Value = Int32.Parse(ResolutionBox.Text);
if (e.Delta > 0) if (e.Delta > 0)
{ {
scrollBar.Value++; NumericScroll1.Value++;
} }
else else
{ {
scrollBar.Value--; NumericScroll1.Value--;
} }
} }
//ScrollBar上でマウスホイールを回転させた時にScrollBarの値を上下させる //ScrollBar上でマウスホイールを回転させた時にScrollBarの値を上下させる
private void NumericScroll1_MouseWheel(object sender, MouseWheelEventArgs e) private void NumericScroll1_MouseWheel(object sender, MouseWheelEventArgs e)
{ {
ScrollBar sb = (ScrollBar)sender; ScrollBar NumericScroll1 = (ScrollBar)sender;
sb.Value = Int32.Parse(ResolutionBox.Text); NumericScroll1.Value = Int32.Parse(ResolutionBox.Text);
if (e.Delta > 0) if (e.Delta > 0)
{ {
sb.Value++; NumericScroll1.Value++;
} }
else else
{ {
sb.Value--; NumericScroll1.Value--;
}
}
////////////////////////////////////////////////////////////////////////////
// 位置ズレ許容量のUpDownメニュー機能の記述
////////////////////////////////////////////////////////////////////////////
//数字の下限;
private void PosiTextBox_NumChanged(object sender, TextChangedEventArgs e)
{
TextBox PositionBox = (TextBox)sender;
if (PositionBox.Text == "")
{
PositionBox.Text = "2";
}
PosiScroll1.Value = Int32.Parse(PositionBox.Text);
}
//ScrollBar上でマウスホイールを回転させた時にScrollBarの値を上下させる
private void PosiScroll1_MouseWheel(object sender, MouseWheelEventArgs e)
{
ScrollBar PosiScroll1 = (ScrollBar)sender;
PosiScroll1.Value = Int32.Parse(PositionBox.Text);
if (e.Delta > 0)
{
PosiScroll1.Value++;
}
else
{
PosiScroll1.Value--;
}
}
////////////////////////////////////////////////////////////////////////////
// 諧調差許容量のUpDownメニュー機能の記述
////////////////////////////////////////////////////////////////////////////
//数字の下限;
private void GradTextBox_NumChanged(object sender, TextChangedEventArgs e)
{
TextBox GradationBox = (TextBox)sender;
if (GradationBox.Text == "")
{
GradationBox.Text = "60";
}
GradScroll.Value = Int32.Parse(GradationBox.Text);
}
//ScrollBar上でマウスホイールを回転させた時にScrollBarの値を上下させる
private void GradScroll_MouseWheel(object sender, MouseWheelEventArgs e)
{
ScrollBar GradScroll = (ScrollBar)sender;
GradScroll.Value = Int32.Parse(GradationBox.Text);
if (e.Delta > 0)
{
GradScroll.Value++;
}
else
{
GradScroll.Value--;
}
}
////////////////////////////////////////////////////////////////////////////
// 微小差異許容量のUpDownメニュー機能の記述
////////////////////////////////////////////////////////////////////////////
//数字の下限;
private void SmallDiffTextBox_NumChanged(object sender, TextChangedEventArgs e)
{
TextBox SmallDiffBox = (TextBox)sender;
if (SmallDiffBox.Text == "")
{
SmallDiffBox.Text = "60";
}
SmallDiffScroll.Value = Int32.Parse(SmallDiffBox.Text);
}
//ScrollBar上でマウスホイールを回転させた時にScrollBarの値を上下させる
private void SmallDiffScroll_MouseWheel(object sender, MouseWheelEventArgs e)
{
ScrollBar SmallDiffScroll = (ScrollBar)sender;
SmallDiffScroll.Value = Int32.Parse(SmallDiffBox.Text);
if (e.Delta > 0)
{
SmallDiffScroll.Value++;
}
else
{
SmallDiffScroll.Value--;
}
}
////////////////////////////////////////////////////////////////////////////
// 視覚的あいまい量のUpDownメニュー機能の記述
////////////////////////////////////////////////////////////////////////////
//数字の下限;
private void VisualTextBox_NumChanged(object sender, TextChangedEventArgs e)
{
TextBox VisualBox = (TextBox)sender;
if (VisualBox.Text == "")
{
VisualBox.Text = "60";
}
VisualScroll.Value = Int32.Parse(VisualBox.Text);
}
//ScrollBar上でマウスホイールを回転させた時にScrollBarの値を上下させる
private void VisualScroll_MouseWheel(object sender, MouseWheelEventArgs e)
{
ScrollBar VisualScroll = (ScrollBar)sender;
VisualScroll.Value = Int32.Parse(VisualBox.Text);
if (e.Delta > 0)
{
VisualScroll.Value++;
}
else
{
VisualScroll.Value--;
} }
} }
} }
......
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