Logo Search packages:      
Sourcecode: ygraph version File versions  Download package

void time_list_build ( void   ) 

Build a new global time list from scratch.

Builds a new global_time_list by going through all of the frames of all of the loaded data sets and sorting their time values.

Definition at line 694 of file read_data.c.

References _DataSet::frame, global_data_set_list, global_time_list, _DataSet::nframes, _Frame::time, and time_list_merge().

Referenced by dataset_read_from_file().

{
  DataSet* data_set;
  Frame* frame;
  guint i;
  gint j;

  if (global_data_set_list == NULL)
    return;
  
  if (global_time_list != NULL)
    g_array_free(global_time_list, TRUE);

  global_time_list = g_array_new(FALSE, FALSE, sizeof(gdouble));

  /*
   * For the first data set, just grab all of the times and put them in
   * the global_time_list.
   */
  data_set = g_array_index(global_data_set_list, DataSet*, 0);
  for (j=0; j<data_set->nframes; ++j)
    {
      frame = g_array_index(data_set->frame, Frame*, j);
      g_array_append_val(global_time_list, frame->time);
    }

  /*
   * Loop through the rest of the data sets and merge their frame times
   * with the global time list.
   */
  for (i=1; i<global_data_set_list->len; ++i)
    {
      data_set = g_array_index(global_data_set_list, DataSet*, i);
      time_list_merge(data_set);
    }
}


Generated by  Doxygen 1.6.0   Back to index