29 |
30 |
30 enum Kind { case writeln, warning, error_message } |
31 enum Kind { case writeln, warning, error_message } |
31 sealed case class Message( |
32 sealed case class Message( |
32 kind: Kind, |
33 kind: Kind, |
33 text: String, |
34 text: String, |
34 override val verbose: Boolean = false |
35 override val verbose: Boolean = false, |
|
36 override val status: Boolean = false |
35 ) extends Msg { |
37 ) extends Msg { |
36 override def message: Message = this |
38 override def message: Message = this |
37 |
39 |
38 lazy val output_text: String = |
40 lazy val output_text: String = |
39 kind match { |
41 kind match { |
48 sealed case class Theory( |
50 sealed case class Theory( |
49 theory: String, |
51 theory: String, |
50 session: String = "", |
52 session: String = "", |
51 percentage: Option[Int] = None, |
53 percentage: Option[Int] = None, |
52 total_time: Time = Time.zero, |
54 total_time: Time = Time.zero, |
53 override val verbose: Boolean = true |
55 override val verbose: Boolean = true, |
|
56 override val status: Boolean = false |
54 ) extends Msg { |
57 ) extends Msg { |
55 override def message: Message = |
58 override def message: Message = |
56 Message(Kind.writeln, print_session + print_theory + print_percentage + print_total_time, |
59 Message(Kind.writeln, print_session + print_theory + print_percentage + print_total_time, |
57 verbose = verbose) |
60 verbose = verbose, status = status) |
58 |
61 |
59 def print_session: String = if_proper(session, session + ": ") |
62 def print_session: String = if_proper(session, session + ": ") |
60 def print_theory: String = "theory " + theory |
63 def print_theory: String = "theory " + theory |
61 def print_percentage: String = |
64 def print_percentage: String = |
62 percentage match { case None => "" case Some(p) => " " + p + "%" } |
65 percentage match { case None => "" case Some(p) => " " + p + "%" } |
94 val result = new mutable.ListBuffer[Theory] |
97 val result = new mutable.ListBuffer[Theory] |
95 // pending theories |
98 // pending theories |
96 for (name <- domain; thy <- theory_progress(name, (p, q) => p == q && p > 0)) result += thy |
99 for (name <- domain; thy <- theory_progress(name, (p, q) => p == q && p > 0)) result += thy |
97 // running theories |
100 // running theories |
98 for (name <- domain; thy <- theory_progress(name, (p, q) => p != q && p < 100)) result += thy |
101 for (name <- domain; thy <- theory_progress(name, (p, q) => p != q && p < 100)) result += thy |
99 result.toList |
102 result.toList.map(thy => thy.copy(status = true)) |
100 } |
103 } |
101 } |
104 } |
102 |
105 |
103 |
106 |
104 /* status lines (e.g. at bottom of output) */ |
107 /* status lines (e.g. at bottom of output) */ |