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
e89f11c0
Commit
e89f11c0
authored
Jan 06, 2022
by
tsuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
検版レポートの改良をGUIに反映
parent
9efa8a90
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
145 additions
and
3 deletions
+145
-3
CompareTIFF.cs
Code/CSRender/CSRender/CompareTIFF.cs
+7
-3
MainWindow.xaml.cs
Code/CSRender/CSRender/MainWindow.xaml.cs
+138
-0
No files found.
Code/CSRender/CSRender/CompareTIFF.cs
View file @
e89f11c0
...
...
@@ -75,13 +75,17 @@ namespace CSRender
processStartInfo
.
Arguments
+=
removePoint
;
processStartInfo
.
Arguments
+=
"\" /shadingoff \""
;
processStartInfo
.
Arguments
+=
shadingOff
;
processStartInfo
.
Arguments
+=
"\""
;
processStartInfo
.
Arguments
+=
"\"
"
;
if
(
reportFlag
==
true
)
{
processStartInfo
.
Arguments
+=
"
/inspReport \""
;
processStartInfo
.
Arguments
+=
"/inspReport \""
;
processStartInfo
.
Arguments
+=
reportName
;
processStartInfo
.
Arguments
+=
"\""
;
processStartInfo
.
Arguments
+=
"\"
"
;
}
//レポート記述内容の参照先
processStartInfo
.
Arguments
+=
"/topPageInfo "
;
string
textPath
=
System
.
IO
.
Path
.
Combine
(
"PureVerify.Data"
,
"RipVerify"
,
"work"
,
"OUT_INFO"
,
"CSReportInf.txt"
);
processStartInfo
.
Arguments
+=
System
.
IO
.
Path
.
Combine
(
appDirectory
,
textPath
);
//CSRender.exeを実行
Process
process
=
Process
.
Start
(
processStartInfo
);
...
...
Code/CSRender/CSRender/MainWindow.xaml.cs
View file @
e89f11c0
...
...
@@ -254,6 +254,22 @@ namespace CSRender
ResultConsole
.
ScrollToEnd
();
DoEvents
();
try
{
//レポートへの出力内容を編集
editReport
(
allRipTime
,
workBox
.
Text
);
}
catch
(
Exception
ex
)
{
CustomMsgBox
.
Show
(
mainWindow
,
ex
.
Message
,
"例外が発生しました"
,
MessageBoxButton
.
OK
,
MessageBoxImage
.
Warning
);
//ログ記述
DateTime
faileTIme
=
DateTime
.
Now
;
string
logText
=
"["
+
faileTIme
+
"]"
+
Environment
.
NewLine
;
logText
+=
"例外の生じた処理:検版レポートの編集"
+
Environment
.
NewLine
;
logText
+=
ex
.
Message
+
"\n"
+
ex
.
StackTrace
+
Environment
.
NewLine
;
File
.
AppendAllText
(
System
.
IO
.
Path
.
Combine
(
workLogPath
,
"CSRender.log"
),
logText
);
}
string
workDir
=
""
;
try
{
...
...
@@ -377,6 +393,128 @@ namespace CSRender
}
/// <summary>
/// 指定ディレクトリ内のPDFファイル名を取得する
/// </summary>
private
string
[]
getPDFName
(
string
targetDir
)
{
string
[]
targetFiles
=
System
.
IO
.
Directory
.
GetFiles
(
targetDir
,
"*.pdf"
,
System
.
IO
.
SearchOption
.
TopDirectoryOnly
);
return
targetFiles
;
}
/// <summary>
/// 指定ディレクトリ内のPDFファイルのページ数を取得する
/// </summary>
private
string
getPDFPage
(
string
[]
targetFiles
,
string
tiffDir
)
{
int
[]
PDFPages
=
new
int
[
targetFiles
.
Length
];
for
(
int
i
=
0
;
i
<
targetFiles
.
Length
;
i
++)
{
string
targetName
=
System
.
IO
.
Path
.
GetFileName
(
targetFiles
[
i
])
+
"*.tiff"
;
string
[]
targetPDF
=
System
.
IO
.
Directory
.
GetFiles
(
tiffDir
,
targetName
,
System
.
IO
.
SearchOption
.
TopDirectoryOnly
);
PDFPages
[
i
]
=
targetPDF
.
Length
;
}
//文字列化
string
allPage
=
""
;
for
(
int
i
=
0
;
i
<
PDFPages
.
Length
;
i
++)
{
if
(
i
>
0
)
{
allPage
+=
","
;
}
allPage
+=
PDFPages
[
i
];
}
return
allPage
;
}
/// <summary>
/// レポートの出力内容を編集する
/// </summary>
private
void
editReport
(
string
allRipTime
,
string
workBox
)
{
// .txtのパス
string
appPath
=
System
.
Reflection
.
Assembly
.
GetExecutingAssembly
().
Location
;
//モジュールのパスを取得
string
appDirectory
=
appPath
.
Substring
(
0
,
appPath
.
LastIndexOf
(
@"\"
)
+
1
);
//モジュールの存在するディレクトリを取得
string
outInfoPath
=
System
.
IO
.
Path
.
Combine
(
"PureVerify.Data"
,
"RipVerify"
,
"work"
,
"OUT_INFO"
);
outInfoPath
=
System
.
IO
.
Path
.
Combine
(
appDirectory
,
outInfoPath
);
if
(!
Directory
.
Exists
(
outInfoPath
))
{
Directory
.
CreateDirectory
(
outInfoPath
);
}
string
reportInfoPath
=
System
.
IO
.
Path
.
Combine
(
outInfoPath
,
"CSReportInf.txt"
);
if
(!
File
.
Exists
(
reportInfoPath
))
{
File
.
CreateText
(
reportInfoPath
);
}
//対象フォルダの内容
string
tarTiffDir
=
System
.
IO
.
Path
.
Combine
(
workBox
,
"work"
,
"targetTIFF"
);
//PDFの数
string
[]
targetPDFs
=
getPDFName
(
targetBox
.
Text
);
string
targetNum
=
targetPDFs
.
Length
.
ToString
();
//PDFの名前一覧
string
allTargetName
=
""
;
for
(
int
i
=
0
;
i
<
targetPDFs
.
Length
;
i
++)
{
if
(
i
>
0
)
{
allTargetName
+=
","
;
}
allTargetName
+=
System
.
IO
.
Path
.
GetFileName
(
targetPDFs
[
i
]);
}
//PDFのページ数
string
targetAllPage
=
getPDFPage
(
targetPDFs
,
tarTiffDir
);
//リファレンスフォルダの内容
string
refTiffDir
=
System
.
IO
.
Path
.
Combine
(
workBox
,
"work"
,
"referenceTIFF"
);
//PDFの数
string
[]
referencePDFs
=
getPDFName
(
referenceBox
.
Text
);
string
referenceNum
=
referencePDFs
.
Length
.
ToString
();
//PDFの名前一覧
string
allReferenceName
=
""
;
for
(
int
i
=
0
;
i
<
referencePDFs
.
Length
;
i
++)
{
if
(
i
>
0
)
{
allReferenceName
+=
","
;
}
allReferenceName
+=
System
.
IO
.
Path
.
GetFileName
(
referencePDFs
[
i
]);
}
//PDFのページ数
string
referenceAllPage
=
getPDFPage
(
referencePDFs
,
refTiffDir
);
//.txtファイルに記述する内容
string
writeText
=
"**RESULT_RIP_TIME: \""
+
allRipTime
+
"\"\r\n"
;
writeText
+=
"**ENV_VERSION: \"CSRender Ver 1.1.0\"\r\n"
;
writeText
+=
"**ENV_RIPVERIFY_PATH: \""
+
appPath
+
"\"\r\n"
;
writeText
+=
"**ENV_RIP_PROCESSING: \"PDFium\"\r\n"
;
writeText
+=
"**ENV_IMAGE_RESO: \""
+
ResolutionBox
.
Text
+
"\"\r\n"
;
if
(
PageRange
.
Text
==
"指定"
)
{
writeText
+=
"**ENV_INSPECTION_AREA_SPECIFY: \""
+
pageBox
.
Text
+
"\"\r\n"
;
}
else
{
writeText
+=
"**ENV_INSPECTION_AREA_SPECIFY: \"ALL\"\r\n"
;
}
writeText
+=
"**PDF_REF_FOLDER: \""
+
referenceBox
.
Text
+
"\"\r\n"
;
writeText
+=
"**PDF_REF_FILE_NUM: \""
+
referenceNum
+
"\"\r\n"
;
writeText
+=
"**PDF_REF_NAME: \""
+
allReferenceName
+
"\"\r\n"
;
writeText
+=
"**PDF_REF_PAGE_NUM: \""
+
referenceAllPage
+
"\"\r\n"
;
writeText
+=
"**PDF_TAR_FOLDER: \""
+
targetBox
.
Text
+
"\"\r\n"
;
writeText
+=
"**PDF_TAR_FILE_NUM: \""
+
targetNum
+
"\"\r\n"
;
writeText
+=
"**PDF_TAR_NAME: \""
+
allTargetName
+
"\"\r\n"
;
writeText
+=
"**PDF_TAR_PAGE_NUM: \""
+
targetAllPage
+
"\"\r\n"
;
// StreamWriterオブジェクトのインスタンスを生成
StreamWriter
streamWriter
=
new
StreamWriter
(
reportInfoPath
,
false
,
Encoding
.
GetEncoding
(
"Shift_JIS"
));
// Writeメソッドで文字列データを書き込む
streamWriter
.
Write
(
writeText
);
// StreamWriterオブジェクトを閉じる
streamWriter
.
Close
();
}
/// <summary>
/// TIFF画像化を実行する
/// </summary>
...
...
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