Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tapasco
tapasco
Commits
6309f09d
Commit
6309f09d
authored
Nov 02, 2017
by
Jens Korinth
Browse files
Make EvaluateIP close its FileWatchers
* related to
#137
, but does not seem to fix it completely
parent
179dd5f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/scala/tapasco/activity/EvaluateIP.scala
View file @
6309f09d
...
...
@@ -23,6 +23,8 @@
**/
package
de.tu_darmstadt.cs.esa.tapasco.activity
import
de.tu_darmstadt.cs.esa.tapasco._
import
de.tu_darmstadt.cs.esa.tapasco.base._
import
de.tu_darmstadt.cs.esa.tapasco.filemgmt.LogTrackingFileWatcher
import
de.tu_darmstadt.cs.esa.tapasco.reports._
import
de.tu_darmstadt.cs.esa.tapasco.util._
import
de.tu_darmstadt.cs.esa.tapasco.util.ZipUtils._
...
...
@@ -111,7 +113,7 @@ object EvaluateIP {
/** Perform the evaluation.
* @return true if successful **/
def
apply
(
zipFile
:
Path
,
targetPeriod
:
Double
,
targetPart
:
String
,
reportFile
:
Path
)
:
Boolean
=
{
def
apply
(
zipFile
:
Path
,
targetPeriod
:
Double
,
targetPart
:
String
,
reportFile
:
Path
)
(
implicit
cfg
:
Configuration
)
:
Boolean
=
{
def
deleteOnExit
(
f
:
java.io.File
)
=
f
.
deleteOnExit
//def deleteOnExit(f: java.io.File) = f // keep files?
...
...
@@ -123,6 +125,8 @@ object EvaluateIP {
val
files
=
new
Files
(
zipFile
,
reportFile
)
writeTclScript
(
files
,
targetPart
,
targetPeriod
)
val
lt
=
new
LogTrackingFileWatcher
(
Some
(
logger
))
cfg
.
verbose
foreach
{
_
=>
lt
+=
files
.
logFile
}
logger
.
info
(
"starting {}, output in {}"
,
runPrefix
:
Any
,
files
.
logFile
)
val
vivadoCmd
=
Seq
(
"vivado"
,
...
...
@@ -133,6 +137,8 @@ object EvaluateIP {
logger
.
trace
(
"Vivado command: {}"
,
vivadoCmd
mkString
" "
)
cfg
.
verbose
foreach
{
_
=>
lt
.
closeAll
}
// execute Vivado (max runtime: 1d)
val
r
=
InterruptibleProcess
(
Process
(
vivadoCmd
,
files
.
baseDir
.
toFile
),
waitMillis
=
Some
(
24
*
60
*
60
*
1000
)).!(
io
)
...
...
Write
Preview
Supports
Markdown
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