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
de2bbc4c
Commit
de2bbc4c
authored
Dec 03, 2021
by
tsuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
検版レポートの名前指定機能を追加
parent
399ed706
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
34 deletions
+109
-34
CompareTIFF.cs
Code/CSRender/CSRender/CompareTIFF.cs
+7
-4
FilePathSelect.cs
Code/CSRender/CSRender/FilePathSelect.cs
+42
-0
MainWindow.xaml
Code/CSRender/CSRender/MainWindow.xaml
+28
-24
MainWindow.xaml.cs
Code/CSRender/CSRender/MainWindow.xaml.cs
+32
-6
No files found.
Code/CSRender/CSRender/CompareTIFF.cs
View file @
de2bbc4c
...
...
@@ -22,7 +22,7 @@ namespace CSRender
class
CompareTIFF
{
public
static
string
runPureVerify
(
string
targetDir
,
string
referenceDir
,
string
workPath
,
string
shiftPixel
,
string
colorMargin
,
string
removePoint
,
string
shadingOff
)
string
shiftPixel
,
string
colorMargin
,
string
removePoint
,
string
shadingOff
,
bool
reportFlag
,
string
reportName
)
{
//実行用コンソールの呼び出し
ProcessStartInfo
processStartInfo
=
new
ProcessStartInfo
();
...
...
@@ -76,13 +76,16 @@ namespace CSRender
processStartInfo
.
Arguments
+=
"\" /shadingoff \""
;
processStartInfo
.
Arguments
+=
shadingOff
;
processStartInfo
.
Arguments
+=
"\""
;
if
(
reportFlag
==
true
)
{
processStartInfo
.
Arguments
+=
" /inspReport \""
;
processStartInfo
.
Arguments
+=
reportName
;
processStartInfo
.
Arguments
+=
"\""
;
}
//CSRender.exeを実行
Process
process
=
Process
.
Start
(
processStartInfo
);
//ResultConsole.Text = process.StandardOutput.ReadToEnd();
//process.OutputDataReceived += process_DataReceived;
process
.
BeginOutputReadLine
();
//ResultConsole.ScrollToEnd();
process
.
WaitForExit
();
process
.
Close
();
...
...
Code/CSRender/CSRender/FilePathSelect.cs
View file @
de2bbc4c
...
...
@@ -62,6 +62,21 @@ namespace CSRender
workBox
.
Text
=
dropFiles
[
0
];
workBox
.
Focus
();
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
)
{
var
dropFiles
=
e
.
Data
.
GetData
(
System
.
Windows
.
DataFormats
.
FileDrop
)
as
string
[];
if
(
dropFiles
==
null
)
return
;
//カーソルを終端に置く
reportBox
.
Text
=
dropFiles
[
0
]
+
@"\"
;
reportBox
.
Focus
();
reportBox
.
Select
(
this
.
reportBox
.
Text
.
Length
,
0
);
}
//参照ボタンClickでフォルダ選択のダイアログを表示(対象フォルダ)
...
...
@@ -140,6 +155,33 @@ namespace CSRender
}
//共通部分
workBox
.
Text
=
selectFile
.
FileName
;
reportBox
.
Text
=
System
.
IO
.
Path
.
Combine
(
selectFile
.
FileName
,
"report"
)
+
@"\"
;
}
//参照ボタンClickでフォルダ選択のダイアログを表示(検版レポートパス)
private
void
ReportButton_Click
(
object
sender
,
RoutedEventArgs
e
)
{
//ファイル選択の場合
//var selectFile = new OpenFileDialog();
//selectFile.Title = "ファイルを選択してください";
//selectFile.InitialDirectory = @"C:";
//if ((bool)selectFile.ShowDialog())
//{
//FileName = selectFile.FileName;
//FileSelected(this, new EventArgs());
//}
//フォルダ選択の場合
var
selectFile
=
new
MSAPI
::
Dialogs
.
CommonOpenFileDialog
();
selectFile
.
IsFolderPicker
=
true
;
selectFile
.
Title
=
"フォルダを選択してください"
;
selectFile
.
InitialDirectory
=
@"C:"
;
if
(
selectFile
.
ShowDialog
()
!=
MSAPI
::
Dialogs
.
CommonFileDialogResult
.
Ok
)
{
return
;
}
//共通部分
reportBox
.
Text
=
selectFile
.
FileName
+
@"\"
;
}
}
}
Code/CSRender/CSRender/MainWindow.xaml
View file @
de2bbc4c
This diff is collapsed.
Click to expand it.
Code/CSRender/CSRender/MainWindow.xaml.cs
View file @
de2bbc4c
...
...
@@ -105,6 +105,8 @@ namespace CSRender
referenceBox
.
AddHandler
(
TextBox
.
DropEvent
,
new
DragEventHandler
(
RefBox_Drop
),
true
);
workBox
.
AddHandler
(
TextBox
.
DragOverEvent
,
new
DragEventHandler
(
textBox_PreviewDragOver
),
true
);
workBox
.
AddHandler
(
TextBox
.
DropEvent
,
new
DragEventHandler
(
WorkBox_Drop
),
true
);
reportBox
.
AddHandler
(
TextBox
.
DragOverEvent
,
new
DragEventHandler
(
textBox_PreviewDragOver
),
true
);
reportBox
.
AddHandler
(
TextBox
.
DropEvent
,
new
DragEventHandler
(
ReportBox_Drop
),
true
);
}
//Closeボタン実行
...
...
@@ -188,14 +190,14 @@ namespace CSRender
string
targetTIFFPath
=
System
.
IO
.
Path
.
Combine
(
workBox
.
Text
,
"work"
,
"targetTIFF"
);
if
(
Directory
.
Exists
(
targetTIFFPath
))
//指定先にTIFF用フォルダがあるか
{
Directory
.
Delete
(
targetTIFFPath
,
true
);
//あれば古いTIFF用フォルダを削除(前回作業時の生成物との混同防止)
Directory
.
Delete
(
targetTIFFPath
,
true
);
//あれば古いTIFF用フォルダを削除(前回作業時の生成物との混同防止)
}
Directory
.
CreateDirectory
(
targetTIFFPath
);
//新規でTIFF用フォルダを作成
//CSRenderの実行
string
targetTIFFResult
=
OutputTIFF
.
runCSRender
(
ResolutionBox
.
Text
,
"TIFF"
,
pageFlag
,
selectedPage
,
targetBox
.
Text
,
targetTIFFPath
);
ResultConsole
.
Text
+=
" リファレンスファイルをTIFF画像に変換中\r\n"
;
DoEvents
();
...
...
@@ -203,7 +205,7 @@ namespace CSRender
string
referenceTIFFPath
=
System
.
IO
.
Path
.
Combine
(
workBox
.
Text
,
"work"
,
"referenceTIFF"
);
if
(
Directory
.
Exists
(
referenceTIFFPath
))
//指定先にTIFF用フォルダがあるか
{
Directory
.
Delete
(
referenceTIFFPath
,
true
);
//あれば古いTIFF用フォルダを削除(前回作業時の生成物との混同防止)
Directory
.
Delete
(
referenceTIFFPath
,
true
);
//あれば古いTIFF用フォルダを削除(前回作業時の生成物との混同防止)
}
Directory
.
CreateDirectory
(
referenceTIFFPath
);
//新規でTIFF用フォルダを作成
...
...
@@ -214,16 +216,40 @@ namespace CSRender
ResultConsole
.
Text
+=
"<TIFF変換完了>\r\n\r\n"
;
DoEvents
();
//検版レポートの入力チェック
bool
reportFlag
=
false
;
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の実行
//string workDir = CompareTIFF.runPureVerify(targetBox.Text, referenceBox.Text, workBox.Text);
string
workDir
=
CompareTIFF
.
runPureVerify
(
targetTIFFPath
,
referenceTIFFPath
,
workBox
.
Text
,
shiftPixel
,
colorMargin
,
removePoint
,
shadingOff
);
,
shiftPixel
,
colorMargin
,
removePoint
,
shadingOff
,
reportFlag
,
reportBox
.
Text
);
//レポートを出力
outputLog
(
System
.
IO
.
Path
.
Combine
(
workDir
,
"report"
));
//レポート名を取得
string
PDFName
=
CompareTIFF
.
getReportName
(
workDir
);
string
PDFName
=
""
;
if
(
reportBox
.
Text
!=
""
)
{
PDFName
=
reportBox
.
Text
;
}
else
{
PDFName
=
CompareTIFF
.
getReportName
(
workDir
);
}
//指定先にレポートを移動
CompareTIFF
.
moveReport
(
workBox
.
Text
,
workDir
);
...
...
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