Commit 9374818a authored by Lukas Weber's avatar Lukas Weber Committed by Lukas Sommer

Added a Status Message on Fail or Finish of current stage.

parent 279fb16c
......@@ -85,8 +85,9 @@ class VivadoComposer()(implicit cfg: Configuration) extends Composer {
stdoutString => logger.trace("Vivado: {}", stdoutString),
stderrString => logger.trace("Vivado ERR: {}", stderrString)
))
lt.closeAll()
pt.closeAll()
pt.closeWithReturnCode(r)
// check retcode
if (r == InterruptibleProcess.TIMEOUT_RETCODE) {
......
......@@ -77,13 +77,6 @@ class ProgressTrackingFileWatcher(_logger: Option[Logger] = None, pollInterval:
val progressionString = progressionStringsInfo(currentState)._2
logger.info("Started %s (Total Elapsed: %s)".format(progressionString, timeString(start)))
stageStart = System.currentTimeMillis()
//This ensures that this watcher will close all opened files if he reaches the final state.
if(currentState == progressionStringsInfo.length) {
closeAll()
}
}
}
......@@ -98,6 +91,20 @@ class ProgressTrackingFileWatcher(_logger: Option[Logger] = None, pollInterval:
f"${dur.toHours}%d:${dur.toMinutes % 60}%02d:${dur.toSeconds % 60}%02d"
}
/**
* Closes all Files watched by this Watcher and give a corresponding result message based on the return code.
* @param returnCode return code
*/
def closeWithReturnCode(returnCode: Int): Unit = {
if(returnCode == 0) {
logger.info("Finished %s after %s (Total Elapsed: %s)".format(progressionStringsInfo(currentState - 1)._2, timeString(stageStart), timeString(start)))
super.closeAll()
} else {
logger.error("%s failed after %s (Total Elapsed: %s)".format(progressionStringsInfo(currentState)._2, timeString(stageStart), timeString(start)))
super.closeAll()
}
}
addListener(listener)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment