src/Pure/ML/ml_statistics.scala
changeset 74852 204273f3a30e
parent 73716 00ef0f401a29
child 74853 7420a7ac1a4c
equal deleted inserted replaced
74851:5280c02f29dc 74852:204273f3a30e
   192   }
   192   }
   193 
   193 
   194   val empty: ML_Statistics = apply(Nil)
   194   val empty: ML_Statistics = apply(Nil)
   195 
   195 
   196   def apply(ml_statistics0: List[Properties.T], heading: String = "",
   196   def apply(ml_statistics0: List[Properties.T], heading: String = "",
   197     domain: String => Boolean = (key: String) => true): ML_Statistics =
   197     domain: String => Boolean = _ => true): ML_Statistics =
   198   {
   198   {
   199     require(ml_statistics0.forall(props => Now.unapply(props).isDefined), "missing \"now\" field")
   199     require(ml_statistics0.forall(props => Now.unapply(props).isDefined), "missing \"now\" field")
   200 
   200 
   201     val ml_statistics = ml_statistics0.sortBy(now)
   201     val ml_statistics = ml_statistics0.sortBy(now)
   202     val time_start = if (ml_statistics.isEmpty) 0.0 else now(ml_statistics.head)
   202     val time_start = if (ml_statistics.isEmpty) 0.0 else now(ml_statistics.head)
   284 
   284 
   285   /* charts */
   285   /* charts */
   286 
   286 
   287   def update_data(data: XYSeriesCollection, selected_fields: List[String]): Unit =
   287   def update_data(data: XYSeriesCollection, selected_fields: List[String]): Unit =
   288   {
   288   {
   289     data.removeAllSeries
   289     data.removeAllSeries()
   290     for (field <- selected_fields) {
   290     for (field <- selected_fields) {
   291       val series = new XYSeries(field)
   291       val series = new XYSeries(field)
   292       content.foreach(entry => series.add(entry.time, entry.get(field)))
   292       content.foreach(entry => series.add(entry.time, entry.get(field)))
   293       data.addSeries(series)
   293       data.addSeries(series)
   294     }
   294     }