src/Pure/PIDE/protocol.scala
changeset 66410 72a7e29104f1
parent 66379 6392766f3c25
child 66411 72de7d59e2f7
equal deleted inserted replaced
66409:f749d39c016b 66410:72a7e29104f1
   124 
   124 
   125 
   125 
   126   /* node status */
   126   /* node status */
   127 
   127 
   128   sealed case class Node_Status(
   128   sealed case class Node_Status(
   129     unprocessed: Int, running: Int, warned: Int, failed: Int, finished: Int)
   129     unprocessed: Int, running: Int, warned: Int, failed: Int, finished: Int, consolidated: Boolean)
   130   {
   130   {
   131     def total: Int = unprocessed + running + warned + failed + finished
   131     def total: Int = unprocessed + running + warned + failed + finished
   132   }
   132   }
   133 
   133 
   134   def node_status(
   134   def node_status(
   135     state: Document.State, version: Document.Version, node: Document.Node): Node_Status =
   135     state: Document.State,
       
   136     version: Document.Version,
       
   137     name: Document.Node.Name,
       
   138     node: Document.Node): Node_Status =
   136   {
   139   {
   137     var unprocessed = 0
   140     var unprocessed = 0
   138     var running = 0
   141     var running = 0
   139     var warned = 0
   142     var warned = 0
   140     var failed = 0
   143     var failed = 0
   147       else if (status.is_failed) failed += 1
   150       else if (status.is_failed) failed += 1
   148       else if (status.is_warned) warned += 1
   151       else if (status.is_warned) warned += 1
   149       else if (status.is_finished) finished += 1
   152       else if (status.is_finished) finished += 1
   150       else unprocessed += 1
   153       else unprocessed += 1
   151     }
   154     }
   152     Node_Status(unprocessed, running, warned, failed, finished)
   155     val consolidated = state.node_consolidated(version, name)
       
   156 
       
   157     Node_Status(unprocessed, running, warned, failed, finished, consolidated)
   153   }
   158   }
   154 
   159 
   155 
   160 
   156   /* node timing */
   161   /* node timing */
   157 
   162