lazyval output_text: String =
kind match { case Kind.writeln => Output.writeln_text(text) case Kind.warning => Output.warning_text(text) case Kind.error_message => Output.error_message_text(text)
}
def old_percentage(name: Document.Node.Name): Int = if (old.isEmpty) 0 else old.get(name).percentage
def completed_theories: List[Theory] =
domain.flatMap({ name => val st = apply(name) val p = st.percentage if (p == 100 && p != old_percentage(name)) Some(theory(name, st)) else None
})
def status_theories: List[Theory] =
domain.flatMap({ name => val st = apply(name) val p = st.percentage if (st.progress || (p < 100 && p != old_percentage(name))) {
Some(theory(name, st, status = true))
} else None
})
def long_running_commands(threshold: Time, status: Boolean = false): List[Progress.Message] =
List.from( for {
name <- domain.iterator
st = apply(name)
command_timings <- st.command_timings.valuesIterator
run <- command_timings.long_running(now, threshold).iterator
} yield { val text =
if_proper(session, session + ": ") + "command " + quote(run.name) + " running for " + run.time(now).message + " (line " + run.line + " of theory " + quote(name.theory) + ")"
Progress.Message(Progress.Kind.writeln, text, verbose = true, status = status)
})
}
/* status lines (e.g. at bottom of output) */
trait Status extends Progress { def status_threshold: Time = Time.zero def status_detailed: Boolean = false
def status_output(msgs: Progress.Output): Unit
def status_hide(status: Progress.Output): Unit = ()
def status_clear(): Progress.Session_Output = synchronized { val status = _status
_status = Nil
status_hide(status.map(_._2))
status
}
privatedef output_status(status: Progress.Session_Output): Unit = synchronized {
_status = Nil
status_output(status.map(_._2))
_status = status
}
overridedef output(msgs: Progress.Output): Unit = synchronized { if (msgs.nonEmpty) { val status = status_clear()
status_output(msgs)
output_status(status)
}
}
overridedef nodes_status(nodes_status: Progress.Nodes_Status): Unit = synchronized { val long_running_commands =
nodes_status.long_running_commands(status_threshold, status = status_detailed) val output_commands = if (status_detailed) Nil else long_running_commands
val old_status = status_clear() val new_status = { val buf = new mutable.ListBuffer[(String, Progress.Msg)] val session = nodes_status.session for (old <- old_status if old._1 < session) buf += old if (status_detailed) { for (thy <- nodes_status.status_theories) buf += (session -> thy) for (msg <- long_running_commands) buf += (session -> msg)
} for (old <- old_status if old._1 > session) buf += old
buf.toList
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.