Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scidetect
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cyril Labbe
scidetect
Commits
7f545c98
Commit
7f545c98
authored
Feb 25, 2015
by
Tien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to save detail log
parent
e342b3bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
53 deletions
+18
-53
scidetect/src/scigenchecker_local/ScigenChecker_Local.java
scidetect/src/scigenchecker_local/ScigenChecker_Local.java
+18
-53
No files found.
scidetect/src/scigenchecker_local/ScigenChecker_Local.java
View file @
7f545c98
...
...
@@ -20,6 +20,7 @@ import Checker.Classifier;
import
Checker.DistantCalculator
;
import
Checker.Indexer
;
import
Checker.Reader
;
import
Logger.Log
;
import
TextExtractor.pdfextractor
;
import
java.io.BufferedReader
;
import
java.io.File
;
...
...
@@ -39,14 +40,15 @@ import java.util.HashMap;
*/
public
class
ScigenChecker_Local
{
private
String
loglocation
;
private
String
detailloglocation
;
//
private String loglocation;
//
private String detailloglocation;
private
String
testpath
;
private
String
logtime
;
//
private String logtime;
private
HashMap
<
String
,
HashMap
<
String
,
Integer
>>
samples
=
new
HashMap
<
String
,
HashMap
<
String
,
Integer
>>();
private
HashMap
<
String
,
HashMap
<
String
,
Integer
>>
tests
=
new
HashMap
<
String
,
HashMap
<
String
,
Integer
>>();
private
String
SamplesFolder
;
private
HashMap
<
String
,
HashMap
<
String
,
Double
>>
distant
=
new
HashMap
<
String
,
HashMap
<
String
,
Double
>>();
private
Boolean
savedetaillog
=
false
;
private
void
readconfig
()
throws
FileNotFoundException
,
IOException
{
File
conf
=
new
File
(
"config.txt"
);
...
...
@@ -61,11 +63,11 @@ public class ScigenChecker_Local {
}
if
(
b
[
0
].
equals
(
"Default_log_folder"
))
{
loglocation
=
b
[
1
];
Log
.
loglocation
=
b
[
1
];
// System.out.println(loglocation);
}
if
(
b
[
0
].
equals
(
"Default_detail_log_folder"
))
{
detailloglocation
=
b
[
1
];
Log
.
detailloglocation
=
b
[
1
];
//System.out.println(detailloglocation);
}
}
...
...
@@ -77,7 +79,7 @@ public class ScigenChecker_Local {
if
(
testpath
!=
null
)
{
DateFormat
dateFormat
=
new
SimpleDateFormat
(
"HH:mm dd.MM.yyyy"
);
Date
date
=
new
Date
();
logtime
=
dateFormat
.
format
(
date
);
Log
.
logtime
=
dateFormat
.
format
(
date
);
try
{
Reader
reader
=
new
Reader
();
...
...
@@ -95,66 +97,29 @@ public class ScigenChecker_Local {
Classifier
cl
=
new
Classifier
();
String
conclusion
=
cl
.
classify
(
distant
);
System
.
out
.
println
(
conclusion
);
savedetaillog
();
savelog
(
conclusion
);
}
else
{
System
.
out
.
println
(
"can not read path to test folder"
);
}
}
private
void
savedetaillog
()
{
File
distantout
=
new
File
(
detailloglocation
+
logtime
+
".xls"
);
//File distantout = new File(testpath+"/alldistant.xls");
PrintWriter
out
;
try
{
out
=
new
PrintWriter
(
distantout
);
for
(
String
key
:
distant
.
keySet
())
{
for
(
String
key2
:
distant
.
get
(
key
).
keySet
())
{
out
.
println
(
key
+
"\t"
+
key2
+
"\t"
+
distant
.
get
(
key
).
get
(
key2
));
}
Log
log
=
new
Log
();
log
.
savelog
(
conclusion
);
if
(
savedetaillog
)
{
log
.
savedetaillog
(
distant
);
}
out
.
close
();
}
catch
(
FileNotFoundException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
private
void
savelog
(
String
conclusion
)
{
File
distantout
;
if
(!
loglocation
.
equals
(
"logs/"
))
{
distantout
=
new
File
(
loglocation
);
}
else
{
distantout
=
new
File
(
loglocation
+
logtime
+
".xls"
);
}
PrintWriter
out
;
try
{
out
=
new
PrintWriter
(
distantout
);
out
.
write
(
conclusion
);
out
.
close
();
}
catch
(
FileNotFoundException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
System
.
out
.
println
(
"can not read path to test folder"
);
}
}
public
void
readargs
(
String
[]
args
)
{
for
(
int
i
=
0
;
i
<
args
.
length
;
i
+=
2
)
{
for
(
int
i
=
0
;
i
<
args
.
length
;
i
+=
1
)
{
// System.out.println(args[i]);
if
(
args
[
i
].
equals
(
"-l"
))
{
loglocation
=
args
[
i
+
1
];
Log
.
loglocation
=
args
[
i
+
1
];
}
if
(
args
[
i
].
equals
(
"-c"
))
{
testpath
=
args
[
i
+
1
];
}
if
(
args
[
i
].
equals
(
"-d"
))
{
savedetaillog
=
true
;
}
}
}
...
...
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