Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KenPanCS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QCD
Tools
KenPanCS
Commits
938a4ded
Commit
938a4ded
authored
Nov 25, 2021
by
tsuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update CSRender
・検版パラメータをUIで調整できるように修正
parent
9b4210c1
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
271 additions
and
57 deletions
+271
-57
CSRender.csproj
Code/CSRender/CSRender/CSRender.csproj
+1
-1
CompareTIFF.cs
Code/CSRender/CSRender/CompareTIFF.cs
+14
-2
MainWindow.xaml
Code/CSRender/CSRender/MainWindow.xaml
+83
-31
MainWindow.xaml.cs
Code/CSRender/CSRender/MainWindow.xaml.cs
+41
-3
NumericUpDown.cs
Code/CSRender/CSRender/NumericUpDown.cs
+132
-20
No files found.
Code/CSRender/CSRender/CSRender.csproj
View file @
938a4ded
...
...
@@ -75,7 +75,7 @@
<Compile
Include=
"CompareTIFF.cs"
/>
<Compile
Include=
"CustomMsgBox.cs"
/>
<Compile
Include=
"OurputTIFF.cs"
/>
<Compile
Include=
"ComboBox.cs"
/>
<Compile
Include=
"
Page
ComboBox.cs"
/>
<Compile
Include=
"FilePathSelect.cs"
/>
<Compile
Include=
"MainWindow.xaml.cs"
>
<DependentUpon>
MainWindow.xaml
</DependentUpon>
...
...
Code/CSRender/CSRender/CompareTIFF.cs
View file @
938a4ded
...
...
@@ -21,7 +21,8 @@ namespace CSRender
{
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
();
...
...
@@ -62,7 +63,18 @@ namespace CSRender
//検版結果OKとなったファイルリストをPDFレポートの最後に記載(0:記載しない、1:記載する)
processStartInfo
.
Arguments
+=
" /show \"1\""
;
//検版品質ファイルの選択(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を実行
Process
process
=
Process
.
Start
(
processStartInfo
);
...
...
Code/CSRender/CSRender/MainWindow.xaml
View file @
938a4ded
This diff is collapsed.
Click to expand it.
Code/CSRender/CSRender/MainWindow.xaml.cs
View file @
938a4ded
...
...
@@ -40,6 +40,37 @@ namespace CSRender
ResolutionBox
.
TextChanged
+=
NumericTextBox_NumChanged
;
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
=
"全ページ"
}));
...
...
@@ -98,6 +129,12 @@ namespace CSRender
return
;
}
//検版パラメータの取得
string
shiftPixel
=
PositionBox
.
Text
;
string
colorMargin
=
GradationBox
.
Text
;
string
removePoint
=
SmallDiffBox
.
Text
;
string
shadingOff
=
VisualBox
.
Text
;
//TIFF画像の生成
ResultConsole
.
Text
+=
"<TIFF変換開始>\r\n"
;
ResultConsole
.
Text
+=
" 対象ファイルをTIFF画像に変換中\r\n"
;
...
...
@@ -139,7 +176,8 @@ namespace CSRender
//PureVerifyの実行
//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"
));
...
...
Code/CSRender/CSRender/NumericUpDown.cs
View file @
938a4ded
...
...
@@ -21,67 +21,179 @@ namespace CSRender
{
////////////////////////////////////////////////////////////////////////////
// 解像度のUpDownメニュー
昨日
の記述
// 解像度のUpDownメニュー
機能
の記述
////////////////////////////////////////////////////////////////////////////
//TextBoxフォーカス時にテキスト全選択
private
void
NumericTextBox_GotFocusSelectAll
(
object
sender
,
RoutedEventArgs
e
)
{
TextBox
b
ox
=
(
TextBox
)
sender
;
TextBox
ResolutionB
ox
=
(
TextBox
)
sender
;
//box.SelectAll();
this
.
Dispatcher
.
InvokeAsync
(()
=>
{
Task
.
Delay
(
10
);
b
ox
.
SelectAll
();
});
this
.
Dispatcher
.
InvokeAsync
(()
=>
{
Task
.
Delay
(
10
);
ResolutionB
ox
.
SelectAll
();
});
}
//正規表現で数値以外は削除using System.Text.RegularExpressions;
private
void
NumericTextBox_TextChanged
(
object
sender
,
TextChangedEventArgs
e
)
{
TextBox
b
ox
=
(
TextBox
)
sender
;
TextBox
ResolutionB
ox
=
(
TextBox
)
sender
;
double
d
;
if
(!
double
.
TryParse
(
b
ox
.
Text
,
out
d
))
if
(!
double
.
TryParse
(
ResolutionB
ox
.
Text
,
out
d
))
{
box
.
Text
=
Regex
.
Replace
(
b
ox
.
Text
,
"[^0-9-]"
,
""
);
ResolutionBox
.
Text
=
Regex
.
Replace
(
ResolutionB
ox
.
Text
,
"[^0-9-]"
,
""
);
}
}
//数字の下限;
private
void
NumericTextBox_NumChanged
(
object
sender
,
TextChangedEventArgs
e
)
{
TextBox
b
ox
=
(
TextBox
)
sender
;
if
(
b
ox
.
Text
==
""
)
TextBox
ResolutionB
ox
=
(
TextBox
)
sender
;
if
(
ResolutionB
ox
.
Text
==
""
)
{
b
ox
.
Text
=
"72"
;
ResolutionB
ox
.
Text
=
"72"
;
}
NumericScroll1
.
Value
=
Int32
.
Parse
(
b
ox
.
Text
);
NumericScroll1
.
Value
=
Int32
.
Parse
(
ResolutionB
ox
.
Text
);
}
//TextBox上でマウスホイールを回転させた時にスクロールバーの値を上下させる
private
void
NumericTextBox_MouseWheel
(
object
sender
,
MouseWheelEventArgs
e
)
{
TextBox
text
Box
=
(
TextBox
)
sender
;
Binding
binding
=
BindingOperations
.
GetBinding
(
text
Box
,
TextBox
.
TextProperty
);
ScrollBar
scrollBar
=
(
ScrollBar
)
this
.
FindName
(
binding
.
ElementName
);
//名前から取得
scrollBar
.
Value
=
Int32
.
Parse
(
text
Box
.
Text
);
TextBox
Resolution
Box
=
(
TextBox
)
sender
;
Binding
binding
=
BindingOperations
.
GetBinding
(
Resolution
Box
,
TextBox
.
TextProperty
);
ScrollBar
NumericScroll1
=
(
ScrollBar
)
this
.
FindName
(
binding
.
ElementName
);
//名前から取得
NumericScroll1
.
Value
=
Int32
.
Parse
(
Resolution
Box
.
Text
);
if
(
e
.
Delta
>
0
)
{
scrollBar
.
Value
++;
NumericScroll1
.
Value
++;
}
else
{
scrollBar
.
Value
--;
NumericScroll1
.
Value
--;
}
}
//ScrollBar上でマウスホイールを回転させた時にScrollBarの値を上下させる
private
void
NumericScroll1_MouseWheel
(
object
sender
,
MouseWheelEventArgs
e
)
{
ScrollBar
sb
=
(
ScrollBar
)
sender
;
sb
.
Value
=
Int32
.
Parse
(
ResolutionBox
.
Text
);
ScrollBar
NumericScroll1
=
(
ScrollBar
)
sender
;
NumericScroll1
.
Value
=
Int32
.
Parse
(
ResolutionBox
.
Text
);
if
(
e
.
Delta
>
0
)
{
sb
.
Value
++;
NumericScroll1
.
Value
++;
}
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
--;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment