pending request fixed
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sat, 15 May 2004 13:59:46 +0000 (13:59 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sat, 15 May 2004 13:59:46 +0000 (13:59 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@527 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c

index 58d679c32965e54de92b4c1c6de6b98473b2c8a9..72a6f9d7e5cffa208da35e557efa53733d55cc63 100644 (file)
@@ -379,6 +379,8 @@ unsigned get_max_event_number(MainWindow * mw_data)
  * process_traceset, then display all viewers of 
  * the current tab
  * It will then remove all entries from the time_requests array.
+ * CHECK : we give more events than requested to the viewers. They
+ * Have to filter them by themselves.
  */
 
 gint compare_time_request(TimeRequest *a, TimeRequest *b)
@@ -447,12 +449,31 @@ void call_pending_read_hooks(MainWindow * mw_data)
     LttTime end_time = ltt_time_add( time_request->time_window.start_time,
                                      time_request->time_window.time_width);
     
-    if(i == 0 || !(ltt_time_compare(time_request->time_window.start_time, ltt_event_time(tsc->e))<0) )//FIXME This comparison makes no sense (the author) :)
+    if(i == 0 || !(ltt_time_compare(time_request->time_window.start_time, ltt_event_time(tsc->e))<0) )
     {
       /* do it if first request or start_time >= last event's time */
       lttv_process_traceset_seek_time(tsc, time_request->time_window.start_time);
       lttv_process_traceset(tsc, end_time, time_request->num_events);
     }
+    else
+    {
+      if(ltt_time_compare(time_request->time_window.start_time, ltt_event_time(tsc->e))<0
+          && !(ltt_time_compare(end_time, ltt_event_time(tsc->e))<0))
+      {
+        /* Continue reading from current event */
+        lttv_process_traceset(tsc, end_time, time_request->num_events);
+
+      }
+      else
+      {
+        if(ltt_time_compare(time_request->time_window.start_time, end_time) > 0)
+        {
+          /* This is a request for a minimum number of events, give
+           * more events than necessary */
+          lttv_process_traceset(tsc, end_time, time_request->num_events);
+        }
+      }
+    }
 
     /* Call the end of process_traceset hook */
     lttv_hooks_add(tmp_hooks,
This page took 0.025756 seconds and 4 git commands to generate.